Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2579792pxb; Tue, 21 Sep 2021 03:06:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQmzA947ypiKtRPIJ/FrDaFWsFGObBZgwY3phjU/Bn3egU9m2+x0gYMS5q3wtUJgi1VC8n X-Received: by 2002:a17:906:6b93:: with SMTP id l19mr34442278ejr.26.1632218792242; Tue, 21 Sep 2021 03:06:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632218792; cv=none; d=google.com; s=arc-20160816; b=ejhE+6VZEicHADHi87+w7i4GGu9ufKGGFBRQ4Bh7/UKjHQkDvycel1kXkhy42R7N5/ xWhG88r2Ip+whMQWjBlr5Cub/VcJ3qYoz3D1nD133BpaJbiq3jjEyns5ABzCL2opHWfJ v3Jhp/ooRjZg/epvpoY3tWKxWzpfalzOdQdsMdFv0T9X10oZ+StFLG4LleFBseaoCNMZ di0/CfylG5dSciuK7tiF4zbFOdgTH1BrWcn9p1RSLl0JC1plRcUNpfnWKKRy2ZBXdRjj iLFMCvkrfWW3YyoLlvnG7IcUXlRrP0m4wBCcRdC/vgHNi3Zzpy8LWd0k5DJSPGPQRlws ft+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=VIXL2vAY7BRD7XHZjTphNVZeFclZ3GexcG97PDKXCzg=; b=yI4z6XsHJwRriO3cYDZlXUKB6UeLGd1BXEiKS25i99p0Z8JH2GZZvlIJFbeGeAS7zi ZvOWlIUbZj0UQvZQSMEg7NfGXte/HwYXbyW+vILDzpeyzKPNydAQGO5t+MvhQJFPKMM2 DKPberR0HN847OlbLu758ujh5DLY1WjGLYHkwyybm6d4Q1kjZ+kF05cTzrH9mJcpuW2k fMPiP5P0Z1Z8dTgz5plDzJmxlMMzFNxpxGSINw6k5vDiW666syTAnZKNnAJO3xvJCnrT YrsHsel0/2SSO50B/CoxsAk/jMIlTjJcuzZrC6uYaQ3T9OtxzMp2QK3vGpVpKCvTqcaO cqOg== ARC-Authentication-Results: i=1; mx.google.com; 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 o6si4783981edi.516.2021.09.21.03.06.07; Tue, 21 Sep 2021 03:06:32 -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; 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 S231491AbhIUKE4 (ORCPT + 99 others); Tue, 21 Sep 2021 06:04:56 -0400 Received: from outbound-smtp19.blacknight.com ([46.22.139.246]:38825 "EHLO outbound-smtp19.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230160AbhIUKEy (ORCPT ); Tue, 21 Sep 2021 06:04:54 -0400 Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp19.blacknight.com (Postfix) with ESMTPS id A21F21C59C9 for ; Tue, 21 Sep 2021 11:03:25 +0100 (IST) Received: (qmail 18526 invoked from network); 21 Sep 2021 10:03:25 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.17.29]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 21 Sep 2021 10:03:25 -0000 Date: Tue, 21 Sep 2021 11:03:23 +0100 From: Mel Gorman To: Peter Zijlstra 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: <20210921100323.GL3959@techsingularity.net> 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=iso-8859-15 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 21, 2021 at 10:21:19AM +0200, Peter Zijlstra wrote: > 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. Ok, thanks. I'll read into this more but the patch is dead. -- Mel Gorman SUSE Labs