From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 860DAEE3F39 for ; Tue, 12 Sep 2023 23:16:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 176966B013C; Tue, 12 Sep 2023 19:16:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 127BA6B0151; Tue, 12 Sep 2023 19:16:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F30166B0153; Tue, 12 Sep 2023 19:16:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id E368F6B013C for ; Tue, 12 Sep 2023 19:16:09 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id B3ADB12021B for ; Tue, 12 Sep 2023 23:16:09 +0000 (UTC) X-FDA: 81229505658.10.2F3F0B3 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by imf19.hostedemail.com (Postfix) with ESMTP id D72ED1A0003 for ; Tue, 12 Sep 2023 23:16:07 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=fromorbit-com.20230601.gappssmtp.com header.s=20230601 header.b=f7MqyM2K; spf=pass (imf19.hostedemail.com: domain of david@fromorbit.com designates 209.85.214.179 as permitted sender) smtp.mailfrom=david@fromorbit.com; dmarc=pass (policy=quarantine) header.from=fromorbit.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1694560567; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=+9r0uKNgoHgA9k7pssqWbsfJtymb4YaeLhXN0MxfQSk=; b=1shdq91GYArKhezcba3TDg95V5esnVkfF8wdyvjCyG6+oM6BUb0YPWdc8eGjj0duujtcZj fwOIadQEO4JhZBZoLILsCcTGTLDT6oJ8dl/fED7Qs2fXurMMcnbz6TyAs/+8pwhtFisZSt fZOJDHFE4dYxplcPZRqjjBz9naufLxE= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=fromorbit-com.20230601.gappssmtp.com header.s=20230601 header.b=f7MqyM2K; spf=pass (imf19.hostedemail.com: domain of david@fromorbit.com designates 209.85.214.179 as permitted sender) smtp.mailfrom=david@fromorbit.com; dmarc=pass (policy=quarantine) header.from=fromorbit.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694560567; a=rsa-sha256; cv=none; b=Klg/r+bXOQlqUn7Sd5Ak+J4/IZzjoqeqsAEp8sDSge3Wi4/zwKQo0UKu4vVfWcHm50bXtr K1CYU2sYh/IjNFQ61tpHU+8pF/b8dUq0nSkHbaOpDwZJQmu1J/VzSs5pkCQxLA4EvgxbOy v3ZtAesP+YMDyTOXD90OValStq9gMNQ= Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1c3d6d88231so10304235ad.0 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=kvack.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=f7MqyM2KN7IIgH3TyZ6siu24Sse2uy6mxr3GT4z63Yt8f+MNz/VKXaRFNoMKwCgG3F kB6C9K+Vq09YggwjGAQ0BTu2KidNp2khcNggCCOuRt35XKSZrG6/BlqQTI6iDKah7B44 euH3EoDdbNfyMuAxIRD6txstjb39hb1GkwMv/4YGtaRnDtXtexozwMOaPIfBTe9gbue+ AONMLyuSZEiQb/VyMZ/JFIvITWGweDUrLG8MDyp1BhWk9IU55dQXFdy6CHHWPhkV4mKa rDP1Do7aI1GJx91rZ5lgtdspvMVe5ecZKvbtZutAbwahgFrPIKa1gqXobhCKos4M8By0 MhyA== 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=YsTGCShgrbcVhtLu3pwRVhCeXNj0yKc8XMLn3xu84NsuW7n3KKYzUtkjbNdkOieUmt YTxQX0zSUZC/oTeVp6hzxEWToU1qDv6exrxNe+cEkeKSKuk2GN85AJUuC/MbHQAB1OrE IhkLyFdAHgjye4bfu7lZeaVkptljknpsw0zqqa0APU95ci8GHBbRVLugBHvG4Y8sCynJ NK6ZopdEXOJfeXfcsQ18NLKDGjFgycvulwLvUN65NYdVNLOpsPsu1Sas0tO583CIAlCO 6fXe5ym/ESky2Z6b2U6kWrOh2SaQeBWP7OcNJzTUdHYh2cDMLLg5H6CbN+1wJL/HmdWW eiGA== X-Gm-Message-State: AOJu0YwFAs6eKaGoWfuGHTKgicE1qt0JDO2A8mrWR9Y6FsmlUYPYYSM+ phx2iSXtS7FMIZKIBtFqYQf75Q== X-Google-Smtp-Source: AGHT+IGKZdARZRmeluVcjP5PsUUVen4C9AzPnIa1JthH4Um4QkyYnNWIlrZ4Qvh0GCAr0FcFyH3tDg== 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> X-Rspamd-Queue-Id: D72ED1A0003 X-Rspam-User: X-Stat-Signature: m1a87kybyw9t94zbgxnx9qtaoohd3bbu X-Rspamd-Server: rspam01 X-HE-Tag: 1694560567-679747 X-HE-Meta: U2FsdGVkX19t3p3wIScXLTDFFQ5zx+V50c/Snq7yR01qTFJzMox2P6LaBzkn4pbRaLzBInhCRam4HDDPCcYYKkMQ/IV531Dbf8EkHMjPn0e4FIjs+3M30+EQH6zy9J5tz4OfN62lL3Akcwud6GRXG3XtRq59JhdECa8YV1BMzPb4lC7dml1T+eqNLSeKwyQ5OuWDsy86MPyfi1Lq5wvjTFgfp9HGW4eYDD3OEgF1LfT2W0BzOxanwH7P7mXUb1KEEeh6bCtPBxy8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ev9EeIRPEn43P47+UfJGtT5mTkSOpn1tPZ3vS3kqeD4KMkrHvnsIrP1yYmlvSVZmDJkq6GhWxJhtojY3Sr6O0Lz2IEdTEuvIxMcRUAfbFiJ0LXmuwjI7PM8D5mDsr0QGm83O6KLdvB2ovH9hXELkQJDZcQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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