Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2926514rdb; Tue, 12 Sep 2023 17:23:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEmriNXIPX1vpuhqrlKeZYyEzrZq5aXZ75bs3gZNww+rvu828cwfiQZ0ktEo4ZHyIi08CBK X-Received: by 2002:a17:902:a404:b0:1b9:ebf4:5d2 with SMTP id p4-20020a170902a40400b001b9ebf405d2mr1175935plq.33.1694564627215; Tue, 12 Sep 2023 17:23:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694564627; cv=none; d=google.com; s=arc-20160816; b=lnugALmvERY7RJYX2CYEgBH4Mabk2r+z/SWHMpT5//4z86yK8Q9avwef/Mr/jixh2G 9fSFH3kai0rYk2mGPxp59YdJRnFiM0u429IAy+OzhXRFV185KBSbpEcbdsiffLhTGaQm M0GKzJFQnUcttQQ/lKFx/bx9G0Lwr07WBRYWa/Q+48CkweE9/RqSDh/g+ysL9LKpzdA9 NukcGB9ghInxCA3w99Yv9VcQcOcWWR06JPB3EQG8aw/qQoXGD2Psky0pPkIJiTQm4Mux BJ7xsNUxz3+Jk1JlQnZ1XvbMQWEeVcVhFo/G5Y1nGk2tT4GuoJav+v2a9BJWdlIpBefh Xu0Q== 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=+9r0uKNgoHgA9k7pssqWbsfJtymb4YaeLhXN0MxfQSk=; fh=7nGs4MWsAbEsoyPvVRJuIIZZC5QHWSS34F/lW2EvEqc=; b=OvwwmENore+N3hmEDcoVqyqVujoFR2luerCUjGgIkFX+RccrnfTGELhrFsXigKXqw/ UNJuEMkrA9mAWDo6OZCh9YC8Lx0/Lna3VXYg0Ic5PkL7a6hzT1WdAHKMzGwb/Sjq6FaM cMcsWjfgXSbgHjYO5SUnK5LjER8WDJDrjYQicpLG728sncon+hEprIVsnhc1BiGsbfq8 AgA6vO5l8V2S+VAi6IYCtddM4+1kuaOBrRThhqLmLSVMcY4mF8TGvloXO+0u8Oa7kZtG OwYeT0pCcuZyw3OGi1xGwm+nSROLwqRtVbAhFECIYgQH/p0mo/F+B7r3Nhtu5wumOZhv EYxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fromorbit-com.20230601.gappssmtp.com header.s=20230601 header.b=DZE1dGR9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fromorbit.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id lk15-20020a17090308cf00b001c34abf9f2esi8648401plb.110.2023.09.12.17.23.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 17:23:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@fromorbit-com.20230601.gappssmtp.com header.s=20230601 header.b=DZE1dGR9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fromorbit.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id D899F8253511; Tue, 12 Sep 2023 16:16:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230093AbjILXQM (ORCPT + 99 others); Tue, 12 Sep 2023 19:16:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231672AbjILXQL (ORCPT ); Tue, 12 Sep 2023 19:16:11 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62C0F10F9 for ; Tue, 12 Sep 2023 16:16:07 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1c1e128135aso51543415ad.3 for ; Tue, 12 Sep 2023 16:16:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1694560566; x=1695165366; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=+9r0uKNgoHgA9k7pssqWbsfJtymb4YaeLhXN0MxfQSk=; b=DZE1dGR9JbRVOcH6YmJB8Tuadk2ZTUgoeH++sajuReUTsj8Ce2Fm+7eYYTdxkedFcW b1RLcyZtvrORgsD/IdzX86SCqXJfNWMNw6bCBZ0OuQYAs7Tc+lkvE4ymkaz/aIC+P/M9 avKeKcm0l53cMjbwMkkhKjoYvMMdWnPV+LmUvPNmEHPELYT5tE/2KMAHGz9/WLrLgZE2 BrCJk+QTLbSbkCMfgors3eoyM9Qa7rqnzrZ3XZejn7foz7KPWAqpU2L2qiuhOa43TdnD jy6V73ep8iHr0ePLObqnXxz2PqdvcFya+qnRB/oC64nUSnvhNrPTPhf4vJz20bC5lDSJ gkjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694560566; x=1695165366; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+9r0uKNgoHgA9k7pssqWbsfJtymb4YaeLhXN0MxfQSk=; b=PBbw7w9xYte92PhU+97f2kTzrRpgis05P/GherIO/25Q0PxB8cVq1ZK41wUfHq8OCV 7s1+AoWK3Eq8GHittBuE3LMfU72D2QM9HluH6AInM+x6sQCtDEh5ciI3DbhpMc2ta/O5 pW+VLMjocYgOGUVNAIVxqcGf4Qfl9p2FQ5ynss8OqVyFndb3mGExxVy7PhC6yz97FuKX D7mjNL9l36q5P+xdJqHwgXlp4lXiz8D0ZAcIdcnLuf+ZSo3N1oV80B3rZLa1qJhqglOH UheNsB9imtXRrXgCpzjUMX8piShXAr/EyfXFqaLQCvoOJbEM5rDda11+TSIFYT+j0BEX 6bCw== X-Gm-Message-State: AOJu0YyJXTa1CXpM9hYEl3cdRSDCMJvJdYfGY8l+qhI/4DeP6+Enr7qd Yhv9s5p1M56vAVXMq+f6RUof4Q== X-Received: by 2002:a17:903:1107:b0:1b8:b3f9:58e5 with SMTP id n7-20020a170903110700b001b8b3f958e5mr1595195plh.38.1694560566512; Tue, 12 Sep 2023 16:16:06 -0700 (PDT) Received: from dread.disaster.area (pa49-195-66-88.pa.nsw.optusnet.com.au. [49.195.66.88]) by smtp.gmail.com with ESMTPSA id t7-20020a170902bc4700b001b7ffca7dbcsm9008283plz.148.2023.09.12.16.16.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 16:16:05 -0700 (PDT) Received: from dave by dread.disaster.area with local (Exim 4.96) (envelope-from ) id 1qgCbz-00EQ6M-1G; Wed, 13 Sep 2023 09:16:03 +1000 Date: Wed, 13 Sep 2023 09:16:03 +1000 From: Dave Chinner To: Peter Zijlstra Cc: Waiman Long , Matthew Wilcox , 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 (fry.vger.email [0.0.0.0]); Tue, 12 Sep 2023 16:16:18 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, 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 fry.vger.email On Tue, Sep 12, 2023 at 11:03:42AM +0200, Peter Zijlstra wrote: > On Tue, Sep 12, 2023 at 08:29:55AM +1000, Dave Chinner wrote: > > > So, once again, we have mixed messages from the lock maintainers. > > One says "no, it might get abused", another says "I'm fine with > > that", and now we have a maintainer disagreement stalemate. > > I didn't say no, I was trying to see if there's alternatives because the > is_locked pattern has a history of abuse. Yet you haven't suggested or commented on the proposed methods to avoid abuse - you are still arguing that it can be abused. Go back and read what I proposed before continuing to argue about mutex_is_locked().... > 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 :-( .... like this. Seriously: if we put it behind CONFIG_DEBUG_RWSEM, and then turn that on when other subsystem debug code wants the rwsem introspection, why does anyone outside that subsystem even how it gets used? It won't even get used in production kernels, because nobody will turn something on that requires rwsem debug in a production kernel. If you are still concerned that this will happen, then do the same that we've done for trace_printk and other debug only functions: dump a big warning at boot time that rwsem debug is enabled and this is not a supported production kernel configuration. > Also, please just calm down already.. I'm perfectly calm and relaxed. Asking for a definitive decision between co-maintainers who are giving decidedly mixed signals is a very reasonable request to make. Just because you may not like what such a request implies about how the code is being maintained, it doesn't mean I'm the slightest bit upset, hysterical or irrational. -Dave. -- Dave Chinner david@fromorbit.com