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=1796404194; b=TcHeefKqpAueouOet/sCIo9CKKHqzr76dFBEkHiDk52AGwWx+I2U+x+Sy+AFSYK/O6+T V1bnB3+07/v71IucoZ3lPSH9JkQtyi5d1hzMjYtMcuOO6oUcHQ1PIUDRjQba5j4mffG07 YAC8NmxZctW199bZ1eERALHWOaNdIFDnTO59NDZkSzGNP801iQbBAezIA8kghoZOOS9dW MGXY4qZUZ0uoAiE/2yVXkQ3t0QxPiXhorgPb/quoqXBl35YSTxFVCuXqZgBBeY5NMOWaZ ibRIjBsENeb3kgj5T6M8j/GM34fmHDWM+dZ1+zFii8bsHOuuiEqGERx7a4tO2zDc1+A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796404194; h=Received:DKIM-Signature:Date:Message-ID:From:To:Cc:Subject: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=8mj0ANy8v0awuDz4sUUSMTfdgZkI7PoOYhbQckqjfiA=; b=Clw9Cjb6s599NeSqeaasGz6wUc5bC1qDWVXkKl+1KBCMxGIK0/nOUECDi3FBtfqK2BnO +3LMAX1joySz6Hd1qofGn5MqOkeOYKV0PrlBBHECENfhLM4r2PAvCiKGAo0pSTHJp1tyy qzpSAcIF7HhoQgU9B3RMMGoPIYZQdK5uBfCSq3VhRDesMwfFcJAbFl2N9DumRFK8p/ROd 62/CHD7kyntqGo5luChK/+2gAJQtwC+o/gU1fxo2eXnXV3pqDQDwePjbShtEi/2PGVGJG PKfIspcZnEyFwiUZCToSfdoGy9pFvLFyWx0YWUdWfHz44pG3LijYLUn7OE26B2fZYug== 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=EQd3jgpB; 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 B07E6606A322; Fri, 4 Dec 2026 17:09:54 +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=EQd3jgpB Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62AB21F0093B; Fri, 4 Dec 2026 17:09:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796404194; bh=8mj0ANy8v0awuDz4sUUSMTfdgZkI7PoOYhbQckqjfiA=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=EQd3jgpBvuaODXh/JpGcJKLGzfSlkrIBsUjkkw8xmf/wdYm+pwCQK6GK+KW1f8p1I 8iaEyWOhxkrs0QtIfA2elra4UvJePHeDhs0VmvHsC73vGCeSuZFgMuMqrcjJSxGWmf xHatvXG6DDKf+KuRn/tCW5A/QoOzz+WX+B47w7En51aydH5ILtbWfaZ5ozOaxv67/R v1w8FIeGDq3bMrYHrA9rlZ8y45FGkvSPq/5KyT3iIr0EOPWQEfZn7OY5xkXqU+gwW3 GZW+1ZqDRfUW1tut2uPcZbI5B0CaNENpBKahhUx4OIPCFcC001JHVMcfw0CwXPfFFL o5twSHw1ECJbA== Date: Fri, 04 Dec 2026 07:09:53 -1000 Message-ID: <03643694988c245d0cf8da3f7ee61680@kernel.org> From: Tejun Heo To: Changwoo Min Cc: void@manifault.com, arighi@nvidia.com, david.dai@linux.dev, Gavin Guo , kernel-dev@igalia.com, sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 5/8] sched_ext: Add p->scx.bpf_priv for O(1) task context lookup In-Reply-To: <20261203045618.982539-6-changwoo@igalia.com> References: <20261203045618.982539-1-changwoo@igalia.com> <20261203045618.982539-6-changwoo@igalia.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, Changwoo. On Thu, Dec 03, 2026 at 01:56:15PM +0900, Changwoo Min wrote: > + * From @p's own ops, ops.enable() included, @p can't leave the scheduler > + * concurrently. Elsewhere, e.g. from a timer or a tracing program, the write > + * can race @p leaving and outlive the clear, as with > + * scx_bpf_task_set_dsq_vtime(). Synchronizing such writes is the BPF > + * scheduler's responsibility. This seems problematic with sub-scheds. AFAICS, a write which races @p moving to another scheduler can land after the clear and leave the value on a task that the other scheduler now owns. The other scheduler would then take it for its own value, so e.g. a sub-sched can make its parent fail. We have kfuncs which can be called with or without the rq lock held and grab it as needed, e.g. scx_bpf_cpuperf_set(). Can scx_bpf_task_set_priv() follow the same style? Thanks. -- tejun