Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751550AbdFZXnP (ORCPT ); Mon, 26 Jun 2017 19:43:15 -0400 Received: from mail-io0-f193.google.com ([209.85.223.193]:36472 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751445AbdFZXnL (ORCPT ); Mon, 26 Jun 2017 19:43:11 -0400 MIME-Version: 1.0 In-Reply-To: <20170626233030.GI21846@wotan.suse.de> References: <20170623233702.20564-1-jakub.kicinski@netronome.com> <20170626233030.GI21846@wotan.suse.de> From: Linus Torvalds Date: Mon, 26 Jun 2017 16:43:10 -0700 X-Google-Sender-Auth: Ai0H59jm2LhVv2rcbUfMqYoYNEA Message-ID: Subject: Re: [PATCH] firmware: wake all waiters To: "Luis R. Rodriguez" Cc: Thomas Gleixner , Peter Zijlstra , DanielWagnerwagi@monom.org, Boqun Feng , Marcelo Tosatti , Paul Gortmaker , Ming Lei , "Li, Yi" , "AKASHI, Takahiro" , Jakub Kicinski , Greg Kroah-Hartman , "Paul E. McKenney" , Davidlohr Bueso , Linux Kernel Mailing List , "Eric W. Biederman" , Petr Mladek , Andrew Lutomirski , Kees Cook , David Howells , Alan Cox , "Theodore Ts'o" , oss-drivers@netronome.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1504 Lines: 39 On Mon, Jun 26, 2017 at 4:30 PM, Luis R. Rodriguez wrote: > > On Mon, Jun 26, 2017 at 02:44:17PM -0700, Linus Torvalds wrote: > > > > Among all the simplifications it has is exactly the fact that it wakes > > up only one thing, because it is *so* specialized. > > Not sure I follow, it can wake up all items in queue with swake_up_all(), no? You can, yes. But it's like using assembly language to build a compiler. Sure, it's possible, but it's the wrong thing to do. The thing should just use regular wait/wakeup, which has sane *default* behavior that people are used to. > If indeed it cannot queue and wake all then surely this is buggered! It's not that it cannot, but that it's much more limited than all our normal waiting support (and it's *meant* for much more limited situations). For example, our regular waiting code can handle not just "wake up one" and "wake up all", it can handle "wake up exclusive waiters, and whoever isn't exclusive". And by default, normal wait queues just do the right thing, so you don't have to specify the exact details of the behavior. Sure, the firmware loader code doesn't _need_ that, but there also isn't one of the users who really needs the very limited interface that has odd semantics and odd default behavior that will trip you up. The swait interface is so special and so undocumented, that I really didn't expect anybody to even know about it unless they had very specific needs, much less use it. Linus