[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wiNoAk8v3GrbK3=q6KRBrhLrTafTmWmAo6-up6Ce9fp6A@mail.gmail.com>
Date: Wed, 11 Mar 2020 17:38:14 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: NeilBrown <neilb@...e.de>
Cc: Jeff Layton <jlayton@...nel.org>, yangerkun <yangerkun@...wei.com>,
kernel test robot <rong.a.chen@...el.com>,
LKML <linux-kernel@...r.kernel.org>, lkp@...ts.01.org,
Bruce Fields <bfields@...ldses.org>,
Al Viro <viro@...iv.linux.org.uk>
Subject: Re: [locks] 6d390e4b5d: will-it-scale.per_process_ops -96.6% regression
On Wed, Mar 11, 2020 at 3:22 PM NeilBrown <neilb@...e.de> wrote:
>
> We can combine the two ideas - move the list_del_init() later, and still
> protect it with the wq locks. This avoids holding the lock across the
> callback, but provides clear atomicity guarantees.
Ugfh. Honestly, this is disgusting.
Now you re-take the same lock in immediate succession for the
non-callback case. It's just hidden.
And it's not like the list_del_init() _needs_ the lock (it's not
currently called with the lock held).
So that "hold the lock over list_del_init()" seems to be horrendously
bogus. It's only done as a serialization thing for that optimistic
case.
And that optimistic case doesn't even *want* that kind of
serialization. It really just wants a "I'm done" flag.
So no. Don't do this. It's mis-using the lock in several ways.
Linus
Powered by blists - more mailing lists