From: Jonathan Corbet <corbet@lwn.net>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: 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: Wed, 25 Aug 2010 14:16:44 -0600 [thread overview]
Message-ID: <20100825141644.715258cc@bike.lwn.net> (raw)
In-Reply-To: <AANLkTimbiEMM+uyYtU41qdCuK7uRavtPYdQyx4d_g3xw@mail.gmail.com>
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.
jon
next prev parent reply other threads:[~2010-08-25 20:16 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-25 19:28 Jonathan Corbet
2010-08-25 20:00 ` Linus Torvalds
2010-08-25 20:16 ` Jonathan Corbet [this message]
2010-08-26 4:23 ` Nick Piggin
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
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=20100825141644.715258cc@bike.lwn.net \
--to=corbet@lwn.net \
--cc=a.p.zijlstra@chello.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=npiggin@kernel.dk \
--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 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®