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 914242E540C for ; Fri, 28 Nov 2025 08:32:29 +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=1764318752; cv=none; b=U1UPr5fFINjhoG7T+stmwkHJwPUvWt7CYWigwHeU3FYe2rEbyoy/huGWkbqadnd4dBm0hdS9wgGU8TUCpBLU0HAjznXY3K9lAxk4qUoj99bQegYPAbVfSgCpKWEaOZnd9NOx7/iVyXq4OV2mGva0eoOElg2htsnWVN9BZrr3Hh4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764318752; c=relaxed/simple; bh=SiAXvob3D2Ce5ogbcDP7pBXsQ3tDjVrtuq5DvSmT+BY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=g5BDEgjW09VoO2Rr5WMIxTMKGm9CqCweWozL2dSCL/7bihsCma5kEXoxqyfYK49lma7uyjdQPOMw0sM6jQhtxiu10tdAJM+lhiCr6s1l9825ZsCrp3CBBqmAb8/sgLLOZmCP3HV0+Of6kU+O+GhfCq5w+t9Eu7jCqzegiYeYuJ8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=l+wudR7C; 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=none 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="l+wudR7C" 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=iyPZSnfrN6XTOQLvTbrDDLOYzJX6wLJ0FYZ3Napt/xM=; b=l+wudR7CFjLCuv/gipcGFfbbzp dcFy3clsmbFbCzjQepgUZ+mW3sr6MgSpeDqSy7O3l4UBagZdGOG6nzK0/j23jBC91ui4Q909Jb+6+ b1FIvelKnpv+nja78OwBGnG+98UtR/XUfbEi+1sT0IE/TupLcXuEhxaQQlQzE2L6w0ySTWeno5AzS L3gpGFK7zgcSP1afTx4OkAYo7bTAebfqMkkDTPlQZPO2lSCT0QSPrOhEJFWf5eX7Sy3CSK+fzOM48 WIWHUXK4vWyUWIWzhePgixP4KjTfHX8VuaRiJwrYqRpEhcjXTCW1FC4YOC9uv+Uog9etxDLiAXYci QJE+zt+Q==; 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.98.2 #2 (Red Hat Linux)) id 1vOtts-0000000CwQe-3SkO; Fri, 28 Nov 2025 08:32:20 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 53403300230; Fri, 28 Nov 2025 09:32:20 +0100 (CET) Date: Fri, 28 Nov 2025 09:32:20 +0100 From: Peter Zijlstra To: K Prateek Nayak Cc: tglx@linutronix.de, arnd@arndb.de, anna-maria@linutronix.de, frederic@kernel.org, luto@kernel.org, mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, linux-kernel@vger.kernel.org, oliver.sang@intel.com Subject: Re: [PATCH 3/8] sched/eevdf: Fix HRTICK duration Message-ID: <20251128083220.GB3245006@noisy.programming.kicks-ass.net> References: <20250918075219.091828500@infradead.org> <20250918080205.716937764@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 Fri, Sep 19, 2025 at 09:04:02PM +0530, K Prateek Nayak wrote: > Hello Peter, > > On 9/18/2025 1:22 PM, Peter Zijlstra wrote: > > + /* > > + * Compute time until virtual deadline > > + */ > > + vdelta = se->deadline - se->vruntime; > > + if ((s64)vdelta < 0) { > > + if (task_current_donor(rq, p)) > > + resched_curr(rq); > > Why the task_current_donor() check? If the scheduling context has run > out of gas, shouldn't we reschedule curr even if we were proxied? task_current_donor() is the current scheduling context, right? So we've just determined that vruntime is ahead of deadline, which means we should reschedule now. > > + return; > > + } > > + delta = (se->load.weight * vdelta) / NICE_0_LOAD; > > + > > + /* > > + * Correct for instantaneous load of other classes. > > + */ > > + util += cpu_util_dl(rq); > > + util += cpu_util_rt(rq); > > + util += cpu_util_irq(rq); > > + if (util && util < 1024) { > > + scale *= 1024; > > + scale /= (1024 - util); > > } > > Could it be possible that we arrive here from the dl_server's pick and > end up inflating the HRTICK duration despite having an uninterrupted > period for fair tasks ahead? Yes, but since this is all approximation anyway, how many correction terms do we want to stack on top ? :-) > > + hrtick_start(rq, (scale * delta) / 1024); > > } > > > > /* > -- > Thanks and Regards, > Prateek >