[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180215130114.GD16623@arm.com>
Date: Thu, 15 Feb 2018 13:01:15 +0000
From: Will Deacon <will.deacon@....com>
To: Matthew Wilcox <willy@...radead.org>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Al Viro <viro@...iv.linux.org.uk>
Subject: Re: [PATCH] fs: dcache: Avoid livelock between d_alloc_parallel and
__d_add
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@...radead.org>
> > Cc: Al Viro <viro@...iv.linux.org.uk>
> > Signed-off-by: Will Deacon <will.deacon@....com>
>
> Reviewed-by: Matthew Wilcox <mawilcox@...rosoft.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
Powered by blists - more mailing lists