Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp1031106rdb; Fri, 20 Oct 2023 06:44:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHTZXhOyFi2fVNZN9BFgqBtju1jKvlfo8rdrXn3ewn0eH2K1+AMBNBboRrWyubPhx1yo9ti X-Received: by 2002:a05:6871:521e:b0:1e9:9180:6f60 with SMTP id ht30-20020a056871521e00b001e991806f60mr2244128oac.23.1697809489859; Fri, 20 Oct 2023 06:44:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697809489; cv=none; d=google.com; s=arc-20160816; b=lfZLMcv4Na6LefsZv/aK+grkjOZFVnvjnFz0b1FfiByBdemHjw42tWOABXFFca+1PA LP/JkjkxZGnh5AFh+UNv16VmkWqiAvodvqDnN0vHbAZZMC4i++8z3KtNtWUlo2fjRDpE 12ynvU02noe3ANs5+k6SO/1iHWIcX3SBYE9QbSazsBznnN8hUXqfkHmTlfSKbooY3+mK f6mPe0DN1ZE8K9YEWbj+TSKlfBpdES1t32iao9niNP5wGqS41qKVRtnpt+/zj77+xSs0 hhlfKENN6/awK1ABgWTXbyqVH9HOWR7mk8rccQ0iqwUDZbDF6cx4xXJP3JrYupfxNc3R WjQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=VtM4fZvfkrGP76noU6hoHZ7O8+G+x3ssq63G10tuoB0=; fh=7nZAU01LwS4GaLhP83jEBKgECrdb0rn/OlaPuapZT38=; b=mIPrQq8NMtBLhFEyTLKiMNLoUqf3QWe/f7IPsTtMGBfVbnRWQPj8lDjboi26NDdNnq 3vCAQ4aFc31VtFtzr22As/OF/b7+KSQl6HiBUIT6LocKvZ01ctQP7ruE4ZFLldQaXN2N KBe5nVI23D+tBXzQz7+pomjZ1uiLjkf1fdnImB1/wPMfiVixaxqlk5tA8sRZiNSR9joS mlsdWX82cx6WWfT2dF6J14WXPDDfY9kMj41AMpZl9qxSN9pdSKCMEe2l3zofi+m/HlAg J0FVlVFWWUxzZZzz4OQcjoHIqWSQSUZdTyFJGvBwCmNP3oinOOAIPEm2GC4ihhhmslkv 4f7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=FbZu5DGm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id m3-20020a656a03000000b0059b7f926c03si2022643pgu.771.2023.10.20.06.44.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 06:44:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=FbZu5DGm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 580F682D1C2F; Fri, 20 Oct 2023 06:44:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377372AbjJTNoe (ORCPT + 99 others); Fri, 20 Oct 2023 09:44:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377074AbjJTNoc (ORCPT ); Fri, 20 Oct 2023 09:44:32 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0F44A3 for ; Fri, 20 Oct 2023 06:44:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=VtM4fZvfkrGP76noU6hoHZ7O8+G+x3ssq63G10tuoB0=; b=FbZu5DGm6rwLX9Tb2SzEf9Jqqi ypsCIfvuVb7UuqsjmvA3xKHhsrOkP7XJCXM9EAIk93OK0ViQElE27AkiEPWmpZA03soRwDFgpWHEb HgvttCTMxpqDJA9S0EZFenzPXi/G3SgmaSF/8O70XRJSZpgcTt0EJoeijiZO9SYgl11f5OkCiZms6 qx8zRNI+qdzjdqyPayxNvdRA129rhkdI/yXk2t86MRF5Nq4b4dSw/ArFdEOXH4yLcSYTZbTJxWdPZ oOIdLqjgHCarypugH3yY+KMwy9Cw2Q8HVmHbbz4i44CHbnPwAdua9UaDoEuUOOmNUEyD1STVw8Lro iFjCuLVg==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qtpms-00DQUw-Fn; Fri, 20 Oct 2023 13:43:38 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id CA0AB300392; Fri, 20 Oct 2023 15:43:37 +0200 (CEST) Date: Fri, 20 Oct 2023 15:43:37 +0200 From: Peter Zijlstra To: Yicong Yang Cc: mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, tim.c.chen@linux.intel.com, yu.c.chen@intel.com, gautham.shenoy@amd.com, mgorman@suse.de, vschneid@redhat.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com, prime.zeng@huawei.com, yangyicong@hisilicon.com, jonathan.cameron@huawei.com, ego@linux.vnet.ibm.com, srikar@linux.vnet.ibm.com, linuxarm@huawei.com, 21cnbao@gmail.com, kprateek.nayak@amd.com, wuyun.abel@bytedance.com Subject: [PATCH] sched/fair: Remove SIS_PROP Message-ID: <20231020134337.GD33965@noisy.programming.kicks-ass.net> References: <20231019033323.54147-1-yangyicong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231019033323.54147-1-yangyicong@huawei.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 20 Oct 2023 06:44:47 -0700 (PDT) Since this had me looking at all that code, I did the below. Holler if there's objections etc.. --- Subject: sched/fair: Remove SIS_PROP From: Peter Zijlstra Date: Fri Oct 20 12:35:33 CEST 2023 SIS_UTIL seems to work well, lets remove the old thing. Signed-off-by: Peter Zijlstra (Intel) --- include/linux/sched/topology.h | 2 - kernel/sched/core.c | 5 ---- kernel/sched/fair.c | 48 ----------------------------------------- kernel/sched/features.h | 1 kernel/sched/sched.h | 3 -- 5 files changed, 59 deletions(-) --- a/include/linux/sched/topology.h +++ b/include/linux/sched/topology.h @@ -109,8 +109,6 @@ struct sched_domain { u64 max_newidle_lb_cost; unsigned long last_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]; --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3792,9 +3792,6 @@ ttwu_do_activate(struct rq *rq, struct t if (rq->avg_idle > max) rq->avg_idle = max; - rq->wake_stamp = jiffies; - rq->wake_avg_idle = rq->avg_idle / 2; - rq->idle_stamp = 0; } #endif @@ -9991,8 +9988,6 @@ void __init sched_init(void) rq->online = 0; rq->idle_stamp = 0; rq->avg_idle = 2*sysctl_sched_migration_cost; - rq->wake_stamp = jiffies; - rq->wake_avg_idle = rq->avg_idle; rq->max_idle_balance_cost = sysctl_sched_migration_cost; INIT_LIST_HEAD(&rq->cfs_tasks); --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7209,45 +7209,9 @@ static int select_idle_cpu(struct task_s struct cpumask *cpus = this_cpu_cpumask_var_ptr(select_rq_mask); int i, cpu, idle_cpu = -1, nr = INT_MAX; struct sched_domain_shared *sd_share; - struct rq *this_rq = this_rq(); - int this = smp_processor_id(); - struct sched_domain *this_sd = NULL; - u64 time = 0; cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr); - if (sched_feat(SIS_PROP) && !has_idle_core) { - u64 avg_cost, avg_idle, span_avg; - unsigned long now = jiffies; - - this_sd = rcu_dereference(*this_cpu_ptr(&sd_llc)); - if (!this_sd) - return -1; - - /* - * If we're busy, the assumption that the last idle period - * predicts the future is flawed; age away the remaining - * predicted idle time. - */ - if (unlikely(this_rq->wake_stamp < now)) { - while (this_rq->wake_stamp < now && this_rq->wake_avg_idle) { - this_rq->wake_stamp++; - this_rq->wake_avg_idle >>= 1; - } - } - - avg_idle = this_rq->wake_avg_idle; - 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); - } - if (sched_feat(SIS_UTIL)) { sd_share = rcu_dereference(per_cpu(sd_llc_shared, target)); if (sd_share) { @@ -7301,18 +7265,6 @@ static int select_idle_cpu(struct task_s if (has_idle_core) set_idle_cores(target, false); - if (sched_feat(SIS_PROP) && this_sd && !has_idle_core) { - time = cpu_clock(this) - time; - - /* - * Account for the scan cost of wakeups against the average - * idle time. - */ - this_rq->wake_avg_idle -= min(this_rq->wake_avg_idle, time); - - update_avg(&this_sd->avg_scan_cost, time); - } - return idle_cpu; } --- a/kernel/sched/features.h +++ b/kernel/sched/features.h @@ -49,7 +49,6 @@ SCHED_FEAT(TTWU_QUEUE, true) /* * When doing wakeups, attempt to limit superfluous scans of the LLC domain. */ -SCHED_FEAT(SIS_PROP, false) SCHED_FEAT(SIS_UTIL, true) /* --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1059,9 +1059,6 @@ struct rq { u64 idle_stamp; u64 avg_idle; - unsigned long wake_stamp; - u64 wake_avg_idle; - /* This is used to determine avg_idle's max value */ u64 max_idle_balance_cost;