LWN.net Logo

Re: [PATCH 03/19] scheduler: implement workqueue scheduler class

From:  Linus Torvalds <torvalds-AT-linux-foundation.org>
To:  Tejun Heo <tj-AT-kernel.org>
Subject:  Re: [PATCH 03/19] scheduler: implement workqueue scheduler class
Date:  Thu, 1 Oct 2009 09:57:37 -0700 (PDT)
Cc:  jeff-AT-garzik.org, mingo-AT-elte.hu, linux-kernel-AT-vger.kernel.org, akpm-AT-linux-foundation.org, jens.axboe-AT-oracle.com, rusty-AT-rustcorp.com.au, cl-AT-linux-foundation.org, dhowells-AT-redhat.com, arjan-AT-linux.intel.com
Archive-link:  Article, Thread



On Thu, 1 Oct 2009, Tejun Heo wrote:
>
> Implement workqueue scheduler class.  Workqueue sched_class inherits
> fair sched_class and behaves exactly the same as sched_class except
> that it has two callback functions which get called when a task is put
> to sleep and wakes up and doesn't allow switching to different
> scheduler class.

So this looks odd to me.

I agree completely with the callback functions, but what I don't agree 
with is that this is somehow workqueue-related. I bet that others could 
use this, and in fact, I suspect that it should not be tied to the 
scheduler class at all, but to the _thread_.

Just as an example, I could imagine that we would do lock_kernel() 
releasing the kernel lock on scheduling (and re-taking it on wakeup) as a 
callback. Or async IO handling - both done independently of any 
"workqueue" logic.

So tying this to the scheduler class seems a bit odd. But maybe I'm 
missing something?

		Linus


(Log in to post comments)

Copyright © 2009, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds