From: Ingo Molnar <mingo@elte.hu>
To: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] workqueue: don't alloc_percpu for single workqueue
Date: Wed, 21 Jan 2009 11:48:11 +0100 [thread overview]
Message-ID: <20090121104811.GB25531@elte.hu> (raw)
In-Reply-To: <4976EE0B.5090200@cn.fujitsu.com>
* Lai Jiangshan <laijs@cn.fujitsu.com> wrote:
> allocating memory for every cpu for single workqueue is waste.
good idea.
One detail:
> @@ -906,6 +907,13 @@ void destroy_workqueue(struct workqueue_struct *wq)
> const struct cpumask *cpu_map = wq_cpu_map(wq);
> int cpu;
>
> + if (is_wq_single_threaded(wq)) {
> + cleanup_workqueue_thread(wq->cpu_wq);
> + kfree(wq->cpu_wq);
> + kfree(wq);
> + return;
> + }
> +
> cpu_maps_update_begin();
> spin_lock(&workqueue_lock);
> list_del(&wq->list);
Arent we forgetting to remove the workqueue from the &workqueues list in
the new single-thread case?
Also, see the checkpatch output from kernel/workqueue.c - the warnings
below are correct and should be cleaned up.
Ingo
WARNING: printk() should include KERN_ facility level
#268: FILE: workqueue.c:268:
+ printk("%s: recursion depth exceeded: %d\n",
ERROR: code indent should use tabs where possible
#304: FILE: workqueue.c:304:
+^I^I^I^I ^Itask_pid_nr(current));$
ERROR: "foo* bar" should be "foo *bar"
#555: FILE: workqueue.c:555:
+ struct timer_list* timer)
ERROR: code indent should use tabs where possible
#916: FILE: workqueue.c:916:
+ ^Icpu_maps_update_done();$
kernel/workqueue.c has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
next prev parent reply other threads:[~2009-01-21 10:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-21 9:42 Lai Jiangshan
2009-01-21 10:29 ` Frédéric Weisbecker
2009-01-21 10:48 ` Ingo Molnar [this message]
2009-01-22 1:05 ` Lai Jiangshan
2009-01-21 12:17 ` Oleg Nesterov
2009-01-22 3:42 ` Lai Jiangshan
2009-01-22 16:11 ` Oleg Nesterov
2009-02-16 2:39 ` Lai Jiangshan
2009-01-21 13:01 ` Eric Dumazet
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=20090121104811.GB25531@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@linux-foundation.org \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@tv-sign.ru \
/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®