From: Andrew Morton <akpm@osdl.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: + schedule_on_each_cpu-use-preempt_disable.patch added to -mm tree
Date: Fri, 15 Dec 2006 08:11:38 -0800 [thread overview]
Message-ID: <20061215081138.4c51e7c5.akpm@osdl.org> (raw)
In-Reply-To: <20061215083112.GB10687@elte.hu>
On Fri, 15 Dec 2006 09:31:12 +0100
Ingo Molnar <mingo@elte.hu> wrote:
>
> * akpm@osdl.org <akpm@osdl.org> wrote:
>
> > - mutex_lock(&workqueue_mutex);
> > + preempt_disable(); /* CPU hotplug */
> > for_each_online_cpu(cpu) {
> > INIT_WORK(per_cpu_ptr(works, cpu), func);
> > __queue_work(per_cpu_ptr(keventd_wq->cpu_wq, cpu),
> > per_cpu_ptr(works, cpu));
> > }
> > - mutex_unlock(&workqueue_mutex);
> > + preempt_enable();
>
> Why not cpu_hotplug_lock()?
>
Because the workqueue code was explicitly switched over to per-subsystem
cpu-hotplug locking.
Because lock_cpu_hotplug() is a complete turkey, source of deadlocks and
overall bad idea.
This is actually a pretty simple problem. A subsystem has per-cpu reosurces,
and it needs to lock them while using them. duh. We know how to do that
sort of thing. But because the first implementation of lock_cpu_hotplug()
was conceived with magical properties, we seem to think we need to retain
magical properties. We don't...
next prev parent reply other threads:[~2006-12-15 16:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200612150823.kBF8NV2u011171@shell0.pdx.osdl.net>
2006-12-15 8:31 ` Ingo Molnar
2006-12-15 16:11 ` Andrew Morton [this message]
2006-12-15 16:24 ` Ingo Molnar
2006-12-15 19:27 ` Andrew Morton
2006-12-15 17:51 ` [PATCH] struct vfsmount : keep mnt_count & mnt_expiry_mark away from mnt_flags Eric Dumazet
2006-12-15 18:38 ` [PATCH] avoid one conditional branch in touch_atime() 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=20061215081138.4c51e7c5.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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®