From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jakub Kicinski Subject: Re: [PATCH 2/4] swait: add the missing killable swaits Date: Thu, 29 Jun 2017 13:58:22 -0700 Message-ID: <20170629135822.366fd67a@cakuba.netronome.com> References: <20170629125402.GH26046@kroah.com> <20170629133530.GA14747@kroah.com> <20170629174046.GC3954@linux-80c1.suse> <20170629183339.GD3954@linux-80c1.suse> <20170629194015.GQ21846@wotan.suse.de> <20170629194455.GR21846@wotan.suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20170629194455.GR21846-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: "Luis R. Rodriguez" Cc: nbroeking-BUHhN+a2lJ4@public.gmane.org, Linus Torvalds , Davidlohr Bueso , Thomas Gleixner , Greg KH , mfuzzey-mB3Nsq4MPf1BDgjK7y7TUQ@public.gmane.org, "Eric W. Biederman" , Dmitry Torokhov , Daniel Wagner , David Woodhouse , jewalt-d4N2ExZK1jaSe5ORCPIMD9BPR1lH4CV8@public.gmane.org, rafal-g1n6cQUeyibVItvQsEIGlw@public.gmane.org, Arend Van Spriel , "Rafael J. Wysocki" , "Li, Yi" , atull-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, Moritz Fischer , Petr Mladek , Johannes Berg , Emmanuel Grumbach , "Coelho, Luciano" List-Id: linux-api@vger.kernel.org On Thu, 29 Jun 2017 21:44:55 +0200, Luis R. Rodriguez wrote: > On Thu, Jun 29, 2017 at 09:40:15PM +0200, Luis R. Rodriguez wrote: > > On Thu, Jun 29, 2017 at 11:59:29AM -0700, Linus Torvalds wrote: > > > On Thu, Jun 29, 2017 at 11:33 AM, Davidlohr Bueso wrote: > > > > On Thu, 29 Jun 2017, Linus Torvalds wrote: > > > > > > > >> 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()". > > > > > > > > But you still need the notion of a queue, even if you wake one task > > > > at a time... I'm probably missing your point here. > > > > > > The *reason* they wake up only one seems to be that there really is > > > just one. It's some per-cpu idle thread for kvm, and for RCU it's the > > > RCU workqueue thread. > > > > > > So the queue literally looks suspiciously pointless. > > > > > > But I might be wrong, and there can actually be multiple entries. > > > > Since this swake_up() --> swake_up_all() reportedly *fixed* the one wake up > > issue it would seem this does queue [0]. That said, I don't see any simple tests > > tools/testing/selftests/swait but then again we don't have test for regular > > waits either... > > > > [0] https://bugzilla.kernel.org/show_bug.cgi?id=195477 > > I should also note that the swake_up_all() should have only helped in cases where > 3 cards were used, as if only 2 were used that should have been covered by just > the swake_up(). Unless of course I hear otherwise by the reporter, Nicolas or > from Jakub. I was hitting this with 2 cards.