From: Daniel Wagner <daniel.wagner@bmw-carit.de>
To: Jeff Layton <jlayton@poochiereds.net>
Cc: Andi Kleen <andi@firstfloor.org>, <linux-fsdevel@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, John Kacur <jkacur@redhat.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
"J. Bruce Fields" <bfields@fieldses.org>
Subject: Re: [RFC v1 0/5] fs/locks: Use plain percpu spinlocks instead of lglock to protect file_lock
Date: Wed, 4 Mar 2015 15:03:28 +0100 [thread overview]
Message-ID: <54F710B0.7040507@bmw-carit.de> (raw)
In-Reply-To: <20150302192907.2a58ddcb@tlielax.poochiereds.net>
On 03/03/2015 01:29 AM, Jeff Layton wrote:
>> Hmm, are you sure about that? I read the code this way that when a lock
>> is added to flock_list it stays on that CPU. The locks are not moved
>> from one flock_list to another during their existent.
>>
>
> Yes, I'm sure. When a file lock is acquired, we assign the fl_link_cpu
> to the current CPU and add it to the current CPU's global list. When
> the lock is released, any blocked lock that might have been blocking on
> it could acquire it at that point, and that doesn't necessarily occur
> on the same CPU as where the lock was originally held.
>
> So, it's entirely possible that between when you drop the spinlock on
> one CPU and pick it up on another, the lock could have been released
> and then reacquired on a different CPU.
D'oh. I am an idiot. I didn't really understand it the first time. Yes,
you are right.
cheers,
daniel
prev parent reply other threads:[~2015-03-04 14:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-20 14:39 [RFC v1 0/5] fs/locks: Use plain percpu spinlocks instead of lglock to protect file_lock Daniel Wagner
2015-02-20 14:39 ` [RFC v1 1/5] locks: Remove unnecessary IS_POSIX test Daniel Wagner
2015-02-20 14:39 ` [RFC v1 2/5] locks: Split insert/delete block functions into flock/posix parts Daniel Wagner
2015-02-20 14:39 ` [RFC v1 3/5] seq_file: Add percpu seq_hlist helpers with locking iterators Daniel Wagner
2015-02-20 14:39 ` [RFC v1 4/5] locks: Use percpu spinlocks to protect file_lock_list Daniel Wagner
2015-02-20 14:39 ` [RFC v1 5/5] locks: Use blocked_lock_lock only to protect blocked_hash Daniel Wagner
2015-02-20 16:05 ` [RFC v1 0/5] fs/locks: Use plain percpu spinlocks instead of lglock to protect file_lock Andi Kleen
2015-02-24 15:58 ` Daniel Wagner
2015-02-24 21:06 ` Jeff Layton
2015-02-27 15:01 ` Daniel Wagner
2015-02-27 15:30 ` Jeff Layton
2015-03-02 12:58 ` Daniel Wagner
2015-03-03 0:29 ` Jeff Layton
2015-03-04 14:03 ` Daniel Wagner [this message]
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=54F710B0.7040507@bmw-carit.de \
--to=daniel.wagner@bmw-carit.de \
--cc=andi@firstfloor.org \
--cc=bfields@fieldses.org \
--cc=jkacur@redhat.com \
--cc=jlayton@poochiereds.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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.