Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3026068rdb; Tue, 12 Sep 2023 22:27:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFVC5UvGDRS6ImWRK7IxZkELi2xw524N0N1tCr115gRhg/hrp9QVnQorSdxM/47icarLH2v X-Received: by 2002:a05:6870:e88a:b0:1bf:8a8:dfa with SMTP id q10-20020a056870e88a00b001bf08a80dfamr1811087oan.11.1694582847194; Tue, 12 Sep 2023 22:27:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694582847; cv=none; d=google.com; s=arc-20160816; b=VwLdOjQlV/zLA2rqVD6MT0/sOfQuy4kanht+1LJ/Iphj/eZoKcRx8gRf49bdrCpdp7 qnkD2VCyhvFXc3ytZpZVXVT9bnARvzy7qUKs2+AODPcsRYBA3Fztf97d8vDhsLSsJEJa g8CmgdKVbxn/1FCV5A2L4IsMbFN04KXIkionxqHy9/42QogsgkA0VG+XWh21eqMmv5fN smfOe0emfjmZgvq0KEsnvb07YZKm8he3usyjuuCJ3FI24y2HCvqhJOSeQAKwtJ0X99Wi ujTl7k9gB8DI4EX7ZEHL9FKSxKIt3WXQAeHNopqaePB4Zsm7jjjOAi64h81pYne4OSYZ xgaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Z8ryHLZvoZYaYVMPT2DZpm/JtTShBG1m5lfT41YyXTQ=; fh=CanAHo375A0SAJ4by8eu5NaTv0wi7PLUR+oV1BbWkcI=; b=Sk5s+dOlXpq/96ptctfIIAOUbmzoP9TVUU1jWp6ebV/Z4tVy+jk1LYQCg+kQSPMQPI 87tVGyG9hh0/jHorTDyRONfGoJesDz7XTB5bNrfef8R+cuWXKcPEuK3D71dfOmA0piir jdX3yd7lElXYRI24XTS3+RkNV8pvrBxeSFLvtFlfkO4ZupuyGS4+mcZMxI/0Ucz57qKk /aUz7LOpwsl1ZhF4czBjJUKSzIYQAkbSnoPsJnrhFBn01yRhOV5ReoUn9UfgjQgoWWM2 nknsrdIGZsJcDtU8q/cc8UU3Zw+/sOYEfM0kdmid40bQWqXbC9ZRT83cr+HHmZVaBRgV x+iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=erCwDK5d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id h22-20020a633856000000b005638355e990si3149208pgn.410.2023.09.12.22.27.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 22:27:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=erCwDK5d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 5DCA6801CFA0; Tue, 12 Sep 2023 05:29:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.8 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235160AbjILM3J (ORCPT + 99 others); Tue, 12 Sep 2023 08:29:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235236AbjILM2i (ORCPT ); Tue, 12 Sep 2023 08:28:38 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B63F199B; Tue, 12 Sep 2023 05:28:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Z8ryHLZvoZYaYVMPT2DZpm/JtTShBG1m5lfT41YyXTQ=; b=erCwDK5dpDueftgDg08gml1I+V arhJrULil/JMQj5sB6V10l8iCXZXlF9ROkiDC1IHUDqRQb9g6npPOA3odnUB63pKKOx8f/Nqg8l5B D8Q1uV4eaZZ6/ezbZli7/EAoFBJD3Ym4nEG6GeajOmsXjPq8Qy8voPKW8Xn5zGeX1iOH6JV2crvEW B5k5hZIYgGfbAn+N/U1rqxv3FZDaf5SmnRNet1nSakFLg6pO4OIS8xa+n/w3kd9TPYfxcfUkMVOCm E518FlHYGY2p91T32c1IK/eu51UlMjjKTA0j8QZZGCu8gr+eWNJR6VCSFtby7tyViqiF5nFGw8y0z qGweLZBw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qg2V3-007XrA-8B; Tue, 12 Sep 2023 12:28:13 +0000 Date: Tue, 12 Sep 2023 13:28:13 +0100 From: Matthew Wilcox To: Peter Zijlstra Cc: Dave Chinner , Waiman Long , Ingo Molnar , Will Deacon , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Chandan Babu R , "Darrick J . Wong" , linux-xfs@vger.kernel.org Subject: Re: [PATCH 1/5] locking: Add rwsem_is_write_locked() Message-ID: References: <20230907193838.GB14243@noisy.programming.kicks-ass.net> <20230908104434.GB24372@noisy.programming.kicks-ass.net> <70d89bf4-708b-f131-f90e-5250b6804d48@redhat.com> <20230912090342.GC35261@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230912090342.GC35261@noisy.programming.kicks-ass.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 12 Sep 2023 05:29:31 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email On Tue, Sep 12, 2023 at 11:03:42AM +0200, Peter Zijlstra wrote: > If not, then sure we can do this; it's not like I managed to get rid of > muteX_is_locked() -- and I actually tried at some point :/ > > And just now I grepped for it, and look what I find: > > drivers/hid/hid-nintendo.c: if (unlikely(mutex_is_locked(&ctlr->output_mutex))) { > drivers/nvdimm/btt.c: if (mutex_is_locked(&arena->err_lock) > > And there's more :-( Are these actually abuse? I looked at these two, and they both seem to be asking "Does somebody else currently have this mutex?" rather than "Do I have this mutex?".