Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2862669rwd; Fri, 26 May 2023 12:24:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5pi/xhZOowVmH0A3evibf1KUayUJqkTicZ/q3jNGiobo/ind3W23K62MjIJMUA5o3Zjv7r X-Received: by 2002:a17:902:f391:b0:1ae:626b:4771 with SMTP id f17-20020a170902f39100b001ae626b4771mr3232621ple.36.1685129078142; Fri, 26 May 2023 12:24:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685129078; cv=none; d=google.com; s=arc-20160816; b=E2ou7wZwMU4oS36XzS/7NbX71wmMd3W59M2Q29mVno1ZrpPEy9Nftl1sC8h5JROUFR gJ1arplVr/9TpO6YqBhWNp4kMpPrrrLvyoJrlIDi5wIu+uxa9Yopuv7rP6XKcMxAhdug vxTtMPtSm1T//VrVLd2j9iBcBIA0JGI5ImTi/PARPKT1ha0E+tectIEDmiItmo48mbax rdNB4WZut2fWFIeoxhvVS5p7ks8ejp+RZ7mXGgNdq70RT4xhWAzxgHpykGbWqsYHvZz8 8KMiuNWNZSzIwv2T67r0x6lYKchOqn4y0G90bcpFLWuRlr+jT0+d+3G4aQ2SHVxXdMZm y1Yg== 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=JhVelvQV+hPiU9wttpuIOnyHREBDtGBxkmx6tjkjhTE=; b=TjV7I7ITALJM9F5WAy6PRw1lf4Xs28+7AD/Bxe5eGcVWeY4DRcs7bo0wU9n8djt0Fy qvL+bBpAxsSyoxkrdIGwrdE4XB7Rq1QXQn6RJ+lrW7TTlUp6FceOqmXD1f96YmqyOdJ3 GpHWI+MfgnHdb99TUvC501dN9WWKqCcv+agFr0eGnIEHcarlAijIhwzZPcJYG8Er7ynE FzH65GrB5GlKQyYQF5VyOhNRV4C+nx8mku1Zbmc2Rif1UnNGjuj10kpRZjVI+qimq+Zh jOwYykLI7r4IQFT8Hlytzwuy3TlYy1KgkIMt8/80IqswKdIC4dHI3xvvjSH/0tinykjh RIRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NdKwmXzi; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k12-20020a170902694c00b001ac6d52d936si2103575plt.87.2023.05.26.12.24.24; Fri, 26 May 2023 12:24:38 -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=@redhat.com header.s=mimecast20190719 header.b=NdKwmXzi; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243795AbjEZTFj (ORCPT + 99 others); Fri, 26 May 2023 15:05:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229732AbjEZTFh (ORCPT ); Fri, 26 May 2023 15:05:37 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1C1F135 for ; Fri, 26 May 2023 12:04:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685127895; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JhVelvQV+hPiU9wttpuIOnyHREBDtGBxkmx6tjkjhTE=; b=NdKwmXziBvb7XDQo3nXw2pqixluhKK6Ml3CWg1NTqcUSos30MBV/O3s3QNloADiNycT9Y1 ieG+rstQNiFx9xKTGOBlSLW9VVG49AIfY/DpSoCe4+6JzAxmmjy6Q6MVwZz6SvjeFxUroO FK6BeMgAZkn8SQRNyTNvorcVK/ArE58= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-290-Hg5fBAoaPk-Bnyz3addx4A-1; Fri, 26 May 2023 15:04:53 -0400 X-MC-Unique: Hg5fBAoaPk-Bnyz3addx4A-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6A3198032E4; Fri, 26 May 2023 19:04:51 +0000 (UTC) Received: from [10.22.32.123] (unknown [10.22.32.123]) by smtp.corp.redhat.com (Postfix) with ESMTP id AE4B41121314; Fri, 26 May 2023 19:04:49 +0000 (UTC) Message-ID: <2e44db55-61f1-ad3d-e9e1-a9409ffad31b@redhat.com> Date: Fri, 26 May 2023 15:04:49 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [RFC][PATCH 1/2] locking: Introduce __cleanup__ based guards Content-Language: en-US To: Mathieu Desnoyers , 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: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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:58, Mathieu Desnoyers wrote: > 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. > I see. Thanks for the clarification. I forgot about that special case. Cheers, Longman