Received: by 2002:ac8:734e:0:b0:40f:fb00:664b with SMTP id q14csp1735248qtp; Wed, 9 Aug 2023 10:16:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHFeAYxVG+TtQ1vE/xaRMXJBIxDZMnAnxxkIn+Vr0rpqp8MktolSJq/OLn3znzTmFVd+p8r X-Received: by 2002:a17:906:51ca:b0:99c:b0a4:8de1 with SMTP id v10-20020a17090651ca00b0099cb0a48de1mr2992382ejk.40.1691601403082; Wed, 09 Aug 2023 10:16:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691601403; cv=none; d=google.com; s=arc-20160816; b=FbOQ9ZA4j45yIQ2c8mamVC2J1wx0GaT2h4ve/2sCU1vH9D2i4fB2S2OC/2E17N76vK HbGvn8wqE36mYtGupT+5JKWdAKK83bQxV7BdCfD7n+gQcMGrBWlLgOFxpjVbk0f+inB2 wSMX/n//lCxJoshEX6J0nfu6ALVqEPL2voX+BLTTnAaLJttajczC64FsSLQeW9wk1On+ KiZ0heVFMvv+jqy+GIXmJs6l9fxPSoLfQbXFRWzQSsinWweGHgaSoS61RYeURuOff/1o 7C0O2a1imA6T7F4QLdn9UVpGf3vJip3mLUbAVLn55PkpCyHdZMJ3yFjjcapYCQpgKm4w 7zSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=uRLJpwAQImdZYLqf6+rAi+eBbt4cPSvZ88BbNM5QqeY=; fh=r8G/pg9StgxUsjuVAy/CV+Be/+nHcWbNg7ueY31Z8Iw=; b=qnX16nop/HxknBX4MjU9iIHn2mr3ZvHOFlWuyR00j/wXtwlECS1e4UJI8e7iXu/u8V nPTGNKHJHwz490UsA1ml1JaAYjdW1XYTbFdV+iM2taHiA/WKvO4Yy1671FddDZpPGyz0 tRb4TzXopO5Dq3RUS2gh3xboUwmPtSa7oCv454LvRG7zlXStVDieO/tdtw2W5y6xp6nW 5GtnG6WOFMCecApo6WerRhCgxa0fKzOKCFsWeMFN2xseqYxOOdqzi7FjFOuqIT3QPxps PniGZjdt7Wezy5PYzWDZ1EoKW5bcP4lWCSt9xXqIVFB1UkdBF9zU1MxfeH4Poct2XGBK Vrpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="FPBP/Km4"; 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 l9-20020a17090612c900b0098dfdc3f2d9si9469723ejb.342.2023.08.09.10.16.18; Wed, 09 Aug 2023 10:16:43 -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="FPBP/Km4"; 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 S230241AbjHIPWa (ORCPT + 99 others); Wed, 9 Aug 2023 11:22:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229585AbjHIPW3 (ORCPT ); Wed, 9 Aug 2023 11:22:29 -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 C3D55D1 for ; Wed, 9 Aug 2023 08:21:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691594501; 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: in-reply-to:in-reply-to:references:references; bh=uRLJpwAQImdZYLqf6+rAi+eBbt4cPSvZ88BbNM5QqeY=; b=FPBP/Km483TeYSvVMUXRFVi5n7k3k3Gal6p8IOQqvuAH95sSAgmatC3Pvx47B2wrl0TjR3 S/yhj689Y07HRVSOY1erPLKSEGo50/vhDOnmLqVux5rKBb7Qx8T8JrCmpm4UgLAsRfzcto uZSkHNUmxivUKnuj8Vwk2IN1Vgo9x2c= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-204-3cdCFMemNKiz-_i2dRaBNQ-1; Wed, 09 Aug 2023 11:21:39 -0400 X-MC-Unique: 3cdCFMemNKiz-_i2dRaBNQ-1 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-3178532c6c8so3488122f8f.1 for ; Wed, 09 Aug 2023 08:21:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691594498; x=1692199298; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=uRLJpwAQImdZYLqf6+rAi+eBbt4cPSvZ88BbNM5QqeY=; b=ehiXVjTJ0OZXn6ygAIO6FyT19h2bIBw4+S526IFjLqH2wX87va0DcfQA5oy1+HOLFq +19WhTiS8T69BMfVpHB2TyTg4xrgy0t0ErYSdBCD/7x8v3J8If9lP2hUdRYIgCK6vHr9 joZ6mpjuwSjPDuWMTqcdDvLGpn4HTU4vNVXzi73vvpswLRiqXU+l9g8dgG3Ymw6Dl0dt xaKeafvPywCHQSqy38GrvfG3RQ5YWhiUR9psON8hnLOfrlg8IvPYJ46BNA9fZqQRhbRp xjSNl1qEjayqADA8Lr+kHHtw1bxlOZpl/l60vJlH+ICiQZiS4FO29fxjKsiAivwIN38Z 6qrg== X-Gm-Message-State: AOJu0Yw03ZCRgJbxk9DFK4BB9oia6xCMZysdKe9O3ldj2/NY7X8HgmuW Gt3+ZPgR+vcEglKUw2UG3puKEW7fVrkcDI4HOYfG4fDmlqSr2DfGp86Ey+r+gw3efwWmPYGyGLT +EVV7mbdfrPHQoTNBgesNSChnurlMynHKPcLzRzln08X21u6ajPWScGiyba2diSX4eoMzVCAccp Dv/C1/55DU X-Received: by 2002:a5d:400a:0:b0:317:df3a:d030 with SMTP id n10-20020a5d400a000000b00317df3ad030mr1832528wrp.14.1691594498060; Wed, 09 Aug 2023 08:21:38 -0700 (PDT) X-Received: by 2002:a5d:400a:0:b0:317:df3a:d030 with SMTP id n10-20020a5d400a000000b00317df3ad030mr1832502wrp.14.1691594497683; Wed, 09 Aug 2023 08:21:37 -0700 (PDT) Received: from vschneid.remote.csb ([93.186.150.163]) by smtp.gmail.com with ESMTPSA id 17-20020a05600c021100b003fe1c332810sm2297841wmi.33.2023.08.09.08.21.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Aug 2023 08:21:37 -0700 (PDT) From: Valentin Schneider To: Peter Zijlstra , mingo@redhat.com Cc: peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/9] sched: Simplify ttwu() In-Reply-To: <20230801211812.101069260@infradead.org> References: <20230801204121.929256934@infradead.org> <20230801211812.101069260@infradead.org> Date: Wed, 09 Aug 2023 16:21:36 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 01/08/23 22:41, Peter Zijlstra wrote: > Use guards to reduce gotos and simplify control flow. > > Signed-off-by: Peter Zijlstra (Intel) > --- > kernel/sched/core.c | 221 +++++++++++++++++++++++++--------------------------- > 1 file changed, 109 insertions(+), 112 deletions(-) > > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -3706,14 +3706,14 @@ ttwu_stat(struct task_struct *p, int cpu > struct sched_domain *sd; > > __schedstat_inc(p->stats.nr_wakeups_remote); > - rcu_read_lock(); > + > + guard(rcu)(); This isn't strictly equivalent, right? AFAICT that pushes the rcu_read_unlock() further down than it currently is - not a big deal, but indentation aside scoped_guard() would preserve that.