From: Will Deacon <will.deacon@arm.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH] fs: dcache: Avoid livelock between d_alloc_parallel and __d_add
Date: Thu, 15 Feb 2018 13:01:15 +0000 [thread overview]
Message-ID: <20180215130114.GD16623@arm.com> (raw)
In-Reply-To: <20180213151608.GA17791@bombadil.infradead.org>
Hi Matthew,
On Tue, Feb 13, 2018 at 07:16:08AM -0800, Matthew Wilcox wrote:
> On Tue, Feb 13, 2018 at 12:58:51PM +0000, Will Deacon wrote:
> > This patch resolves the livelock by not taking hlist_bl_lock in
> > d_alloc_parallel if the sequence counter is odd, since any subsequent
> > masked comparison with i_dir_seq will fail anyway.
> >
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Al Viro <viro@zeniv.linux.org.uk>
> > Signed-off-by: Will Deacon <will.deacon@arm.com>
>
> Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>
Thanks!
> I wonder whether it makes sense to turn i_dir_seq into a seqcount_t,
> which would give us the lockdep checking as well.
I'm not sure it's quite as simple as that. start_dir_add looks very much
like it's intended to run concurrently, so we'd need a write_seqcount
implementation that provides the same atomicity guarantees.
Will
prev parent reply other threads:[~2018-02-15 13:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-13 12:58 [PATCH] fs: dcache: Avoid livelock between d_alloc_parallel and __d_add Will Deacon
2018-02-13 13:16 ` Peter Zijlstra
2018-02-13 15:16 ` Matthew Wilcox
2018-02-15 13:01 ` Will Deacon [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=20180215130114.GD16623@arm.com \
--to=will.deacon@arm.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
/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