Messages in this thread | | | Date | Mon, 7 Jan 2013 23:29:53 +0530 | Subject | Re: [PATCH V2 Resend 3/4] workqueue: Schedule work on non-idle cpu instead of current one | From | Viresh Kumar <> |
| |
On 7 January 2013 18:58, Steven Rostedt <rostedt@goodmis.org> wrote: > On Mon, 2013-01-07 at 15:28 +0530, Viresh Kumar wrote: >> I have another idea that we can try: >> >> queue_work_on_any_cpu(). > > I think this is a good idea.
:) :)
>> - the mask of cpus to schedule this work on >> OR >> - Sched Level (SD_LEVEL) of cpus to run it. > > I wouldn't give a mask. If one is needed, we could have a > queue_work_on_mask_cpus(), or something. I think the "any" in the name > should be good enough to let developers know that this will not be on > the CPU that is called.
Fair Enough.
> By default, I would suggest for cache locality, > that we try to keep it on the same CPU. But if there's a better CPU to > run on, it runs there.
That would break our intention behind this routine. We should run it on a cpu which we think is the best one for it power/performance wise.
So, i would like to call the sched_select_cpu() routine from this routine to get the suggested cpu.
This routine would however would see more changes later to optimize it more.
> Also, we could still add a debug option that > makes it always run on other CPUs to slap developers that don't read.
I don't think we need it :( It would be a new API, with zero existing users. And so, whomsoever uses it, should know what exactly he is doing :)
Thanks for your quick feedback.
| |