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 6EE423EF0B7 for ; Wed, 6 May 2026 17:01:47 +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=1778086910; cv=none; b=gU1SzjB5vlHqd0Yj9iFR2yFYUOerYyAE8qgudlLVOY823Qo3PSQMuGJPmXWC3qXGhJXixlfOiEgzbAxny5BLjTlNRq/o6megQrxNtgPsroIW7u/P5ssRRheKmn9jHxaPLsvzJzBuCc278xlKpllQODzE2DzpyCZ4SjXVb5q33Uo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778086910; c=relaxed/simple; bh=yKM5lMCos20FqcffR5Z8oxWFhH4uo+o/ZKYeqZgsJxI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=RBswv8wbhMyHLjDcX1f7D0+e3IDOZEnmX0Miz7Sr2Ov7lAdR0Tms6Spy8KUwBdmP6PuH6USO3xf4euB0gGSzcZSGTW5+qKHU1pudiOOHtznwo7f7lUunErrTUKzI8YJUHlxCA9J/IRIyuw/X6cNbxzZSTs4N9Emra9Fr1kzc2TI= 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=uyC/QEym; 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="uyC/QEym" 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 BBCA92F7E; Wed, 6 May 2026 10:01:40 -0700 (PDT) Received: from [192.168.178.100] (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 672DB3F836; Wed, 6 May 2026 10:01:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1778086906; bh=yKM5lMCos20FqcffR5Z8oxWFhH4uo+o/ZKYeqZgsJxI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=uyC/QEymMUmkTYm5wknudKUP6ZiPRy55gMwTjD6OJzYYErNq3DCtyIbzxr+6XyAto 585lASkKdwsfMhqHDb18UOf//QokUD2ou+fyzDeOkg7xCAmrksZ60JH5zTj+x/F315 02pmsnv3LR0sCUVH+DodxApW7KHWi14jeC9lFYNU= Message-ID: Date: Wed, 6 May 2026 19:01:35 +0200 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 5/5] sched/fair: Add SIS_UTIL support to select_idle_capacity() To: Vincent Guittot , Andrea Righi Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak , Christian Loehle , Koba Ko , Felix Abecassis , Balbir Singh , Joel Fernandes , Shrikanth Hegde , linux-kernel@vger.kernel.org References: <20260428144352.3575863-1-arighi@nvidia.com> <20260428144352.3575863-6-arighi@nvidia.com> Content-Language: en-GB From: Dietmar Eggemann In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 06.05.26 14:59, Vincent Guittot wrote: > On Tue, 28 Apr 2026 at 16:44, Andrea Righi wrote: >> >> From: K Prateek Nayak [...] >> @@ -8026,10 +8027,28 @@ select_idle_capacity(struct task_struct *p, struct sched_domain *sd, int target) >> util_min = uclamp_eff_value(p, UCLAMP_MIN); >> util_max = uclamp_eff_value(p, UCLAMP_MAX); >> >> + if (sched_feat(SIS_UTIL) && sd->shared) { >> + /* >> + * Same nr_idle_scan hint as select_idle_cpu(), nr only limits >> + * the scan when not preferring an idle core. >> + */ >> + nr = READ_ONCE(sd->shared->nr_idle_scan) + 1; >> + /* overloaded domain is unlikely to have idle cpu/core */ >> + if (nr == 1) >> + return -1; >> + } >> + >> for_each_cpu_wrap(cpu, cpus, target) { >> bool preferred_core = !prefers_idle_core || is_core_idle(cpu); >> unsigned long cpu_cap = capacity_of(cpu); >> >> + /* >> + * Good-enough early exit (mirrors select_idle_cpu() logic). >> + */ >> + if (!prefers_idle_core && >> + --nr <= 0 && best_fits == ASYM_IDLE_CORE_UCLAMP_MISFIT) > > With SMT, !prefers_idle_core implies that there is no idle core; Is > best_fits == ASYM_IDLE_CORE_UCLAMP_MISFIT really expected in such case > ? > > With !SMT, !prefers_idle_core is always true and we will bail out > early as expected I struggle to comprehend: I assume the mirrored select_idle_cpu() logic is: for_each_cpu_wrap(cpu, cpus, target + 1) if (has_idle_core) else if (--nr <= 0) return -1 Should this condition not be just: if (!prefers_idle_core && --nr <= 0) return best_cpu since if we do a: if (!choose_idle_cpu(cpu, p))) continue; right after that? best_cpu is -1 by default so sis() will return target, in case we already found a best_cpu then sis() will return this instead. What do I miss here? > > >> + return best_cpu; >> + >> if (!choose_idle_cpu(cpu, p)) >> continue; [...]