Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2533580pxu; Mon, 7 Dec 2020 08:57:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJzm+4KKvJe1dcMVKBZGM/iw9xi7CwGm96w/0wkQAMrjpcyzoBdhaKoVWYxZ16l4qeVSSOJA X-Received: by 2002:a50:c091:: with SMTP id k17mr20669924edf.137.1607360224510; Mon, 07 Dec 2020 08:57:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607360224; cv=none; d=google.com; s=arc-20160816; b=cN5AcE8pVsW3Q1zpSpsKH4ssBi6J8x9F+EuW0ty7rusgnoyv/12SS46P+TutYUbr2r Cs/Z17UIu55lhcoaSRSnHt7EFfyx9Vw1Chh5ozdJvAeEvwO9+7SUjHCc0FZ01BE0/n4n GUfzc0u6Hchpd3S79mbs0klhacj1HqzhhiXveuYMbQuQ2r2YrxsoRA77nOI70yOscWgL J9zbCSm8NbVZ6ifnphwBdYjke8mX0yR0YuoRQIobNUWLEJkXrnWGHOHQbC+H4RF+FB70 bCkiR5ZNI3qVLKv96xy3yRLj6xuWl8EIN93weHE1v6KiRLe/YBCupw4RgmWuK5RD2m+e NqPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:in-reply-to:subject :cc:to:from:user-agent:references; bh=NegZ594kyekvKU2FyrogUd2uV3jpdEpCV7cWF8Xbl54=; b=P23nkgL6m7WeEX6jzixP6dh7kzpygCqwK8r0GLm+R/6SeURL+mCZpDppBEWevMtn4L cTOTW7WE4B/vLh4e15XafindePOTReQAfIbUKV5Y5IbORBnDBNmpspVesq6w++49zZn+ TRDf4aMLZg03v5LYXy4N0yGiULKz3VNxt0NltDPUGFP4dnm7HfGO4OF6LSgylNxjOI86 FsCEzRY8pbreaEu+k6kpRqAqnQ5wByjQ/i/A48Luq8udm62DCamoW5yV2Tfz62klKkpp Rq1vsCv0iiYPoIAgvN6GWLiJfbADAmN2j8a0gL0vx0RjasrNWdigBEbbHin27cYbiLg6 nwRw== 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 e18si6981768ejq.261.2020.12.07.08.56.41; Mon, 07 Dec 2020 08:57:04 -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 S1727496AbgLGQxQ (ORCPT + 99 others); Mon, 7 Dec 2020 11:53:16 -0500 Received: from foss.arm.com ([217.140.110.172]:55560 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725832AbgLGQxQ (ORCPT ); Mon, 7 Dec 2020 11:53:16 -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 879BA101E; Mon, 7 Dec 2020 08:52:30 -0800 (PST) Received: from e113632-lin (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BF3013F66B; Mon, 7 Dec 2020 08:52:28 -0800 (PST) References: <20201118043113.53128-1-aubrey.li@linux.intel.com> <20201207154838.GP3040@hirez.programming.kicks-ass.net> User-agent: mu4e 0.9.17; emacs 26.3 From: Valentin Schneider To: Peter Zijlstra Cc: Aubrey Li , mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, mgorman@techsingularity.net, qais.yousef@arm.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, tim.c.chen@linux.intel.com, linux-kernel@vger.kernel.org, Mel Gorman , Jiang Biao Subject: Re: [RFC PATCH v5] sched/fair: select idle cpu from idle cpumask for task wakeup In-reply-to: <20201207154838.GP3040@hirez.programming.kicks-ass.net> Date: Mon, 07 Dec 2020 16:52:24 +0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/12/20 15:48, Peter Zijlstra wrote: > On Wed, Nov 18, 2020 at 12:31:13PM +0800, Aubrey Li wrote: >> diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c >> index f324dc36fc43..6f5947673e66 100644 >> --- a/kernel/sched/idle.c >> +++ b/kernel/sched/idle.c >> @@ -163,6 +163,7 @@ static void cpuidle_idle_call(void) >> */ >> >> if (cpuidle_not_available(drv, dev)) { >> + update_idle_cpumask(this_rq(), true); >> tick_nohz_idle_stop_tick(); >> >> default_idle_call(); >> @@ -193,6 +194,7 @@ static void cpuidle_idle_call(void) >> max_latency_ns = dev->forced_idle_latency_limit_ns; >> } >> >> + update_idle_cpumask(this_rq(), true); >> tick_nohz_idle_stop_tick(); >> >> next_state = cpuidle_find_deepest_state(drv, dev, max_latency_ns); >> @@ -205,10 +207,12 @@ static void cpuidle_idle_call(void) >> */ >> next_state = cpuidle_select(drv, dev, &stop_tick); >> >> - if (stop_tick || tick_nohz_tick_stopped()) >> + if (stop_tick || tick_nohz_tick_stopped()) { >> + update_idle_cpumask(this_rq(), true); >> tick_nohz_idle_stop_tick(); > > We already have a callback in tick_nohz_idle_stop_tick(), namely > nohz_balance_enter_idle(). That's a no-op for !NO_HZ_COMMON though. For similar reasons, Aubrey moved the clearing of the cpumask to scheduler_tick(). Are you saying this mechanism should only be driven for NO_HZ kernels? I would tend to agree with Vincent that this could still be useful for idling without cutting the tick (!NO_HZ or shallow idle state); see: 20201124170136.GA26613@vingu-book