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 A1FCD313E01 for ; Thu, 2 Apr 2026 13:43:01 +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=1775137383; cv=none; b=d72wC867dG3tgOf9+rKKWF/kMhxHJJmFBPIacjinGSOvYp0Kj3WETChO0ODiSL5uyx6SGeMwtB1lScp3mSwMPPuxpy5phOASrrGJ9p7EyWxuaOFf7j5nNTn35pC8CE5kNydNlVqSVVxgnUePxGY+i6rS37y9yNGaoBoRYHHdTc0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775137383; c=relaxed/simple; bh=WkCZS0cjTXo00W5l0AGCnKavt/82m2yNJNixlcJyE6c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CcL4MTNeNka39UboqsEKe1m5A9EDICx96l4qtulXHDB2ro9NGnnxhWTqPVW3rHclrwEfMVgKiSz9XKOlc9k72C/3Z2b7uQzE6wGvknwXRnWrpv1JxYOFAO7dFEi+74hevFbktG+e82UZ9iA0ARYOUkaExZLyd8bFiAejlEXq9h8= 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=ZwHLX0Dp; 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=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="ZwHLX0Dp" 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=NytpJe7z55mBhf9pwKLh7jwZ88H+jpIDWuoEpL2pPqg=; b=ZwHLX0DpFGNDGBAePyONP5BKYz WBlGWPEFDXqZpkxmN/6plgNOvW0TsbAWd7YrXhrxg23LmVy6jF4MslEUAD3ckLI/fevNT+uEW8KB6 NnAEks1ybYdUoXGuMprz9uBh+Kd/vl7TF766BQr3Nd/FOZRZyxEf8m9KxjVaan2HDEdm5LU50E2Vl fvADJ8gfGUJ+NaLtlpDxNC0QoO81CrixTtz2ZRFjPbNTjd9bztFAnJITPVv6adhyOYrmOKtToosZ0 Xs7TBTnUO0HT/A+YiFcQBTh0DfIt/6C5xqipxGEOV/q8Y5Cy2ojL1hydM7Cya6F+7jje17w/5TvkN PklbKqjw==; Received: from 2001-1c00-8d85-4b00-266e-96ff-fe07-7dcc.cable.dynamic.v6.ziggo.nl ([2001:1c00:8d85:4b00:266e:96ff:fe07:7dcc] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1w8IJy-00000002Zv7-2oMY; Thu, 02 Apr 2026 13:42:54 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 90D673005E5; Thu, 02 Apr 2026 15:42:53 +0200 (CEST) Date: Thu, 2 Apr 2026 15:42:53 +0200 From: Peter Zijlstra To: Vincent Guittot Cc: mingo@redhat.com, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, kprateek.nayak@amd.com, linux-kernel@vger.kernel.org, shubhang@os.amperecomputing.com Subject: Re: [PATCH v2] sched: fair: Prevent negative lag increase during delayed dequeue Message-ID: <20260402134253.GG3558198@noisy.programming.kicks-ass.net> References: <20260331162352.551501-1-vincent.guittot@linaro.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: <20260331162352.551501-1-vincent.guittot@linaro.org> On Tue, Mar 31, 2026 at 06:23:52PM +0200, Vincent Guittot wrote: > Delayed dequeue feature aims to reduce the negative lag of a dequeued task > while sleeping but it can happens that newly enqueued tasks will move > backward the avg vruntime and increase its negative lag. > When the delayed dequeued task wakes up, it has more neg lag compared to > being dequeued immediately or to other tasks that have been dequeued just > before theses new enqueues. > > Ensure that the negative lag of a delayed dequeued task doesn't increase > during its delayed dequeued phase while waiting for its neg lag to > diseappear. Similarly, we remove any positive lag that the delayed > dequeued task could have gain during thsi period. > > Short slice tasks are particularly impacted in overloaded system. > > Test on snapdragon rb5: > > hackbench -T -p -l 16000000 -g 2 1> /dev/null & > cyclictest -t 1 -i 2777 -D 333 --policy=fair --mlock -h 20000 -q > > The scheduling latency of cyclictest is: > > tip/sched/core tip/sched/core +this patch > cyclictest slice (ms) (default)2.8 8 8 > hackbench slice (ms) (default)2.8 20 20 > Total Samples | 115632 119733 119806 > Average (us) | 364 64(-82%) 61(- 5%) > Median (P50) (us) | 60 56(- 7%) 56( 0%) > 90th Percentile (us) | 1166 62(-95%) 62( 0%) > 99th Percentile (us) | 4192 73(-98%) 72(- 1%) > 99.9th Percentile (us) | 8528 2707(-68%) 1300(-52%) > Maximum (us) | 17735 14273(-20%) 13525(- 5%) > Anyway, I can confirm this works quite well. The latency-slice numbers are far more stable now. Thanks for digging into that!