Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3127262pxu; Tue, 8 Dec 2020 04:25:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJwU9ml8gLTR125H8z6S5Qm23jWKGNQA6CBH0g/XEJFSbw1BWta9RNIriPuyWn5ZSVSF35n2 X-Received: by 2002:a17:907:971c:: with SMTP id jg28mr16663824ejc.85.1607430334525; Tue, 08 Dec 2020 04:25:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607430334; cv=none; d=google.com; s=arc-20160816; b=FZEXx+YVA2tJOzlhR0FTkpgAEDNP30PJU7L7VNT0wgJ7SphayLUXMoWVo4LUsCX2zk QncVcdCma738mybxKWCZQD1IxkPMYgunHeL7o8UQuo/wCbpy5krMHjYPIhy4pwVCylNb mpfiBOSPeTIrMfoh2W+49APiG3VDvCHRaGrxBATP0KhqqlloCDk/QQI1rtLNkmVnFar6 rDO5rGnmUH8lya6bwLEYM5FQvpODkz8W/wSCD3h5RP6m32yaU6WIrSIaQyLoO3zy6LP0 hacnnaRtrGVp9x04IG+6tEwqgd2DQpMiezkXB7NxTWOsMD9/s9K/n7zvDNQLnPExtQ6X pBWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=o+/9ZMvRIpWaIWEkMy5WiPnPjk0fleAeC9nsq2nZyOo=; b=PAfjs9d01JqI8lVFrBCW0S7vE+KVIP6jonVYZ8WUupRUrHDekPxXml42tuOujcNArf ehWUqUsRPb7qwqLJWecttBwXx+I4YfOVpSzytMDOyZGvQRVhGy9jZmtnxL97sCpPGYKz pXiRcTosqFm8UHwkGkL8v2B45JFxYZM3g+PO40zDQjP6t2x2VSHwEwK3WbSLE7E+b5dY mQhUZbcq20pC0RixGhjbdMTH1rGTlDV4YRGXmxYgbW/cTwgFTXGglfBmh0HnjRNM1QoH yOawgX8JbxmKtTPf3hGq8MsxLTnlSE6FlYIBP7bneydFZe83sDOH41vgAtzzYH5MuOSZ v89A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k6si5037183ejs.633.2020.12.08.04.25.08; Tue, 08 Dec 2020 04:25:34 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728839AbgLHJ6a (ORCPT + 99 others); Tue, 8 Dec 2020 04:58:30 -0500 Received: from foss.arm.com ([217.140.110.172]:46620 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727132AbgLHJ63 (ORCPT ); Tue, 8 Dec 2020 04:58:29 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E8B371FB; Tue, 8 Dec 2020 01:57:43 -0800 (PST) Received: from [192.168.178.2] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 768F23F68F; Tue, 8 Dec 2020 01:57:41 -0800 (PST) Subject: Re: [PATCH 2/4] sched/fair: Do not replace recent_used_cpu with the new target To: Mel Gorman , LKML Cc: Aubrey Li , Barry Song , Ingo Molnar , Peter Ziljstra , Juri Lelli , Vincent Guittot , Valentin Schneider , Linux-ARM References: <20201207091516.24683-1-mgorman@techsingularity.net> <20201207091516.24683-3-mgorman@techsingularity.net> From: Dietmar Eggemann Message-ID: <842ef1db-49d1-7d05-997b-1562383cdd28@arm.com> Date: Tue, 8 Dec 2020 10:57:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201207091516.24683-3-mgorman@techsingularity.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. [...] > 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. asym_fits_capacity(task_util, recent_used_cpu)) { /* * Replace recent_used_cpu with prev as it is a potential * candidate for the next wake: */ p->recent_used_cpu = prev; return recent_used_cpu; > @@ -6765,9 +6766,6 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int wake_flags) > } else if (wake_flags & WF_TTWU) { /* XXX always ? */ > /* Fast path */ > new_cpu = select_idle_sibling(p, prev_cpu, new_cpu); > - > - if (want_affine) > - current->recent_used_cpu = cpu; > } > rcu_read_unlock();