From: "Anil" <anil.s.keshavamurthy@intel.com>
To: "'Rusty Russell'" <rusty@rustcorp.com.au>,
"Andrew Morton" <akpm@osdl.org>
Cc: "lkml - Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] speedup flush_workqueue for singlethread_workqueue
Date: Mon, 7 Jun 2004 10:46:50 -0700 [thread overview]
Message-ID: <ORSMSX409FRaqbC8wSA00000003@orsmsx409.amr.corp.intel.com> (raw)
In-Reply-To: <1086487875.11456.23.camel@bach>
Hi Andrew,
In the flush_workqueue, can we move lock_cpu_hotplug()/unlock_cpu_hotplug only for _non_single_threaded_ case as shown below
as these locks are not required for single_threaded_workqueue.
Thanks,
Anil
The attached patch applies on top of your changes.
Signed-off-by: Anil Keshavamurthy <anil.s.keshavamurthy@intel.com>
---
linux-2.6.7-rc2-mm2-root/kernel/workqueue.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff -puN kernel/workqueue.c~andrew2 kernel/workqueue.c
--- linux-2.6.7-rc2-mm2/kernel/workqueue.c~andrew2 2004-06-07 18:45:20.332139681 -0700
+++ linux-2.6.7-rc2-mm2-root/kernel/workqueue.c 2004-06-07 18:46:09.560680511 -0700
@@ -262,7 +262,6 @@ static void flush_cpu_workqueue(struct c
void fastcall flush_workqueue(struct workqueue_struct *wq)
{
might_sleep();
- lock_cpu_hotplug();
if (is_single_threaded(wq)) {
/* Always use cpu 0's area. */
@@ -270,11 +269,12 @@ void fastcall flush_workqueue(struct wor
} else {
int cpu;
+ lock_cpu_hotplug();
for_each_online_cpu(cpu)
flush_cpu_workqueue(wq->cpu_wq + cpu);
+ unlock_cpu_hotplug();
}
- unlock_cpu_hotplug();
}
static struct task_struct *create_workqueue_thread(struct workqueue_struct *wq,
_
>-----Original Message-----
>From: Rusty Russell [mailto:rusty@rustcorp.com.au]
>Sent: Saturday, June 05, 2004 7:11 PM
>To: Andrew Morton
>Cc: Keshavamurthy, Anil S; lkml - Kernel Mailing List
>Subject: Re: [PATCH] speedup flush_workqueue for singlethread_workqueue
>
>On Sat, 2004-06-05 at 08:30, Andrew Morton wrote:
>> "Anil" <anil.s.keshavamurthy@intel.com> wrote:
>> >
>> > In the flush_workqueue function for a
>single_threaded_worqueue case
>> > the code seemed to loop the same cpu_workqueue_struct for
>> > each_online_cpu's. The attached patch checks this
>condition and bails out of for loop there by speeding up the
>flush_workqueue for a singlethreaded_workqueue.
>>
>>
>> OK, thanks. I think it's a bit clearer to do it as below.
>I haven't
>> tested it though.
>
>Me neither, but agree.
>
>Rusty.
>--
>Anyone who quotes me in their signature is an idiot -- Rusty Russell
>
>
>
prev parent reply other threads:[~2004-06-07 17:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-04 22:13 Anil
2004-06-04 22:30 ` Andrew Morton
2004-06-06 2:11 ` Rusty Russell
2004-06-07 17:46 ` Anil [this message]
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=ORSMSX409FRaqbC8wSA00000003@orsmsx409.amr.corp.intel.com \
--to=anil.s.keshavamurthy@intel.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®