mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: dipankar@in.ibm.com
Cc: Linus Torvalds <torvalds@osdl.org>, Dave Jones <davej@redhat.com>,
	ego@in.ibm.com, rusty@rustcorp.com.au,
	linux-kernel@vger.kernel.org, arjan@intel.linux.com,
	mingo@elte.hu, vatsa@in.ibm.com, ashok.raj@intel.com
Subject: Re: [RFC][PATCH 0/4] Redesign cpu_hotplug locking.
Date: Sat, 26 Aug 2006 23:46:18 -0700	[thread overview]
Message-ID: <20060826234618.b9b2535a.akpm@osdl.org> (raw)
In-Reply-To: <20060827061155.GC22565@in.ibm.com>

On Sun, 27 Aug 2006 11:41:55 +0530
Dipankar Sarma <dipankar@in.ibm.com> wrote:

> Now coming to the read-side of lock_cpu_hotplug() - cpu hotplug
> is a very special asynchronous event. You cannot protect against
> it using your own subsystem lock because you don't control
> access to cpu_online_map.

Yes you do.  Please, read _cpu_up(), _cpu_down() and the example in
workqueue_cpu_callback().  It's really very simple.

> With multiple low-level subsystems
> needing it, it also becomes difficult to work out the lock
> hierarchies.

That'll matter if we do crappy code.  Let's not do that?

> > 
> > I rather doubt that anyone will be hitting the races in practice.  I'd
> > recommend simply removing all the lock_cpu_hotplug() calls for 2.6.18.
> 
> I don't think that is a good idea.

The code's already racy and I don't think anyone has reported a
cpufreq-vs-hotplug race.

> The right thing to do would be to
> do an audit and clean up the bad lock_cpu_hotplug() calls.

No, that won't fix it.  For example, take a look at all the *callers* of
cpufreq_update_policy().  AFAICT they're all buggy.  Fiddling with the
existing lock_cpu_hotplug() sites won't fix that.  (Possibly this
particular problem can be fixed by checking that the relevant CPU is still
online after the appropriate locking has been taken - dunno).

It needs to be ripped out and some understanding, thought and design should
be applied to the problem.

> People
> seem to have just got lazy with lock_cpu_hotplug().

That's because lock_cpu_hotplug() purports to be some magical thing which
makes all your troubles go away.

  reply	other threads:[~2006-08-27  6:46 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-24 10:26 Gautham R Shenoy
2006-08-24 10:34 ` Ingo Molnar
2006-08-24 11:27   ` Gautham R Shenoy
2006-08-24 11:24     ` Ingo Molnar
2006-08-24 16:17 ` Andrew Morton
2006-08-25  9:50   ` Dave Jones
2006-08-26 21:09     ` Linus Torvalds
2006-08-26 22:04       ` Andrew Morton
2006-08-27  6:11         ` Dipankar Sarma
2006-08-27  6:46           ` Andrew Morton [this message]
2006-08-27  7:11             ` Dipankar Sarma
2006-08-27  7:42               ` Andrew Morton
2006-08-27  8:57                 ` Nick Piggin
2006-08-27 11:06                 ` Dipankar Sarma
2006-08-27 17:21                   ` Andrew Morton
2006-08-27 17:49                     ` Dipankar Sarma
2006-08-27 18:01                       ` Andrew Morton
2006-08-27  7:37             ` Dipankar Sarma
2006-08-27  7:57               ` Andrew Morton
2006-08-26 22:05       ` Ingo Molnar
2006-08-26 22:25         ` Andrew Morton
2006-08-28  2:37   ` Srivatsa Vaddagiri

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=20060826234618.b9b2535a.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=arjan@intel.linux.com \
    --cc=ashok.raj@intel.com \
    --cc=davej@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=ego@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rusty@rustcorp.com.au \
    --cc=torvalds@osdl.org \
    --cc=vatsa@in.ibm.com \
    /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®