Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (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 61C4736DA18 for ; Mon, 8 Jun 2026 06:53:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780901602; cv=none; b=KROoTJ8Qc3m2PdFyTfpY/mxXH0hJVYfW42GLnQKVihAZK0cxxHBayaZ6PnutuPhM5t0CIWdt10gBqC/KQVoDSIZ1oAM2N/5GgoplltY7TgLu5Ibj1itZRBr7a/IwcPhAlfnglLaBBO1Qdn5Oim91Y/95QyRb6z3EbeNcWWhl0KM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780901602; c=relaxed/simple; bh=oJJLVRZIdqTKQLBzxt0mW5mVK0WR+CxeNUnNWoOaLpI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=MNEer/UUfyOXkvQmhDrHnGO6Yj4/nM+jDTKhD+J45RvSPyeZ4UzRItzGGFSRsxs1n4gs4beKvH4N4mHmQbTdM9c+mlJBYn/VfO+nMjPkrWAemylydvq9MZyHpiDCBhGZHm5XMdoiUjt3xl1Vmtz8hTXVmZCW0+yzHnwbOivYs+8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: b7a960be630611f1aa26b74ffac11d73-20260608 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:90ef6ab0-6e6d-4e8c-a31c-04fbee009d91,IP:0,U RL:0,TC:0,Content:-5,EDM:25,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:20 X-CID-META: VersionHash:e7bac3a,CLOUDID:33b383cfb33671e03629759ec78d27bf,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:102|123|850|865|898,TC:nil,Content:0|15| 50,EDM:5,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0, OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: b7a960be630611f1aa26b74ffac11d73-20260608 X-User: luoliang@kylinos.cn Received: from localhost.localdomain [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 1550660879; Mon, 08 Jun 2026 14:53:12 +0800 From: luoliang@kylinos.cn To: Ingo Molnar , Peter Zijlstra Cc: Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak , linux-kernel@vger.kernel.org, Liang Luo Subject: [PATCH] sched/deadline: Use task_on_rq_migrating() helper Date: Mon, 8 Jun 2026 14:53:07 +0800 Message-Id: <20260608065307.280995-1-luoliang@kylinos.cn> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Liang Luo Replace the open-coded "p->on_rq == TASK_ON_RQ_MIGRATING" comparisons in enqueue_task_dl() and dequeue_task_dl() with the existing task_on_rq_migrating() helper, consistent with the rest of the scheduler code. The helper uses READ_ONCE() when loading ->on_rq, which was added by commit c546951d9c93 ("sched/core: Use READ_ONCE()/WRITE_ONCE() in move_queued_task()/task_rq_lock()") for LKMM compliance. As documented in that commit, move_queued_task() synchronizes with task_rq_lock(): move_queued_task() task_rq_lock() [S] ->on_rq = MIGRATING [L] rq = task_rq() WMB (__set_task_cpu()) ACQUIRE (rq->lock) [S] ->cpu = new_cpu [L] ->on_rq The READ_ONCE() on the ->on_rq load ensures proper pairing with the WRITE_ONCE() on the writer side. The open-coded checks in deadline.c lack this annotation. No functional change. Signed-off-by: Liang Luo --- kernel/sched/deadline.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index 7db4c87df83b..9d2c42b8661f 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -2335,7 +2335,7 @@ static void enqueue_task_dl(struct rq *rq, struct task_struct *p, int flags) check_schedstat_required(); update_stats_wait_start_dl(dl_rq_of_se(&p->dl), &p->dl); - if (p->on_rq == TASK_ON_RQ_MIGRATING) + if (task_on_rq_migrating(p)) flags |= ENQUEUE_MIGRATING; enqueue_dl_entity(&p->dl, flags); @@ -2354,7 +2354,7 @@ static bool dequeue_task_dl(struct rq *rq, struct task_struct *p, int flags) { update_curr_dl(rq); - if (p->on_rq == TASK_ON_RQ_MIGRATING) + if (task_on_rq_migrating(p)) flags |= DEQUEUE_MIGRATING; dequeue_dl_entity(&p->dl, flags); -- 2.25.1