Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2517825pxb; Tue, 21 Sep 2021 01:23:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzc/KNyBJqtXxzxa7DZvENZH6fL1SdnToXcv96f3WHJmSYIA/Fi+DnJamUOM05WNFvXlPeQ X-Received: by 2002:a02:ac96:: with SMTP id x22mr2896092jan.18.1632212605917; Tue, 21 Sep 2021 01:23:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632212605; cv=none; d=google.com; s=arc-20160816; b=yuLx/1X9xy4vmqUvpUuAF0Wb98WbKxngOTbcpVSX3jRg86CncgG6hLb5UJxQl9q7Ut Y1UUF6rMrZAQUnsfGmyFInhqjahJcpv3nZ7Q6K/a/fEcJbi8V6CtqEidGFGrgHkYpfJp Tr+21QJEm2uPFX0R+TPK+d+7fR/s8ddOjwE/qASu6/t3cZ4p8qF49hnWJnS/EHelhmsB dXyJS46T9eTEYiNZV37ESlrPCKuzN0eEhC7BXX7cJJvaCZyLrxiaBAkZB7+9sedSGbCO yvOo8FyGRZ/FE8s5EHOk935ax9wpfpAGB8SHZo2YAWjh0Qhk1GXC0wez5dzZMU6bLJ1n dHsw== 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=Cn0TlieJ6NqyZSbRzL4EEQ9YqnALBn3d6Hvhye2Y3L8=; b=eMkBTNGe/pAsSLKWsRwULXkuPyaDkjGG1MJHMVVC6xTqlKcApvX2I7qGP4MkTqYIg+ yBaaPLFIASgM1OYJfTx2Mfcgsu3oTxnHlWJwDvGH40ayshqJjYY8jzqsKK3QAV5CraG1 WGKahVCyr+HDos0fCwn4eE8Yz0QZD5gsVc0eFUXSjBbQSKczImASMh8pmwkHpl6uquf3 ypfa8fF+ciKDtZbut/aMlUtkP19+4rz+fmXyUmfaZCwlmasSuqoJiOZt7oCqGMd4hVE1 rQOMZrgZJfEABmQzuC4GehACxdvuYNNsyIt6sezQ1NYnsedgvHuu3/eBny/XRYa0+G/V Q8ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Rx5+Nf7W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n7si17077508ili.27.2021.09.21.01.23.14; Tue, 21 Sep 2021 01:23:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Rx5+Nf7W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230488AbhIUIYD (ORCPT + 99 others); Tue, 21 Sep 2021 04:24:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230415AbhIUIYC (ORCPT ); Tue, 21 Sep 2021 04:24:02 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5124AC061574 for ; Tue, 21 Sep 2021 01:22:33 -0700 (PDT) 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=Cn0TlieJ6NqyZSbRzL4EEQ9YqnALBn3d6Hvhye2Y3L8=; b=Rx5+Nf7Wq2OXvqg+94ZQdQjphK KZY6IPbo3pi+DPIBTjc6ln5fufiSKq9s0RzsPVEtZvgzbAoUJBPIThgpjfiWtC9k/sliZZXVldOQs YUeifDvr043uzyhMcSp1caSjCZSxUOLK4B/H6e+YZWClmmRuEvvFspvfBzHMKLraG524Can8F7/T9 c2p6oKk+tilpSY8MM6ohGNrEEv/Ix1dahO+dVy1I+Mm9BXHMTJwj5gILiuLfRbRZlTITJYARakLxx 9JVWBjLWG4LCF3F+22r8oIPGFbIdTeQRJVjA/koULKBs0fZPxT+BpaUWgE18X/dvi1FTBWJDCJ6UF u9EB661g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSb1l-003dD4-76; Tue, 21 Sep 2021 08:21:29 +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 (2048 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 6DD64300252; Tue, 21 Sep 2021 10:21:19 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 2B805213969B1; Tue, 21 Sep 2021 10:21:19 +0200 (CEST) Date: Tue, 21 Sep 2021 10:21:19 +0200 From: Peter Zijlstra To: Mel Gorman Cc: Vincent Guittot , Ingo Molnar , Valentin Schneider , Aubrey Li , Barry Song , Srikar Dronamraju , LKML Subject: Re: [PATCH 1/2] sched/fair: Remove redundant lookup of rq in check_preempt_wakeup Message-ID: References: <20210920142614.4891-1-mgorman@techsingularity.net> <20210920142614.4891-2-mgorman@techsingularity.net> <20210921075309.GK3959@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210921075309.GK3959@techsingularity.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 21, 2021 at 08:53:09AM +0100, Mel Gorman wrote: > On Tue, Sep 21, 2021 at 09:21:16AM +0200, Vincent Guittot wrote: > > On Mon, 20 Sept 2021 at 16:26, Mel Gorman wrote: > > > > > > The rq for curr is read during the function preamble, remove the > > > redundant lookup. > > > > > > Signed-off-by: Mel Gorman > > > --- > > > kernel/sched/fair.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > > > index ff69f245b939..038edfaaae9e 100644 > > > --- a/kernel/sched/fair.c > > > +++ b/kernel/sched/fair.c > > > @@ -7190,7 +7190,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_ > > > if (cse_is_idle != pse_is_idle) > > > return; > > > > > > - update_curr(cfs_rq_of(se)); > > > + update_curr(cfs_rq); > > > > se can have been modified by find_matching_se(&se, &pse) > > > > I still expected the cfs_rq to be the same, particularly given that the > context is about preempting the current task on a runqueue. Is that > wrong? Yes. There's a cfs_rq for every se. What we do in find_matching_se() is walk up the hiarachy until both are in the same cfs_rq, otherwse we cannot compare them. Fundamentally this means the effective cfs_rq also changes.