Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2861878rwd; Fri, 26 May 2023 12:23:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Gj6EtdaXg19tU4kBIAtJvlef/wGPAp2FFwL5jlVO4xEqTnXv7MO0tKXL0tnJLRGdrXN5u X-Received: by 2002:a17:90a:138a:b0:253:572f:79ae with SMTP id i10-20020a17090a138a00b00253572f79aemr3955374pja.46.1685129029052; Fri, 26 May 2023 12:23:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685129029; cv=none; d=google.com; s=arc-20160816; b=kfDBGC+3Iw+JEwqHE7zxbQkdYDAc+gOUXdw1P2ZDfu4supx2fJWMJ5NqjfLH2ppTby XGp+QwoHrK+5fleSgIyL/JMqTtF/AjSdw1S7TNHqxO9DJVQ/gX7d+DFOAgIRvDyo5r55 WFsFK3ZGNbOGE+Mr1Xn+aocIwJS+8seExxR3mnidA0PqhrYUPs1i5sxNE/HtoQz2jjgF /54zSLqve+gWvwkvpMBKIpcvBDoGDcKf7uDauDIhpDZk11KXb5lSQ4hl+VJdMJiNzjzc wFQjMbOcOrH9dm0PF1zltyGVthsvQK9ksRKn9cjS4Evx/+ZqW8BxRtz8AFQFLe+F63ip zVAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ZcqTYXcUolEunoNWL9EA3yopTT2Kkm4JqklxglEZ7d4=; b=aqrF88zH/zdO2hQLIisMbjfitKDX0C/zuBKTC4biLPoL7y1QUIaKcL2v8bOpWyN/Of jPz/KfVOUtNESvvZqwpTfFOk6n2m4vc5RLCwtBte212v1px2xVr6ub1Xt736Nc4sA0CK VGzXRPceTMOPcp0R4yUPGQ6t+NaXmYTknRxYN5i0K7L9UWTaz6GdGG7ManzVSeurtXrU 9w71H1T+8V0QTdLSw4DSuJlO03AoEjTfK6eNvyoQwq9dwjhr4SaYPMJiWtk4BwKSQ4QJ 9jY5XYmWAn52iRozzpZ4u6yaUXIacFMJNmlAB5qn1M4BUEieHrNQnuo4h44Jeznl5M02 +rgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=EXAclzRS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l191-20020a6388c8000000b0051b59786e6csi4530083pgd.300.2023.05.26.12.23.34; Fri, 26 May 2023 12:23:49 -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=@efficios.com header.s=smtpout1 header.b=EXAclzRS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243671AbjEZS7B (ORCPT + 99 others); Fri, 26 May 2023 14:59:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243630AbjEZS67 (ORCPT ); Fri, 26 May 2023 14:58:59 -0400 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 376BB13A; Fri, 26 May 2023 11:58:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1685127536; bh=n8UtLLL7MeH+WxjGi6mdHGUgV4zOAdY84/FWBVF10eQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=EXAclzRSVyyGe4sxzeUw0gc1ic+L1C5A4r32bT+JVI5YkECYJPLa4XZQLvbgu08aU 2QMp7vFHEtW7KDcMynH/YPycEalNlBxrUt3FKyV9Rlp49M8UIgAMJ8J2jtTHqT4QDY u2RogTX9vIX7qCF6taEdkcgh6hvt++Oa5V86UdXIajCV+IwBGsSMN1lwi2OAT0IJGl +cQS15x6sVeuG4oTD7T2fXlRX0oXBagHm1WzxgcntvfArglXd/wxLboFubhEKJ0Ak/ gmYQAttcKBxYo1rqSxH7M+LOSwuI15zs/JIi3ULoDWCI7DMK+LF5zup6igmRPdL9V8 T3uWAGYHakHeg== Received: from [IPV6:2605:8d80:581:38b8:cb6e:1465:9ef2:4900] (unknown [IPv6:2605:8d80:581:38b8:cb6e:1465:9ef2:4900]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4QSZ2k1x5kz1604; Fri, 26 May 2023 14:58:54 -0400 (EDT) Message-ID: Date: Fri, 26 May 2023 14:58:53 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [RFC][PATCH 1/2] locking: Introduce __cleanup__ based guards Content-Language: en-US To: Waiman Long , Peter Zijlstra , 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, mingo@redhat.com, will@kernel.org, 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, jiangshanlai@gmail.com, qiang1.zhang@intel.com, rcu@vger.kernel.org, tj@kernel.org, tglx@linutronix.de References: <20230526150549.250372621@infradead.org> <20230526151946.960406324@infradead.org> From: Mathieu Desnoyers In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,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 On 5/26/23 14:49, Waiman Long wrote: [...] > > BTW, do we have a use case for double_lock_guard/double_lock_scope? I > can envision a nested lock_scope inside a lock_scope, but taking 2 auto > locks of the same type at init time and then unlock them at exit just > doesn't make sense to me. AFAIU taking both runqueue locks for source and destination runqueues on migration is one use-case for double_lock_guard/scope. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com