Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3081121pxu; Tue, 8 Dec 2020 03:06:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJxbr1jW3ny6hmgBJV02SS+rPfO37g2WxhusDbwZ/qo8vRFLom5qlrARbYNnQufr4PyWk7v+ X-Received: by 2002:a17:906:6b88:: with SMTP id l8mr22875479ejr.482.1607425582181; Tue, 08 Dec 2020 03:06:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607425582; cv=none; d=google.com; s=arc-20160816; b=uiKtAvrI/5xJe051kO8Te7CZQMp9X7W6+xvP6RVevBHxvzT0VxizXS3b6kIgtRMsvr jzoWsmJTMsvlo0EJ//RRRGqo0s2/4LRT6wpdzlh6Y5QJtW1lIcVdYewVDu/Rhu+fYD/v IxC8Dfgv/FzTDYy2Ttyl/seXbuCxUUfqEwhd0pMRgKFuuzVIoc5pFcxY5j7VSvNpC130 2HbFH0o3tERIxYkXX8fUIctibDK9T7j5VoRHqIsg0IguT3NisxB02u29b2F361emBaFG W9g3vyHl89HzYKYFNmRQ9ysP2iBWxYUzLsXycEbxxb+VgwmuEsajkQa/NsDT95/oSwnQ Ypdw== 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=keOv6NZ1gGKDO3UdanWCKbfMGYMC4FO1FQFy7CDCLy4=; b=HbGgWGDuejxZ1pHEsd+oajA3AiizviFzxEa+EhpkSIs4TUuk65N6VC44a21ityZbzJ IqZWMQO+CljiLEPFeGaMgF8T3p04GpoROp15A8ej0T4BSyQSIohG5Pr5Z8eDiKXlt1S7 25isslI6rDledpwxYq8hYqiegWNbtMjmWSjvFYMWetPyoyhBEpPum3R+vcPoQruN1wi+ Qnvfn0Qujs31g6v489LCLOiUYHzYlhJisKu7hv6xL7xaqESgl2/mOSqTysNgiMN90OR/ yKQfX4ZorGBvcXTwU2a5Ou0zVeTxJAUYd+dy/b7NFTgE+Fnt5BDo91VN6LGhUbkiPn13 k1tg== 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 a89si10505842ede.326.2020.12.08.03.05.57; Tue, 08 Dec 2020 03:06:22 -0800 (PST) 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 S1729125AbgLHLDi (ORCPT + 99 others); Tue, 8 Dec 2020 06:03:38 -0500 Received: from outbound-smtp34.blacknight.com ([46.22.139.253]:40695 "EHLO outbound-smtp34.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728764AbgLHLDi (ORCPT ); Tue, 8 Dec 2020 06:03:38 -0500 Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp34.blacknight.com (Postfix) with ESMTPS id 9DD8D1942 for ; Tue, 8 Dec 2020 11:02:46 +0000 (GMT) Received: (qmail 24492 invoked from network); 8 Dec 2020 11:02:46 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.22.4]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 8 Dec 2020 11:02:46 -0000 Date: Tue, 8 Dec 2020 11:02:44 +0000 From: Mel Gorman To: Dietmar Eggemann Cc: LKML , Aubrey Li , Barry Song , Ingo Molnar , Peter Ziljstra , Juri Lelli , Vincent Guittot , Valentin Schneider , Linux-ARM Subject: Re: [PATCH 2/4] sched/fair: Do not replace recent_used_cpu with the new target Message-ID: <20201208110244.GH3371@techsingularity.net> References: <20201207091516.24683-1-mgorman@techsingularity.net> <20201207091516.24683-3-mgorman@techsingularity.net> <842ef1db-49d1-7d05-997b-1562383cdd28@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <842ef1db-49d1-7d05-997b-1562383cdd28@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 08, 2020 at 10:57:29AM +0100, Dietmar Eggemann wrote: > On 07/12/2020 10:15, Mel Gorman wrote: > > After select_idle_sibling, p->recent_used_cpu is set to the > > new target. However on the next wakeup, prev will be the same as > > I'm confused here. Isn't current->recent_used_cpu set to 'cpu = > smp_processor_id()' after sis()? Looking at v5.10-rc6. If you are referring to this; if (want_affine) current->recent_used_cpu = cpu; then it gets removed by the path. That replaces recent_used_cpu with the wakers CPU which still works but the hit rate is lower. > > [...] > > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > > index 23934dbac635..01b38fc17bca 100644 > > --- a/kernel/sched/fair.c > > +++ b/kernel/sched/fair.c > > @@ -6274,6 +6274,7 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target) > > > > /* Check a recently used CPU as a potential idle candidate: */ > > recent_used_cpu = p->recent_used_cpu; > > + p->recent_used_cpu = prev; > > if (recent_used_cpu != prev && > > recent_used_cpu != target && > > cpus_share_cache(recent_used_cpu, target) && > > p->recent_used_cpu is already set to prev in this if condition. > That can be removed as redundant, I'll fix it. -- Mel Gorman SUSE Labs