From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B203B3C6A36 for ; Wed, 1 Apr 2026 08:56:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775033788; cv=none; b=cLY2j0t7QCXy/mNJ1mjz5ifJ9Qo4/uijuUfGVdhIe/Iu4G22sn4olZ9WIWRHfFVnE4ueqeHJAH2N+DRMBmrsvYn4RyT1rbMklFQLnGoLpoa8vFc9W19P6CSBtKQCkQvv8poG0OMZFLzY4fFBChCElvJdcsPg4OMWe+443y57BcA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775033788; c=relaxed/simple; bh=Qhr0q1nhprWH1JABhOsQ0FRI1YfPg26/UmYihrsukIc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=MOSyHtL9ZXv5moiMKyII6ewMRtG2WFKgktT1ufmXOuOKwhKOWRsCUhydImEW5+s18V9t7m4GKAB5YKXc2ehky80x9tk8dpwoVaoN67mynxLUl0PD3hqpT0bwXbRYEtzrYzZBA3ASBO6heO4HWpEJt9GAElyCc1jw1Wo7Hy5o7J8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=DPxVKWWh; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="DPxVKWWh" 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 8531D22FC; Wed, 1 Apr 2026 01:56:16 -0700 (PDT) Received: from [10.1.28.49] (e127648.arm.com [10.1.28.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AB7E13F7D8; Wed, 1 Apr 2026 01:56:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1775033782; bh=Qhr0q1nhprWH1JABhOsQ0FRI1YfPg26/UmYihrsukIc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=DPxVKWWh7UCFEBQILpt2PMYqM+KDtCe7uR9CL9rTBtd3kjp7PZxnNAVHv583MU7Wu z5bp+V/272ve1zP+qg5wPsKa6u7TOQ5vGkGJTwIQ2QCFzbgnYFpC0efdbqMbImPDFy jXNGue5qOAnfMc193Ii7d82sNEnQT9XDq7VbccVo= Message-ID: <6eb44eb4-3b45-4467-b17f-c01334126993@arm.com> Date: Wed, 1 Apr 2026 09:56:17 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RESEND 3/4] sched/fair: Allow load balancing between CPUs of equal capacity To: Ricardo Neri , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Tim C Chen , Barry Song Cc: "Rafael J. Wysocki" , Len Brown , ricardo.neri@intel.com, linux-kernel@vger.kernel.org References: <20260330-rneri-fix-cas-clusters-v1-0-1e465b6fecb2@linux.intel.com> <20260330-rneri-fix-cas-clusters-v1-3-1e465b6fecb2@linux.intel.com> Content-Language: en-US From: Christian Loehle In-Reply-To: <20260330-rneri-fix-cas-clusters-v1-3-1e465b6fecb2@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 3/30/26 23:20, Ricardo Neri wrote: > sched_balance_find_src_rq() is supposed to avoid picking as busiest a > runqueue with a single running task since that would result in the task > migrating to a lower-capacity CPU. It also prevents migrations between CPUs > of equal capacity. > > Migrating tasks between CPUs of equal capacity helps when balancing load in > a scheduling domain in which there are CPUs of different capacity and are > grouped in clusters of CPUs of equal capacity that share L2 cache. Load > should be balanced among these clusters when CONFIG_SCHED_CLUSTER is > enabled. > > Signed-off-by: Ricardo Neri > --- > kernel/sched/fair.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 3c50ecffa4c7..a7fd4f1f4348 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -11388,6 +11388,7 @@ static struct rq *sched_balance_find_src_rq(struct lb_env *env, > * average load. > */ > if (env->sd->flags & SD_ASYM_CPUCAPACITY && > + capacity_of(env->dst_cpu) != capacity && > !capacity_greater(capacity_of(env->dst_cpu), capacity) && > nr_running == 1) > continue; > For consistency, doesn't it make sense to just invert capacity_greater() here? So: capacity_greater(capacity, capacity_of(env->dst_cpu)) if (env->sd->flags & SD_ASYM_CPUCAPACITY && capacity_greater(capacity, capacity_of(env->dst_cpu)) && nr_running == 1) continue;