Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753329AbdF2SeM (ORCPT ); Thu, 29 Jun 2017 14:34:12 -0400 Received: from mx2.suse.de ([195.135.220.15]:42249 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751941AbdF2SeC (ORCPT ); Thu, 29 Jun 2017 14:34:02 -0400 Date: Thu, 29 Jun 2017 11:33:39 -0700 From: Davidlohr Bueso To: Linus Torvalds Cc: Thomas Gleixner , Greg KH , "Luis R. Rodriguez" , mfuzzey@parkeon.com, "Eric W. Biederman" , Dmitry Torokhov , Daniel Wagner , David Woodhouse , jewalt@lgsinnovations.com, rafal@milecki.pl, Arend Van Spriel , "Rafael J. Wysocki" , "Li, Yi" , atull@kernel.org, Moritz Fischer , Petr Mladek , Johannes Berg , Emmanuel Grumbach , "Coelho, Luciano" , Kalle Valo , Andrew Lutomirski , Kees Cook , "AKASHI, Takahiro" , David Howells , Peter Jones , Hans de Goede , Alan Cox , "Theodore Ts'o" , Michael Kerrisk , Paul Gortmaker , Marcelo Tosatti , Matthew Wilcox , Linux API , linux-fsdevel , Linux Kernel Mailing List , "stable # 4 . 6" Subject: Re: [PATCH 2/4] swait: add the missing killable swaits Message-ID: <20170629183339.GD3954@linux-80c1.suse> References: <20170614222017.14653-1-mcgrof@kernel.org> <20170614222017.14653-3-mcgrof@kernel.org> <20170629125402.GH26046@kroah.com> <20170629133530.GA14747@kroah.com> <20170629174046.GC3954@linux-80c1.suse> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1185 Lines: 30 On Thu, 29 Jun 2017, Linus Torvalds wrote: >So without some very compelling reason, I'd not want to add yet >another wait-queue. Yes, I was expecting this and very much agree. I'll actually take a look at wake_q for wake_up_all() and co. to see if we can reduce the spinlock hold times. Of course it would only make sense for more than a one wakeup. >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. >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. So those cases when there's only one waiter I completely agree should not be using waitqueues. pcpu-rwsems in the past suffered from this. Thanks, Davidlohr