From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0FC463A48D5 for ; Tue, 12 May 2026 16:59:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778605179; cv=none; b=uDYMJs/uJTS0IszxISanogveP53Tb0PDPy9rw4Asy5Y0LOdlD/R0VVhSUPEfMubiBJed/5YvA/9L6b7wuaL3olsMcdsyefBM2C7xMV88A/y5/knyXwb6BDV+Nt3KNCMYC6IyXjb6KRmk7UfWzxcy/BoO7dDNCiAtR8Gmsd6mkxg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778605179; c=relaxed/simple; bh=W0L+9Je3R15CP4OJWKbHBoNnQ4sL3UM7RNY3yCKcM/k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iZvNhC6sZmA/NA5FJj97FvAGV7IG2zcUzCPVGrTXwVSAjKYfCS1sQNSTq8xq9s0vEoyJFfhBgIFhmks9fBSe3hy/gnYOgPvXy9tPJbxhRgLV6iIF4XAtPwjbJ86oalvLtAT4LKwONXLOqSIergj+OyvZf+NOUw3iGPFuRDeD1R8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=X5LWanMG; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="X5LWanMG" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778605177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZwRU8ZZwaqJ0PrEU7gSoOlX+Ny3NycBPS3BiPLPSjCU=; b=X5LWanMGnmO0hojwOqCO4VmuHr80yl1STJ22QHIZOy7R/Agn45a1oj7Bmx0nqqfN1tRkZF nyQL7HbE9fms/Vp61SKXbZRhVQyvkVHRwSHDUGapfe0E+x4HxXo9ztwkniArt++XpRJhJ/ jxWZYLwIbe29EyFTGEyNCRylN9CKAUc= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-595-VAeZGOirNK6Hqq0O1mpfog-1; Tue, 12 May 2026 12:59:33 -0400 X-MC-Unique: VAeZGOirNK6Hqq0O1mpfog-1 X-Mimecast-MFC-AGG-ID: VAeZGOirNK6Hqq0O1mpfog_1778605172 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A7A6E195604F; Tue, 12 May 2026 16:59:31 +0000 (UTC) Received: from pauld.westford.csb (headnet01.pony-001.prod.iad2.dc.redhat.com [10.2.32.101]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 66924180034E; Tue, 12 May 2026 16:59:29 +0000 (UTC) Date: Tue, 12 May 2026 12:59:27 -0400 From: Phil Auld To: Shrikanth Hegde Cc: mingo@kernel.org, peterz@infradead.org, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org, kprateek.nayak@amd.com, juri.lelli@redhat.com, vschneid@redhat.com, dietmar.eggemann@arm.com, tj@kernel.org, rostedt@goodmis.org, mgorman@suse.de, bsegall@google.com, arighi@nvidia.com Subject: Re: [PATCH v2 3/3] sched/fair: Add compile time check in fastpaths for CONFIG_SCHED_SMT=n Message-ID: <20260512165927.GD140541@pauld.westford.csb> References: <20260512152125.308280-1-sshegde@linux.ibm.com> <20260512152125.308280-4-sshegde@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260512152125.308280-4-sshegde@linux.ibm.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Hi Shrikanth, On Tue, May 12, 2026 at 08:51:25PM +0530 Shrikanth Hegde wrote: > For fastpaths such as wakeup, load balance even a minimal code additons > can pop up. Add IS_ENABLED checks there to ensure there is no overhead. "For fastpaths such as wakeup and load balance, even minimal code additions can add up. Add IS_ENABLED() checks..." ? > > Other places are either have sched_smt_active() check or they are not in s/are// "have a sched_smt_active_check()" or drop "check" ? Otherwise lgtm. Reviewed-by: Phil Auld Cheers, Phil > fast paths. > > Signed-off-by: Shrikanth Hegde > --- > kernel/sched/fair.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 353e31ecaadc..b6f9592b31fd 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -1586,6 +1586,9 @@ static inline bool is_core_idle(int cpu) > { > int sibling; > > + if (!IS_ENABLED(CONFIG_SCHED_SMT)) > + return true; > + > for_each_cpu(sibling, cpu_smt_mask(cpu)) { > if (cpu == sibling) > continue; > @@ -12003,7 +12006,8 @@ static int should_we_balance(struct lb_env *env) > * idle has been found, then its not needed to check other > * SMT siblings for idleness: > */ > - cpumask_andnot(swb_cpus, swb_cpus, cpu_smt_mask(cpu)); > + if (IS_ENABLED(CONFIG_SCHED_SMT)) > + cpumask_andnot(swb_cpus, swb_cpus, cpu_smt_mask(cpu)); > continue; > } > > -- > 2.47.3 > > --