From patchwork Fri May 26 20:52:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Zijlstra X-Patchwork-Id: 9922 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp756258vqr; Fri, 26 May 2023 14:17:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4nBoeRrOlG38lb5l1tiVl7WZWXd31OfX2xZ6CH+rHoxR/1lf6JkmRYQqln3Sj2JBm8iMWP X-Received: by 2002:a17:90a:9bcc:b0:250:132a:5d93 with SMTP id b12-20020a17090a9bcc00b00250132a5d93mr3029944pjw.49.1685135847979; Fri, 26 May 2023 14:17:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685135847; cv=none; d=google.com; s=arc-20160816; b=zUoplSGx93rTFdNjVbI0a/38rC46qIlsVvZcra9vN0s5EHvj21skbqrroEbOSuIyvr 5g+skeU6DiW0EcN3puAosrikLHUaKyW7r7UaiNmco8cmwsLokVolD8iynaweLq1em5zF +BsyN2BQUT5XwVzFQxDuc/LR4U+2lNobLD82ErFudjmJd61hQlBYhOr50To9RD5QNVZV E1JFBL4uyznsDVMYIbo8wjgcXlTEbeYfag6P2KMNbk/3jDA9rL3yjco50GmnAaPslYCi 52eZioqdC4i5QdSAKyhTlfihAckSSFD2qurWGmzXq0C/GJxSv5bVMkGT8NG3w7Ofe9iN w2cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:user-agent:message-id :dkim-signature; bh=urvfHsJBOS8zyeLyl+UdJT8Nl0X+FyS97M0e5Nc2t34=; b=MewV4PRmmv7AH7hG1G9+1gZgOLSTgXc9Mg8g4rB8EzFgaxG7LcHm9w/5T/lJMVx8td PMdk5Sovo9ogFFREb7ii0uWN0yHDdWzel1Ma4gHs/00DEOaH2rFpSCk89ufC2YTl1xcy vQ/8FwcFrtAxWWEipJTLGdQImuhvA4EBJpQpnfemyL7FQspxLKE4AvmZZXAMaRGoNvyI SvT382E4ATsN2ml1MFNWQC/7vfffRx0oRRJ2M86boRAGhsFsrXZ/hbnjfFeSdREnHQBk B9YQcpu3PUom+oQSo7Ow/PJioDTckiktgHaipxS8BGWo6BUHOGEpOgnZgxueEvP7hMJi qG8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=nMUfxulQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h187-20020a636cc4000000b0051aeaf666dfsi4428060pgc.668.2023.05.26.14.17.13; Fri, 26 May 2023 14:17:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=nMUfxulQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243376AbjEZVBP (ORCPT + 99 others); Fri, 26 May 2023 17:01:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230467AbjEZVBM (ORCPT ); Fri, 26 May 2023 17:01:12 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5907719C; Fri, 26 May 2023 14:01:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Subject:Cc:To:From:Date:Message-ID: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To:References; bh=urvfHsJBOS8zyeLyl+UdJT8Nl0X+FyS97M0e5Nc2t34=; b=nMUfxulQfyDRFhMgPquBzy1JMU 7OITUm6XBSHDal5ty4OzC+zkpOof2p0Exb/t6YKVC/OylO9uWEcykEdgS5R4KjvddxsOLJSSk3/sI 20YmYkOhdP3+uKSAjKK509Nxl+SAUjL8AB/HtnWV6yD4o4/9dXoINaa15zo9O4IQZHdKXdX/s8hga kTH/FrvlpQrK1ePCQNDgRykI/bsR+q0NLWc/PYlUtf1TG97P4phZb0r6O8trCLHehDEr5KTgvd2kO y7q5ldrzn68zsAGwag8ee8jftSV19rdL5hj596WQuecBK6ZJoMojx0WM3fDtWz5YmYr3I6Kmbk08A L495JIMw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1q2eYG-007hpR-2z; Fri, 26 May 2023 21:00:45 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 06CB23002F0; Fri, 26 May 2023 23:00:41 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 0) id AF53F205BBDB2; Fri, 26 May 2023 23:00:41 +0200 (CEST) Message-ID: <20230526205204.861311518@infradead.org> User-Agent: quilt/0.66 Date: Fri, 26 May 2023 22:52:04 +0200 From: Peter Zijlstra To: torvalds@linux-foundation.org, keescook@chromium.org, gregkh@linuxfoundation.org, pbonzini@redhat.com Cc: linux-kernel@vger.kernel.org, ojeda@kernel.org, ndesaulniers@google.com, peterz@infradead.org, mingo@redhat.com, will@kernel.org, longman@redhat.com, boqun.feng@gmail.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, paulmck@kernel.org, frederic@kernel.org, quic_neeraju@quicinc.com, joel@joelfernandes.org, josh@joshtriplett.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, rcu@vger.kernel.org, tj@kernel.org, tglx@linutronix.de Subject: [PATCH v2 0/2] Lock and Pointer guards X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766970991644610276?= X-GMAIL-MSGID: =?utf-8?q?1766993007400704771?= By popular demand, a new and improved version :-) New since -v1 ( https://lkml.kernel.org/r/20230526150549.250372621@infradead.org ) - much improved interface for lock guards: guard() and scoped () { } as suggested by Linus. - moved the ';' for the 'last' additional guard members into the definition as suggested by Kees. - put __cleanup in the right place with the suggested comment as suggested by Kees and Miguel - renamed the definition macros DEFINE_LOCK_GUARD_[012] to indicate the number of arguments the lock function takes - added comments to guards.h - renamed pretty much all guard types Again compile and boot tested x86_64-defconfig