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 274AE39020C for ; Mon, 8 Jun 2026 08:02:40 +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=1780905764; cv=none; b=rSffiJrpGKL7HH3OwWgjlUBkAdyk/7hd30h8aMAOLKXtoeAraKHag7M645vjGdDbeQRLaNRoGwiCEAMDq9zJ8OofLLp9+0g1trjrZKQuHFu7fQ/isUWlLU8giR0fkgtgLKc5fjnvWj6V7kCsczy1l/iie2mtKrNCEiNCZl5O3e4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780905764; c=relaxed/simple; bh=Gby4BblvEPCcfK0u/Zbk3EzBVsVfHcM8c8THggO5gHo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sFUGPv9coZLA7MEWVdLoK0sVeKgbTi890G5uHZXgr7zRZ26r4ikzYeSnzr7ONjwA21BRldj4XhFsnh+H3truinqeD/azzTeHWb52q6JhilEBLroPwAVVKZddbwoGyVUmunOIBWIftYXCuj7jKX4jCUiJtHafPNEQiUxxOkCaAnQ= 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=XIkCtieE; 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="XIkCtieE" 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=iJGpzKTQgEVnzyCBmdBbtOFgF95zImnoLtSlbiokQcw=; b=XIkCtieEker5gDvLNWRp2/mYXY VP0803m6OdRKOcE5F6tkzRfku2dvmLC//kRLzSE8vuWmScpmqCPflini0AGvLcNVIXV4c3NSzUMa7 ojmeBdZGdborq1u7FPz513b4WuPivMo7mXbGVuzz07XfTp5TCIyf6Z+e1FO7URFptlJ7leYBQe5FI 5yTC+cHxC9UmbY1F0SDPBRRMaYXkzXC9HaKizNV2idVEBfQOvAVsCY1ZwmlaTSScJzpdbJfOt5EjZ ZxW9EhtYUaCKc705jxHr+GoHvy2KIxcuDWpqVG+iX3n7DEXzyB+IOPlXU2shIH2V2UV8v9DbaLzOk no0cOenA==; 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 1wWUwF-0000000DH93-3QFS; Mon, 08 Jun 2026 08:02:28 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id ECC5C30300D; Mon, 08 Jun 2026 10:01:56 +0200 (CEST) Date: Mon, 8 Jun 2026 10:01:56 +0200 From: Peter Zijlstra To: luoliang@kylinos.cn Cc: Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak , linux-kernel@vger.kernel.org Subject: Re: [PATCH] sched/deadline: Use task_on_rq_migrating() helper Message-ID: <20260608080156.GA3102624@noisy.programming.kicks-ass.net> References: <20260608065307.280995-1-luoliang@kylinos.cn> 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: <20260608065307.280995-1-luoliang@kylinos.cn> On Mon, Jun 08, 2026 at 02:53:07PM +0800, luoliang@kylinos.cn wrote: > 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. This is completely irrelevant here. p->on_rq is set with rq->lock held, and tasks are {en,de}queued with rq->lock held. There is no concurrency.