From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796402469; b=bBtZACpExp3CcsdtJXr6DWL9JzEm1efjAq/MThi8mNrFkdUd331vXO1b5SLaR1bzWv+Q sza07IkTL+J8sWJQ3mvwCej4xSwihkkQSoK4Am6AWLrl4yYoaWGfJCdYB5c448n8iKxdA UTcR0DEX1tQgEkDqBIxK9G1OPpGQzKE/gUQV4UInXq+JRGhGGLbOdHUtDmLB2w3gIMup5 qJEDbGYLEkHkYtBhPPzJas4Xb0lEMcBG62b2jay3CAgmRGlLC2Vg2x/uIwWMNbv7HRAid Z/WRXV+4yH4gJSW1h9h/96RtxkPGraCtauBMi9B4Fy2mXDfzh/mKVDVqTejH6nMo9Yw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796402469; h=Received:DKIM-Signature:Date:Message-ID:From:To:Cc:Subject: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=WmqEVJdOMwmjOry+7AGAUBBThgK8HtwCvtb/yd/fqzU=; b=rfHnvn2FcntMgnDfTLQG0+q2qHy5nS1pHtgkXB/EOaJYLTTfrZviRE6HgiwTL1LY+kCv bzEdmr6mOO5f49IDi0xyt1vd2rxZBne4Htj4BEeTjyzVwQ/CXO3xOVnuyxriPdduckgH8 qqfXk/pkcB0O/4BfFz5jrWQpmX6emxKAvrEjdVPzkPN2A2SsSkt0mJSerdZVyVp2DZ+br uV3SIAdtvNxF4RXB8B74QE2TVAqsDJr3iEqXHlLlQIzqtICEYTzYIha4uHfSZtgmv8ryj PUHhTicy+5ZFxI5V0Eqlm1rb/mO8YTOlywdzD91QnHJD/RHrj8VMCXZUdbLlMDCsxzw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=HNE576A7; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 18329606A32F; Fri, 4 Dec 2026 16:41:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=HNE576A7 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97CDD1F000C2; Fri, 4 Dec 2026 16:41:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796402468; bh=WmqEVJdOMwmjOry+7AGAUBBThgK8HtwCvtb/yd/fqzU=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=HNE576A7N7R34vgBP6W1waNHHz4aeM1/zS2q96pWK6pA/t88mq1tPeOuoMeEIjlDv pANS3B4VRo+jmzbsh/xsHVMHw6VOoPS//1paPEK+YdApij15R40p0aUiSaUi8xH2rL cXz8xKLABzAvhpG/OUibK99ocj1Xbj0c6smXX9t0ss/iPatvqc08ZJojYTEc2reC1A bV/NBw0q7heoZADZhPf/IWoBs7jhhDscobAhD06ZjXtLQweZW0oCg4NtXXunKmMI6U awVqjHF1OEtgnHki2nyweN9eH3dFlTVzZcwXQ/nJueYffSwB/HDYyj11M2n8Eh2KPG nu/9YOFCVv8Bw== Date: Fri, 04 Dec 2026 06:41:07 -1000 Message-ID: <96906389c03ade50969027c149e5ca32@kernel.org> From: Tejun Heo To: Hang Zhengyang Cc: David Vernet , Andrea Righi , Changwoo Min , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak , Cheng-Yang Chou , Barret Rhoden , Josh Don , Hao Luo , sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH sched_ext/for-7.4-fixes 0/2] sched_ext: Fix two races between fork and scx_post_fork() In-Reply-To: <20261204012744.195571-1-hang.zhengyang1010@gmail.com> References: <20261204012744.195571-1-hang.zhengyang1010@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello, Hang. On Fri, Dec 04, 2026 at 01:27:42AM +0000, Hang Zhengyang wrote: > Before scx_post_fork() runs, a new task can be reached by > sched_setscheduler() (patch 1, since v6.12) and by a cgroup migration to > another sub-scheduler (patch 2). Either can make ops.enable() run twice > or trip the task state check. Thanks for the fixes. Both changes look correct to me. A few style and documentation points: - The new comments mostly describe what the code does and not why. Can you update them to explain why? The one in switching_to_scx() is also difficult to follow. - 1/2: Can switched_from_scx() read the task state once and test that? - 2/2: scx_rehome_task() tests for the same condition as 1/2 but in a different style. Can you make it test the same way? Thanks. -- tejun