From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 0BF5C3E168B for ; Thu, 25 Jun 2026 12:42:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782391342; cv=none; b=VqaQ4edm1qJCIUon25537wKrfFII2VvKyHW10w/ZEzm0r/YKUdRn/gK3BX1HTAWg0RaKAFdHy5Qj475NFqXDYYep37oV/osWCgDQQCCXSY8MhfeDLa3Jz4X2+LZSHvsaqj9qpnpjbnicRwIfjeIKh+E9zmzx1nxU6g8ahKBfuDM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782391342; c=relaxed/simple; bh=rOTkq0KI6coYmiOOtzu6VeXYckwB1wXr3KC9teabGTs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cQb6QLB1PxZdLCSO2hUq0friHFODVpHJpU0cmH3dWDqmWMqXY7hw6Iq2lxoA3H6CNo3Fneeq4jRYQSezGyCTLnlLH9yrk8yk/MeU9TKPkm5Khze1ZZLKSDLDOjkVPDHBSI1M2c0/F1cYr3qFQ5sIO6VLWhuh3y3pgePkK7r90Bk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=pass smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=eAKIO2gk; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="eAKIO2gk" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=dmrC11DoKqQE67UIb8699huAxBpF9qHBGYdHKdQqdfQ=; b=eAKIO2gkDZOeBIXXtq0WexgEwb Jvx6kRhrGd4/6Ga4mHMj2DVQNt8oeoMrMqQl1UT5pTrIJN4hq12GuTswp7Y1gtaQfJGIrcA806fWs +VkX8WXjtTHsHT9EJ6raXUnAM4uEgiu1lP3whVl5q47coYCpe+FnjzLHSbqkIvQfedyZcRR4pZcAq DfZCc3pQZA9EcLSSgWaIrTmMTErWga3f557dIbFilWHPJMApOH9/+kZ0m5roqACeQy5MeMq+Th0yV rxtognqnSi9vHdtQ/Kp1DYP4hFEsFTlGwTJqNbm+yxAAqav9YEtfmkWgYdtaQlUpSFLnfvhQJYnIu PgQLY5GQ==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux)) id 1wcjPK-00000003ccn-1TVL; Thu, 25 Jun 2026 12:42:14 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 890F33005AF; Thu, 25 Jun 2026 14:42:13 +0200 (CEST) Date: Thu, 25 Jun 2026 14:42:13 +0200 From: Peter Zijlstra To: K Prateek Nayak Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, ziqianlu@bytedance.com, tj@kernel.org, williams@redhat.com, jkacur@redhat.com Subject: Re: [PATCH 1/2] sched/core: Allow newidle for core-sched Message-ID: <20260625124213.GX42921@noisy.programming.kicks-ass.net> References: <20260624121327.190063948@infradead.org> <20260624122451.583174198@infradead.org> 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: On Thu, Jun 25, 2026 at 05:26:03AM +0530, K Prateek Nayak wrote: > ... or we can return a RETRY_TASK when newidle balance succeeds too to > force a core-wide pick when core scheduling is enabled like: > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 0d212bf04885..e393aed58bfa 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -9946,8 +9946,16 @@ struct task_struct *pick_task_fair(struct rq *rq, struct rq_flags *rf) > if (rq_modified_above(rq, &fair_sched_class)) > return RETRY_TASK; > > - if (cfs_rq->nr_queued) > + if (cfs_rq->nr_queued) { > + /* > + * Force a core-wide pick if newidle > + * balance managed to pull a task since > + * the lock was dropped. > + */ > + if (sched_core_enabled(rq)) > + return RETRY_TASK; > goto again; > + } > > return NULL; > } This has forward progress issues. You can ping-pong he one task back and forth and never actually pick anything.