From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94B2BC4361B for ; Tue, 8 Dec 2020 11:03:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E23C23AA7 for ; Tue, 8 Dec 2020 11:03:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729136AbgLHLDi (ORCPT ); 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