From nobody Mon Feb 9 16:18:12 2026 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 97B07329E5E for ; Fri, 30 Jan 2026 09:47:21 +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=1769766444; cv=none; b=kcev782Gf97wqhP/ZW3KyBlPkbYJ4nook/xWu02uHyHrhFgxLcn3NYQ5BpXfF8D0oGd3gb9ur6wJ68Z+yoK4IuPgVPgSQmIEL6zlyL9dy99tdtfZBugmNeHz4oNXtJSbMGMy8rKk8nRGH3Og7dJD9P5A6wS9mC5k6kEPGApZNdw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769766444; c=relaxed/simple; bh=5xEZmEBbkfegr2OGVKeKsdyevstNRSAUPMTM6/KoY+4=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=azHWdvgexB41Gq612YdlJsrQQZmiSo69FpDcfgIKnA7Q+Tac6ww35O7q7f9/LLsaTQKV8d97yFU8pFJVSBWOialKa4BkLnL88PIfHXDG/E5zdJ8r5fTlEYY1VmO8L1UEMgF6fCVUN5r80wZsQdMdHYXP9OUp3Qoll4f3e/z6YY8= 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=eZLz0LgJ; 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="eZLz0LgJ" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-ID:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=F7w+Q7+8/Rniw3Q2nYlILu+YaOhI5ezuUMSHbQvjRHQ=; b=eZLz0LgJl7Nl2sVExgyH77fAoo B4WHH0xudR26XkyQkOW5jKw9AnJFSt1D0VdJA1bSBYom9ArqFNwPR3jJsSWSmBOQubsYJ23lSdDc/ Moin99KyK6esCaCYhc+eCrteeCzwAF1OF4ricngQlxOXsEuQcHaCJ5VkDlICSwEn1iy0D0w1Bx5Cc 6pa639viLcXGlyb71NQix7s4SdHIlI1fdQ+wvQq9cSC880KK1C/Ee7xZyrsBgql15JhDAlUfQPGqj zs3WEofjWog4p3R8CupU2H+gSYh/MIAOO7gkCW/f2gSBzd4J2eNvTHyWR8PhbjqTPEY5m98qHXDB3 Ov1+lwjg==; 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.98.2 #2 (Red Hat Linux)) id 1vll5n-0000000BZrE-3KnB; Fri, 30 Jan 2026 09:47:08 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 0) id 311E8303323; Fri, 30 Jan 2026 10:47:06 +0100 (CET) Message-ID: <20260130094608.058761221@infradead.org> User-Agent: quilt/0.68 Date: Fri, 30 Jan 2026 10:34:41 +0100 From: Peter Zijlstra To: mingo@kernel.org Cc: peterz@infradead.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, linux-kernel@vger.kernel.org, wangtao554@huawei.com, quzicheng@huawei.com, kprateek.nayak@amd.com, wuyun.abel@bytedance.com, dsmythies@telus.net, Zhang Qiao Subject: [PATCH 2/4] sched/eevdf: Update se->vprot in reweight_entity() References: <20260130093439.803225718@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Wang Tao In the EEVDF framework with Run-to-Parity protection, `se->vprot` is an independent variable defining the virtual protection timestamp. When `reweight_entity()` is called (e.g., via nice/renice), it performs the following actions to preserve Lag consistency: 1. Scales `se->vlag` based on the new weight. 2. Calls `place_entity()`, which recalculates `se->vruntime` based on the new weight and scaled lag. However, the current implementation fails to update `se->vprot`, leading to mismatches between the task's actual runtime and its expected duration. Fixes: 63304558ba5d ("sched/eevdf: Curb wakeup-preemption") Suggested-by: Zhang Qiao Signed-off-by: Wang Tao Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/20260120123113.3518950-1-wangtao554@huawei.c= om Reviewed-by: Vincent Guittot --- kernel/sched/fair.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3790,6 +3790,8 @@ static void reweight_entity(struct cfs_r unsigned long weight) { bool curr =3D cfs_rq->curr =3D=3D se; + bool rel_vprot =3D false; + u64 vprot; =20 if (se->on_rq) { /* commit outstanding execution time */ @@ -3797,6 +3799,11 @@ static void reweight_entity(struct cfs_r update_entity_lag(cfs_rq, se); se->deadline -=3D se->vruntime; se->rel_deadline =3D 1; + if (curr && protect_slice(se)) { + vprot =3D se->vprot - se->vruntime; + rel_vprot =3D true; + } + cfs_rq->nr_queued--; if (!curr) __dequeue_entity(cfs_rq, se); @@ -3812,6 +3819,9 @@ static void reweight_entity(struct cfs_r if (se->rel_deadline) se->deadline =3D div_s64(se->deadline * se->load.weight, weight); =20 + if (rel_vprot) + vprot =3D div_s64(vprot * se->load.weight, weight); + update_load_set(&se->load, weight); =20 do { @@ -3823,6 +3833,8 @@ static void reweight_entity(struct cfs_r enqueue_load_avg(cfs_rq, se); if (se->on_rq) { place_entity(cfs_rq, se, 0); + if (rel_vprot) + se->vprot =3D se->vruntime + vprot; update_load_add(&cfs_rq->load, se->load.weight); if (!curr) __enqueue_entity(cfs_rq, se);