From: Nick Piggin <npiggin@kernel.dk>
To: Jonathan Corbet <corbet@lwn.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Tejun Heo <tj@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Rusty Russell <rusty@rustcorp.com.au>,
Al Viro <viro@zeniv.linux.org.uk>,
Nick Piggin <npiggin@kernel.dk>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] lglock: make lg_lock_global() actually lock globally
Date: Thu, 26 Aug 2010 14:23:35 +1000 [thread overview]
Message-ID: <20100826042335.GB4781@amd> (raw)
In-Reply-To: <20100825141644.715258cc@bike.lwn.net>
On Wed, Aug 25, 2010 at 02:16:44PM -0600, Jonathan Corbet wrote:
> On Wed, 25 Aug 2010 13:00:59 -0700
> Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
> > Grrr. Same disease as Nick and others. Why do you repeat the subject
> > line in the body? Don't do that. We don't want the summary line twice
> > in the commit message, and we don't want it twice in the email.
> >
> > We simply don't want it twice. Full stop.
>
> Sorry, I just pasted in the "git format-patch" output. Will never ever
> ever do it again I promise cross my heart.
>
> > > lg_lock_global() currently only acquires spinlocks for online CPUs, but
> > > it's meant to lock all possible CPUs. At Nick's suggestion, change
> > > for_each_online_cpu() to for_each_possible_cpu() to get the expected
> > > behavior.
> >
> > Can you say what this actually matters for? Don't we do stop-machine
> > for CPU hotplug anyway? And if we don't, shouldn't we? Exactly because
> > otherwise "for_each_online_cpu()" is always racy (and that has nothing
> > to do with the lglock).
>
> As I understand it from Nick (after I asked him why the two lock
> primitives were identical): the files_lock scalability work puts a
> per-CPU list of open files into each superblock. A CPU can be offlined
> while there are open files in "its" lists, and nothing is done to shift
> those files to a still-online CPU's list. So there will still be
> cross-CPU accesses to those lists as those files are closed; that means
> we need to be sure to acquire locks associated with offline CPUs if we
> want to avoid races.
>
> lg_global_lock_online() is used (only) in the brlock implementation,
> instead. In this case, there's no leftover data if a CPU goes
> offline, so no need to take locks associated with offline CPUs.
Yep, thanks Jon, I owe a bit more documentation in that file, coming up.
next prev parent reply other threads:[~2010-08-26 4:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-25 19:28 [PATCH] lglock: make lg_lock_global() actually lock globally Jonathan Corbet
2010-08-25 20:00 ` Linus Torvalds
2010-08-25 20:16 ` Jonathan Corbet
2010-08-26 4:23 ` Nick Piggin [this message]
2010-08-26 8:55 ` Tejun Heo
2010-08-26 9:46 ` Nick Piggin
2010-08-26 9:49 ` Tejun Heo
2010-08-26 9:50 ` Tejun Heo
2010-08-26 10:08 ` Peter Zijlstra
2010-08-26 11:38 ` Nick Piggin
2010-08-26 11:45 ` Peter Zijlstra
2010-08-26 11:49 ` Peter Zijlstra
2010-08-27 5:51 ` Nick Piggin
2010-08-27 7:57 ` Peter Zijlstra
2010-08-27 7:59 ` Peter Zijlstra
2010-08-26 10:08 ` Peter Zijlstra
-- strict thread matches above, loose matches on Subject: below --
2010-09-08 22:54 Jonathan Corbet
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=20100826042335.GB4781@amd \
--to=npiggin@kernel.dk \
--cc=a.p.zijlstra@chello.nl \
--cc=corbet@lwn.net \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=tj@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
/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.