[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFz=6XmH5MfwKLN6MZSyG8fAk-aD67mbDc1ZaKySzsq8aw@mail.gmail.com>
Date: Thu, 29 Jun 2017 10:57:53 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Davidlohr Bueso <dave@...olabs.net>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Greg KH <gregkh@...uxfoundation.org>,
"Luis R. Rodriguez" <mcgrof@...nel.org>, mfuzzey@...keon.com,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Daniel Wagner <wagi@...om.org>,
David Woodhouse <dwmw2@...radead.org>,
jewalt@...innovations.com, rafal@...ecki.pl,
Arend Van Spriel <arend.vanspriel@...adcom.com>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
"Li, Yi" <yi1.li@...ux.intel.com>, atull@...nel.org,
Moritz Fischer <moritz.fischer@...us.com>,
Petr Mladek <pmladek@...e.com>,
Johannes Berg <johannes.berg@...el.com>,
Emmanuel Grumbach <emmanuel.grumbach@...el.com>,
"Coelho, Luciano" <luciano.coelho@...el.com>,
Kalle Valo <kvalo@...eaurora.org>,
Andrew Lutomirski <luto@...nel.org>,
Kees Cook <keescook@...omium.org>,
"AKASHI, Takahiro" <takahiro.akashi@...aro.org>,
David Howells <dhowells@...hat.com>,
Peter Jones <pjones@...hat.com>,
Hans de Goede <hdegoede@...hat.com>,
Alan Cox <alan@...ux.intel.com>,
"Theodore Ts'o" <tytso@....edu>,
Michael Kerrisk <mtk.manpages@...il.com>,
Paul Gortmaker <paul.gortmaker@...driver.com>,
Marcelo Tosatti <mtosatti@...hat.com>,
Matthew Wilcox <mawilcox@...rosoft.com>,
Linux API <linux-api@...r.kernel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"stable # 4 . 6" <stable@...r.kernel.org>
Subject: Re: [PATCH 2/4] swait: add the missing killable swaits
On Thu, Jun 29, 2017 at 10:40 AM, Davidlohr Bueso <dave@...olabs.net> wrote:
>
> For all the above, what do you think of my 'sswait' proposal?
I see no actual users of such a specialty interface.
I don't think we've *ever* had any actual problems with our current
wait-queues, apart from the RT issues, which were not about the
waitqueues themselves, but purely about RT itself.
So without some very compelling reason, I'd not want to add yet
another wait-queue.
I actually think swait is pure garbage. Most users only wake up one
process anyway, and using swait for that is stupid. If you only wake
up one, you might as well just have a single process pointer, not a
wait list at all, and then use "wake_up_process()".
There is *one* single user of swake_up_all(), and that one looks like
bogus crap also: it does it outside of the spinlock that could have
been used to protect the queue - p,lus I'm not sure there's really a
queue anyway, since I think it's just the grace-period kthread that is
there.
kvm uses swait, but doesn't use swake_up_all(), so it always just
wakes up a single waiter. That may be the right thing to do. Or it's
just another bug. I don't know. The KVM use looks broken too, since it
does
if (swait_active(wqp)) {
swake_up(wqp);
which is racy wrt new waiters, which implies that there is some
upper-level synchronization - possibly the same "only one thread
anyway".
So swake really looks like crap. It has crap semantics, it has crap
users, it's just broken.
The last thing we want to do is to create something _else_ specialized
like this.
Linus
Powered by blists - more mailing lists