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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BFE1DC001DF for ; Fri, 20 Oct 2023 13:42:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YaAk/NtPL/1qapzZeLRfc2vMNNW7G74/Xv3wZez078o=; b=WRvAGcqoJkA4es zg6k/DttiPtXuoUYEgEUcEHuG5v3b9/xQoqSh1tEbq5btdwbsxBNijc8oiT7o2+m0KDlIx/ejVm/H Nk7DmbF9/73bRPD2074h3cRAH5wZAzQuU0plu7uEcGNVZaFThlI2M0xI6HNeXHMU9M9CoZwrdcTwt g3yyxZVAad8dXTYs+ADeXHZ5sYRPuBNIKJUqSYbBUx86DOzbTgb3fnrPjlaqNn8Dca1iOEi8zLDS7 Tqh4VKLf4tgvFSCnRx30+km2VAy19CtN27Qv7OBu2C20ZX0BhdmCVQYgmIbjhVICMDAAOI4vONH+U y4PNDJnuRzJL0E8HYCwg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qtplK-002Ofs-2g; Fri, 20 Oct 2023 13:42:02 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qtpkz-002OcN-0C for linux-arm-kernel@bombadil.infradead.org; Fri, 20 Oct 2023 13:41:41 +0000 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=D9rd6xU5yePrQDC58eLZuz7RrgdD7489xcK5C3D27Ew=; b=mhfhZQzLLz/qRtNyEeyYmpv2La ZJlHInop52voq0ZEMb97JM0EhVl41RtI9/OLfK0vU0IJdwKsVi7WMjKU3dj/AWiR02nKb8nuAVKbq /nCocBD8VdrzHcaETYQ+JCHAPtBw6/JTfudWLNNAPz06Cf7ZvtcezuwDiWDDPjbYZmEDZMy7CTvMD Kla7buaEqoFiiHV9fnMR+8utj7mP3XEGv8nOypvu6035mN5FfYfIH2HJZrf/GgS2Soil2KIhhLX9I AJSuZRSAOBgDAgAXuc/v3ZWlNXpZjHs4fyOIzkivtiIGrUPOJFekdBUWME6x4XR4VP2Tje+sPSMMe evIoi2Pg==; 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 1qtpko-00DQQf-Vj; Fri, 20 Oct 2023 13:41:31 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 9F512300392; Fri, 20 Oct 2023 15:41:30 +0200 (CEST) Date: Fri, 20 Oct 2023 15:41:30 +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: Re: [PATCH v11 2/3] sched/fair: Scan cluster before scanning LLC in wake-up path Message-ID: <20231020134130.GC33965@noisy.programming.kicks-ass.net> References: <20231019033323.54147-1-yangyicong@huawei.com> <20231019033323.54147-3-yangyicong@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231019033323.54147-3-yangyicong@huawei.com> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Oct 19, 2023 at 11:33:22AM +0800, Yicong Yang wrote: > @@ -7349,8 +7373,13 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target) > */ > if (prev != target && cpus_share_cache(prev, target) && > (available_idle_cpu(prev) || sched_idle_cpu(prev)) && > - asym_fits_cpu(task_util, util_min, util_max, prev)) > - return prev; > + asym_fits_cpu(task_util, util_min, util_max, prev)) { > + if (!static_branch_unlikely(&sched_cluster_active)) > + return prev; > + > + if (cpus_share_resources(prev, target)) > + return prev; > + } > > /* > * Allow a per-cpu kthread to stack with the wakee if the > @@ -7377,7 +7406,11 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target) > (available_idle_cpu(recent_used_cpu) || sched_idle_cpu(recent_used_cpu)) && > cpumask_test_cpu(recent_used_cpu, p->cpus_ptr) && > asym_fits_cpu(task_util, util_min, util_max, recent_used_cpu)) { > - return recent_used_cpu; > + if (!static_branch_unlikely(&sched_cluster_active)) > + return recent_used_cpu; > + > + if (cpus_share_resources(recent_used_cpu, target)) > + return recent_used_cpu; > } > > /* I've changed those like so: --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7420,10 +7420,9 @@ static int select_idle_sibling(struct ta if (prev != target && cpus_share_cache(prev, target) && (available_idle_cpu(prev) || sched_idle_cpu(prev)) && asym_fits_cpu(task_util, util_min, util_max, prev)) { - if (!static_branch_unlikely(&sched_cluster_active)) - return prev; - if (cpus_share_resources(prev, target)) + if (!static_branch_unlikely(&sched_cluster_active) || + cpus_share_resources(prev, target)) return prev; } @@ -7452,11 +7451,11 @@ static int select_idle_sibling(struct ta (available_idle_cpu(recent_used_cpu) || sched_idle_cpu(recent_used_cpu)) && cpumask_test_cpu(recent_used_cpu, p->cpus_ptr) && asym_fits_cpu(task_util, util_min, util_max, recent_used_cpu)) { - if (!static_branch_unlikely(&sched_cluster_active)) - return recent_used_cpu; - if (cpus_share_resources(recent_used_cpu, target)) + if (!static_branch_unlikely(&sched_cluster_active) || + cpus_share_resources(recent_used_cpu, target)) return recent_used_cpu; + } /* _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel