From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 B29CB35CBD6 for ; Fri, 26 Jun 2026 06:41:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782456096; cv=none; b=ZpeLlaQdlkiR7IKiwoCZrajETOl47MuWZE9o9xLDIDhELsw1yU0fDinLi3W5SaegMb15yI63EF2HmTCriMSkq1vPMAy8ER2GFYVuHHoeohQntwwVoDeLjbvi+Mpn3pCVCVLX46wxmfxMXaBsbX8thkpDAdeR0x/EGeSvXMEgKhc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782456096; c=relaxed/simple; bh=zoNCvZ7SfRpE4P+u1fyWxAivoCwDsujJZJrnG+DpI9c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pEPSxDb3jRmLFqx9AUzEmxTGWOKk0QjfRw3t03zua6ZpuS3AykXwOCOlDJGH2o5FyLNBCm3Do9B6kn1bAHBFHDwJUBmyamD6YQYm5RLc2fHQqi2KEZbO9w89pJCawvJ/Sv4Ljpv/yH78am9bHkvrZk3rjtYkVOffpeaFy/Asko4= 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=On1M9qjW; arc=none smtp.client-ip=90.155.50.34 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="On1M9qjW" 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=lGcrb2SQ8e2PGZ6Fo7VT2zKsfrMn5AZvIn8yMv2Tun0=; b=On1M9qjWmGk1k5hVtuurSqk861 vxOtywWdJNXIngrHzLe/nfz0rvzpuAm91Qqg52QPK/SVPsD/B97ZfHeVVHJcWnmXEMoUFeHgErCHY 4npZ0tHiF8TVnkxf+lWoUyZ/eOsJrLFVMIVUWSVI5qg0UInB1LKugTHJQY+eU7AOg2wJvzipGboML nQWeBx81pIHqmCzvHYVo/+4iHprhb9d/q/M7aKqDloj3pO4iTo8MwB+ZfGfjsbGh92a/YyGIRVrEy 07qy2+n7Zq39LDh0zZPCvEtwOWU0wXU6MZcyLXrAD/aGPuw7J+j5qYecS7//bkzz3Wzxja/eSEfaL TazuhXJA==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux)) id 1wd0Fd-0000000BMNC-0kf7; Fri, 26 Jun 2026 06:41:21 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 0B106300BDE; Fri, 26 Jun 2026 08:41:20 +0200 (CEST) Date: Fri, 26 Jun 2026 08:41:19 +0200 From: Peter Zijlstra To: K Prateek Nayak Cc: Vincent Guittot , mingo@redhat.com, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, linux-kernel@vger.kernel.org, qyousef@layalina.io Subject: Re: [PATCH 6/6 v3] sched/eevdf: Speedup short slice task scheduling Message-ID: <20260626064119.GF1181229@noisy.programming.kicks-ass.net> References: <20260624151229.1710703-1-vincent.guittot@linaro.org> <20260624151229.1710703-7-vincent.guittot@linaro.org> <613c1bde-4152-493f-b103-f1fda035b4af@amd.com> <20260625083720.GR42921@noisy.programming.kicks-ass.net> <20260625100957.GA2568396@noisy.programming.kicks-ass.net> <20260625222843.GE1181229@noisy.programming.kicks-ass.net> <9a7608a5-d164-4b1c-93d9-6a7431b7a896@amd.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: <9a7608a5-d164-4b1c-93d9-6a7431b7a896@amd.com> On Fri, Jun 26, 2026 at 09:27:41AM +0530, K Prateek Nayak wrote: > Hello Peter, > > On 6/26/2026 3:58 AM, Peter Zijlstra wrote: > > +static u64 ineligible_vruntime(struct cfs_rq *cfs_rq) > > +{ > > + struct sched_entity *curr = cfs_rq->curr; > > + long weight = cfs_rq->sum_weight; > > + s64 delta = 0; > > + > > + if (curr && !curr->on_rq) > > + curr = NULL; > > + > > + /* > > + * This is called from set_next_task_fair(.first=true) / > > + * set_protect_slice() so curr had better be set and on_rq. > > + */ > > + WARN_ON_ONCE(!curr); > > set_protect_slice() is indeed called from set_next_entity(.first=true) > but it is done after __dequeue_entity() and before "cfs_rq->curr" is > set (both sched/flat and sched/core have the same pattern). > > You should be hitting this splat very easily unless you have moved > set_protect_slice() after the setting of cfs_rq->curr in your tree. | static void set_next_task_fair(struct rq *rq, struct task_struct *p, bool first) | { | struct sched_entity *se = &p->se; | bool throttled = false; | struct cfs_rq *cfs_rq = &rq->cfs; | unsigned long weight = NICE_0_LOAD; | bool on_rq = se->on_rq; | | clear_buddies(cfs_rq, se); | | if (on_rq) | __dequeue_entity(cfs_rq, se); XXX | | for_each_sched_entity(se) { | cfs_rq = cfs_rq_of(se); | | if (!IS_ENABLED(CONFIG_FAIR_GROUP_SCHED) || | !first || !cfs_rq->h_curr) | set_next_entity(cfs_rq, se); | | /* ensure bandwidth has been allocated on our new cfs_rq */ | throttled |= account_cfs_rq_runtime(cfs_rq, 0); | | if (on_rq) | weight = __calc_prop_weight(cfs_rq, se, weight); | } | | if (throttled) | task_throttle_setup_work(p); | | se = &p->se; | cfs_rq->curr = se; XXX | | if (on_rq) { | reweight_eevdf(cfs_rq, se, weight, se->on_rq); | if (first) | set_protect_slice(cfs_rq, se); XXX | } | | if (task_on_rq_queued(p)) { | /* | * Move the next running task to the front of the list, so our | * cfs_tasks list becomes MRU one. | */ | list_move(&se->group_node, &rq->cfs_tasks); | } | if (!first) | return; | | WARN_ON_ONCE(se->sched_delayed); | | if (hrtick_enabled_fair(rq)) | hrtick_start_fair(rq, p); | | update_misfit_status(p, rq); | sched_fair_update_stop_tick(rq, p); | } Is what it looks like here. Anyway, let me actually build it and try ;-)