Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp123133pxb; Tue, 9 Mar 2021 18:06:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJzF4X162iv8N8OuOceF1vin/dvr+FnMHEMn5DHUa+6Ab0MjhUXgJAruJwyExk3xATyoQ09h X-Received: by 2002:a17:906:f12:: with SMTP id z18mr274663eji.132.1615341969379; Tue, 09 Mar 2021 18:06:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615341969; cv=none; d=google.com; s=arc-20160816; b=XBzTXeiel3y0iAFBUtnJiHMNIBYi0VdM5gEvb0NrUfmoizjgCaXYsP228dMjlDqx5V XSViIn/I8jr+k0Iek0mqrPpGrmH1XIZGWUkm+wsfJwAKoEe4kVp7f2tpe6y0qPbz7ZIY AUwO22nNS5FDddIuQi55RuTeKl28Qvy1T+QZDzeIVF7y4o8FpBShwTOs+Y+bT47+KfrW +DyjjYxNUYjYvJdKQ8zqGiRzSLG/buTsohmD3Kn9t/aehh1ewAnOT4N8jndRaMgeHP5w XhTNyLXDoojRjdiS0yb2mJ2/eQRGxQ5ES+5rW1x37z9SCix4eRA5lJ/xEdfAWMhQutSV IB1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:ironport-sdr:ironport-sdr; bh=dHcV4p1yr4bQephN8ZxDra6bim0vRJyNTI+l8urxRtU=; b=oNveIMVafJYBln+lYHWBtn/JehYQzor+TJOlm4/XINjG0OxDTsF5phtxFHBYx4n9zO gGRG2pUzohox6WEXeB0CXa3387HgVucnzoxDm+xirBvMCN3vAlER1/w0mL5qOnaSL3LF oUCaqea1vwW8ZgWfB1rV78TIWt+Eg6xU8rD1MgwZqTCz9LNhxMBFBoDjrXC/VT1dEIKP Ok304ZSN80gcI5Ztf6uy5zW+DWitcTopnc/Bc+C3zH/KR0V6IyZGIWxZSh5ACoaCn3Xv vaeK+WhJOTQ1v8MsZghZLSjmDkz7K1PCcJUP4eEZbLXXxCDeIeaYS10orA6wl8d/0P0u vMbA== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l24si10675147eds.501.2021.03.09.18.05.47; Tue, 09 Mar 2021 18:06:09 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231607AbhCJCEU (ORCPT + 99 others); Tue, 9 Mar 2021 21:04:20 -0500 Received: from mga12.intel.com ([192.55.52.136]:39777 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231490AbhCJCD5 (ORCPT ); Tue, 9 Mar 2021 21:03:57 -0500 IronPort-SDR: W6RnDNDuQCN3R8YEpsRhrltosA4gLF4AFYWoDnXjERcrPll7PKJ389kOnheN1FdGxehFCLNOet IsDccuB3yggw== X-IronPort-AV: E=McAfee;i="6000,8403,9917"; a="167636768" X-IronPort-AV: E=Sophos;i="5.81,236,1610438400"; d="scan'208";a="167636768" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2021 18:03:57 -0800 IronPort-SDR: 3m1K0pJmu/qYEtIzWx76lJTQIRakC30I7jy08iRij/gU14wnjcVoHHQ00bGxOabjIjTODFr0Bm 4NS/Kg7en3DA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,236,1610438400"; d="scan'208";a="409977906" Received: from aubrey-ubuntu.sh.intel.com ([10.239.53.7]) by orsmga008.jf.intel.com with ESMTP; 09 Mar 2021 18:03:53 -0800 From: Aubrey Li To: mingo@redhat.com, peterz@infradead.org, vincent.guittot@linaro.org, mgorman@techsingularity.net, juri.lelli@redhat.com, valentin.schneider@arm.com, qais.yousef@arm.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com Cc: tim.c.chen@linux.intel.com, linux-kernel@vger.kernel.org, Aubrey Li , Mel Gorman , Jiang Biao Subject: [PATCH v9 2/2] sched/fair: Remove SIS_PROP Date: Wed, 10 Mar 2021 10:12:22 +0800 Message-Id: <1615342342-50093-2-git-send-email-aubrey.li@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615342342-50093-1-git-send-email-aubrey.li@intel.com> References: <1615342342-50093-1-git-send-email-aubrey.li@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aubrey Li Scanning idle cpu from the idle cpumask avoid superfluous scans of the LLC domain, as the first bit in the idle cpumask is the target. Considering the selected target could become busy, the idle check is reserved, but SIS_PROP feature becomes meaningless, so remove avg_scan_cost computation as well. Cc: Peter Zijlstra Cc: Mel Gorman Cc: Vincent Guittot Cc: Qais Yousef Cc: Valentin Schneider Cc: Tim Chen Cc: Jiang Biao Signed-off-by: Aubrey Li --- include/linux/sched/topology.h | 2 -- kernel/sched/fair.c | 33 ++------------------------------- kernel/sched/features.h | 5 ----- 3 files changed, 2 insertions(+), 38 deletions(-) diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h index 905e382..2a37596 100644 --- a/include/linux/sched/topology.h +++ b/include/linux/sched/topology.h @@ -113,8 +113,6 @@ struct sched_domain { u64 max_newidle_lb_cost; unsigned long next_decay_max_lb_cost; - u64 avg_scan_cost; /* select_idle_sibling */ - #ifdef CONFIG_SCHEDSTATS /* load_balance() stats */ unsigned int lb_count[CPU_MAX_IDLE_TYPES]; diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 15d23d2..6236822 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6117,18 +6117,15 @@ static inline int select_idle_core(struct task_struct *p, int core, struct cpuma #endif /* CONFIG_SCHED_SMT */ /* - * Scan the LLC domain for idle CPUs; this is dynamically regulated by - * comparing the average scan cost (tracked in sd->avg_scan_cost) against the - * average idle time for this rq (as found in rq->avg_idle). + * Scan idle cpumask in the LLC domain for idle CPUs */ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int target) { struct cpumask *cpus = this_cpu_cpumask_var_ptr(select_idle_mask); - int i, cpu, idle_cpu = -1, nr = INT_MAX; + int i, cpu, idle_cpu = -1; bool smt = test_idle_cores(target, false); int this = smp_processor_id(); struct sched_domain *this_sd; - u64 time; this_sd = rcu_dereference(*this_cpu_ptr(&sd_llc)); if (!this_sd) @@ -6141,25 +6138,6 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t */ cpumask_and(cpus, sds_idle_cpus(sd->shared), p->cpus_ptr); - if (sched_feat(SIS_PROP) && !smt) { - u64 avg_cost, avg_idle, span_avg; - - /* - * Due to large variance we need a large fuzz factor; - * hackbench in particularly is sensitive here. - */ - avg_idle = this_rq()->avg_idle / 512; - avg_cost = this_sd->avg_scan_cost + 1; - - span_avg = sd->span_weight * avg_idle; - if (span_avg > 4*avg_cost) - nr = div_u64(span_avg, avg_cost); - else - nr = 4; - - time = cpu_clock(this); - } - for_each_cpu_wrap(cpu, cpus, target) { if (smt) { i = select_idle_core(p, cpu, cpus, &idle_cpu); @@ -6167,8 +6145,6 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t return i; } else { - if (!--nr) - return -1; idle_cpu = __select_idle_cpu(cpu); if ((unsigned int)idle_cpu < nr_cpumask_bits) break; @@ -6178,11 +6154,6 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t if (smt) set_idle_cores(this, false); - if (sched_feat(SIS_PROP) && !smt) { - time = cpu_clock(this) - time; - update_avg(&this_sd->avg_scan_cost, time); - } - return idle_cpu; } diff --git a/kernel/sched/features.h b/kernel/sched/features.h index 1bc2b15..267aa774 100644 --- a/kernel/sched/features.h +++ b/kernel/sched/features.h @@ -53,11 +53,6 @@ SCHED_FEAT(NONTASK_CAPACITY, true) SCHED_FEAT(TTWU_QUEUE, true) /* - * When doing wakeups, attempt to limit superfluous scans of the LLC domain. - */ -SCHED_FEAT(SIS_PROP, true) - -/* * Issue a WARN when we do multiple update_rq_clock() calls * in a single rq->lock section. Default disabled because the * annotations are not complete. -- 2.7.4