Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3997764rdh; Tue, 28 Nov 2023 09:05:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IEoQzMMBiozFm5neLLa3jiXvd/E0YKcjujfY1QbLg98WNo/ELmcv9pAOc/fPfy18LwexcDG X-Received: by 2002:a05:6a00:4091:b0:6be:319:446b with SMTP id bw17-20020a056a00409100b006be0319446bmr22576495pfb.21.1701191112589; Tue, 28 Nov 2023 09:05:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701191112; cv=none; d=google.com; s=arc-20160816; b=dIe9fgdqHoVdro0WmkV2iH0D8oz+LcNLYZ6PTrkkDlIh617JZC/4jsa8zXhsaIFB8o AeSVPBzu/yRQxvkLa/VYeP+X6eeXm8JQLUle8o8MKIRm7XCu2NxyYzM/RcEtgC0XceBN ysXqqSM4E3SyYqK5f1D2N2JnX2Jou4ItJ9Mo9WrfWYEg4VBVTF7lG0F4vmpDyaVfxMZE W+tBimvhBweWgzdCkzig95u2NNcyG+X5XQ8QUc6XVSUXsZVCfbU/6pL5IA4lKQvLyEff IDGQ3rFIEPxd2BvJYyagaJXJhBqcBIBEWOzUWJdETOsjejeG4XF21lbRU/CL0FojBu3i 0pXw== 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=HZdUDbEkCdxX7hgdMslzFvwF0wocTCuceHQlXsXEJWs=; fh=OV9CR7BcBsF1I9U21udMFkm4AgxXJoMeTo9Mzsqk1Ts=; b=ypn9weVD71wUwvi8szNnWY+hPfDA95O0Vt2lpMBAGVAihq8W/LEBtAft9E/mbhUqAb hoCwjfxinZlFargCmTF+j9upx2a0rylgP9FPWCLpb5TBmZujrrRKT4Kt1zcRxS2g1FDw wCZdA0jztTZaAIGR3kAkRumEGmERpTGZkS6BT73eCUB8onEQDzfRE1+pDMkaUGdN6JVg DTz6950QlSd62iLq3a7I5OVQE37uQnomlzPLXIgJir6Omc8HHY3bABUcsn9TVnO3rqu0 LMzCS5RvkBQxnhAGnIbbEQJpRUBVBRO8MJAOozJVN3RiXGiB5WRGmtyb1bIqsxcmuAwa YbIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ZSQ4hDkT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id bn22-20020a056a02031600b005bd27295abcsi13894568pgb.682.2023.11.28.09.05.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 09:05:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ZSQ4hDkT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 1A97C80A4174; Tue, 28 Nov 2023 09:05:10 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229852AbjK1REv (ORCPT + 99 others); Tue, 28 Nov 2023 12:04:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230056AbjK1REu (ORCPT ); Tue, 28 Nov 2023 12:04:50 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62C9510DF for ; Tue, 28 Nov 2023 09:04:56 -0800 (PST) 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=HZdUDbEkCdxX7hgdMslzFvwF0wocTCuceHQlXsXEJWs=; b=ZSQ4hDkTuuQZQqPApK6FimXsMm lkaWn+EcACkIjtUQ1qFXrT7EILxGBVm+a/QGY32qxgQXMAbNZptJVMEh0hUuqLkuMB2dF/0zEgYVE zmfu2ue9oMRDeS0woOvCdp57PMdcBcq9J5XZSgYJzUGECRIpijmCQPbnepdXNumGBJkEtzhAZ+IzE ojbFyDGhNy42dWa4eYdWx0/3CLbKN0Y9dHQyAyIXRV6vrs5ajb9cTBawCtXjjH/iWM6rcZV8O/HUi VEWvlcRT+Z2iIm4KXd8v55nMGZMtm3V3rfnwc4oh8ANvYWUU151wxEh/cNrrvcm342lm6lHEu1h1+ 8nGVaSBw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1r81DM-00CXQf-D9; Tue, 28 Nov 2023 16:45:36 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 3C78E3003F0; Tue, 28 Nov 2023 17:45:35 +0100 (CET) Date: Tue, 28 Nov 2023 17:45:35 +0100 From: Peter Zijlstra To: George Stark Cc: mingo@redhat.com, will@kernel.org, longman@redhat.com, boqun.feng@gmail.com, andriy.shevchenko@linux.intel.com, jic23@kernel.org, linux-kernel@vger.kernel.org, kernel@salutedevices.com Subject: Re: [RFC PATCH 1/1] locking: introduce devm_mutex_init and devm_mutex_destroy Message-ID: <20231128164535.GT8262@noisy.programming.kicks-ass.net> References: <20231128000910.73784-1-gnstark@salutedevices.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231128000910.73784-1-gnstark@salutedevices.com> 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email 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 (groat.vger.email [0.0.0.0]); Tue, 28 Nov 2023 09:05:10 -0800 (PST) On Tue, Nov 28, 2023 at 03:09:10AM +0300, George Stark wrote: > Using of devm API leads to certain order of releasing resources. > So all dependent resources which are not devm-wrapped should be deleted > with respect to devm-release order. Mutex is one of such objects that > often is bound to other resources and has no own devm wrapping. > Since mutex_destroy() actually does nothing in non-debug builds > frequently calling mutex_destroy() is just ignored which is safe for now > but wrong formally and can lead to a problem if mutex_destroy() will be > extended so introduce devm_mutex_init() and devm_mutex_destroy(). > Aside of the issue raised by Waiman, it is also very undesirable to introduce EXPORT'ed symbols without a user. Please group this with a patch that actually makes use of it. No in-tree users, no export.