From: Peter Zijlstra <peterz@infradead.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-kernel@vger.kernel.org, pjt@google.com,
paul.mckenney@linaro.org, tglx@linutronix.de, tj@kernel.org,
suresh.b.siddha@intel.com, venki@google.com, mingo@redhat.com,
robin.randhawa@arm.com, Steve.Bannister@arm.com,
Arvind.Chauhan@arm.com, amit.kucheria@linaro.org,
vincent.guittot@linaro.org, linaro-dev@lists.linaro.org,
patches@linaro.org
Subject: Re: [PATCH 3/3] workqueue: Schedule work on non-idle cpu instead of current one
Date: Tue, 25 Sep 2012 13:22:25 +0200 [thread overview]
Message-ID: <1348572145.3881.18.camel@twins> (raw)
In-Reply-To: <3232b3192e2e373cc4aaf43359d454c5ad53cddb.1348568074.git.viresh.kumar@linaro.org>
On Tue, 2012-09-25 at 16:06 +0530, Viresh Kumar wrote:
> @@ -1066,8 +1076,9 @@ int queue_work(struct workqueue_struct *wq,
> struct work_struct *work)
> {
> int ret;
>
> - ret = queue_work_on(get_cpu(), wq, work);
> - put_cpu();
> + preempt_disable();
> + ret = queue_work_on(wq_select_cpu(), wq, work);
> + preempt_enable();
>
> return ret;
> }
Right, so the problem I see here is that wq_select_cpu() is horridly
expensive..
> @@ -1102,7 +1113,7 @@ static void delayed_work_timer_fn(unsigned long
> __data)
> struct delayed_work *dwork = (struct delayed_work *)__data;
> struct cpu_workqueue_struct *cwq = get_work_cwq(&dwork->work);
>
> - __queue_work(smp_processor_id(), cwq->wq, &dwork->work);
> + __queue_work(wq_select_cpu(), cwq->wq, &dwork->work);
> }
Shouldn't timer migration have sorted this one?
next prev parent reply other threads:[~2012-09-25 11:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-25 10:36 [PATCH 0/3] Create sched_select_cpu() and use it in workqueues Viresh Kumar
2012-09-25 10:36 ` [PATCH 1/3] sched: Create sched_select_cpu() to give preferred CPU for power saving Viresh Kumar
2012-09-25 10:52 ` Peter Zijlstra
2012-09-25 10:36 ` [PATCH 2/3] workqueue: create __flush_delayed_work to avoid duplicating code Viresh Kumar
2012-09-25 17:47 ` Tejun Heo
2012-09-26 4:22 ` Viresh Kumar
2012-09-25 10:36 ` [PATCH 3/3] workqueue: Schedule work on non-idle cpu instead of current one Viresh Kumar
2012-09-25 11:22 ` Peter Zijlstra [this message]
2012-09-25 11:30 ` Viresh Kumar
2012-09-25 11:38 ` Vincent Guittot
2012-09-25 11:40 ` Peter Zijlstra
2012-09-25 11:46 ` Peter Zijlstra
2012-09-25 17:56 ` Tejun Heo
2012-09-26 11:21 ` Viresh Kumar
2012-09-25 11:20 ` [PATCH 0/3] Create sched_select_cpu() and use it in workqueues Viresh Kumar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1348572145.3881.18.camel@twins \
--to=peterz@infradead.org \
--cc=Arvind.Chauhan@arm.com \
--cc=Steve.Bannister@arm.com \
--cc=amit.kucheria@linaro.org \
--cc=linaro-dev@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=patches@linaro.org \
--cc=paul.mckenney@linaro.org \
--cc=pjt@google.com \
--cc=robin.randhawa@arm.com \
--cc=suresh.b.siddha@intel.com \
--cc=tglx@linutronix.de \
--cc=tj@kernel.org \
--cc=venki@google.com \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.