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=1795989296; b=RjHO3RJQeTz00epz6sHKtcCffLWwnJuB18yZetKM7pamXJvP6b90IOso5U78k+658vBi yTH9Oo6G9zsgz8m4YXIGKy3VCIFhv4bLt/it9sKle6llgy9laZVwVY+yIFoI319gw3+TF 2Ok9OxEV3AwVzp3qU9pjQUreqjReBOksRACCkXRugpBT8RaddB4jm2g/Qo3U0Re/XpbC0 rhXKou2r2gYVKERR+sbbUxL0HgCr9EM7dVVyocj4KkOOIkQAsCGqTZNgI+oHnbJuA9Rli Ri5nF2qemKe0mwFwNmzWve3vAnYNO2xveImClKD6mvapUABpaOisIVBqOhU+vz9iMDQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795989296; h=Received:DKIM-Signature:From:To:Cc:Subject:In-Reply-To:References: Date:Message-ID:MIME-Version:Content-Type; bh=9wwrdzHOW/M73yv/zu6upM0fqX7cP9g+FY9W6o4CDnw=; b=L4/LykifEIy7KpDCbnZ7r1PD+OrPedJ5hdFlk/7GUtJPLn8UDEb7n0Qm6jdfSB/IERPG fCh+1gcakxw6I4Gd+pHuYlybgGz1/iCgHUKyDYWt6nX2jgMIuLi2mPUU9pjrUIC9fvAsh 5TlCjvjauAbHhjeZkBUwUfirhB7vZ6jxll88CDh/Rhns89ul1Age+3fAGqNA+KZOm2xNO gBgXo6vc/3cggj8y3aQhRzqlclPBXBgs0cHHrpFjUsDDgIIXMqFcnwlEbjt5Uq1a2u2Q1 NI96AdS2U8BE9bzc2buypG4XGK9Qt2h+8HbK8hspAUFfatwGAaPVZZISR2vaTsm+X0Q== 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="X0cI/Wl+"; 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 84B9D606A31C; Sun, 29 Nov 2026 21:54:56 +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=X0cI/Wl+ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B4EE1F000C1; Sun, 29 Nov 2026 21:54:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795989296; bh=9wwrdzHOW/M73yv/zu6upM0fqX7cP9g+FY9W6o4CDnw=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=X0cI/Wl+FkG2dnWkNZWpuGWsKe5etMrPEJ/eCmHJ9Fq3rRdS94+mxh+WFOnQfIG+k WT/0QwjQuEHOBIKlT1KwzqY6R1XfEom3NEVhOGTRKrlFvPFdKFDVVrcYCw1/bY55Sc 0ufWRR6tp1o48YxxvQgQrtQp3etproTqSvY86jd6e9CybFD2iZXFSAEyDBKyAOY4KF v7tRPvdpMxBYy0rqUwJ64TyEHQodZkjvSozdxQt5VL0J0+6BgOvAaN+COBqXwabyKL fzm1gnk4qwznvfKoFmAJ0xIQM0o9gYDwZhK5ZG4VV5IPPxfNKUb2S8yO/SZgdCSEod 79gawhRMdnSpg== From: Thomas Gleixner To: Mathieu Desnoyers , peterz@infradead.org Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, kprateek.nayak@amd.com, paulmck@kernel.org, boqun@kernel.org, shuah@kernel.org, kees@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, oleg@redhat.com, bestswngs@gmail.com, xmei5@asu.edu, xujiakai24@mails.ucas.ac.cn, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH 02/17] sched/mmcid: Give no concurrency ID to user workers In-Reply-To: <11039c504295ef6ee0eef55981993d8f5d1f40ce.1794932121.git.mathieu.desnoyers@efficios.com> References: <11039c504295ef6ee0eef55981993d8f5d1f40ce.1794932121.git.mathieu.desnoyers@efficios.com> Date: Sun, 29 Nov 2026 22:54:52 +0100 Message-ID: <87y0abqp5f.ffs@fw13> 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 On Tue, Nov 17 2026 at 11:17, Mathieu Desnoyers wrote: > The workers of io_uring and vhost are PF_USER_WORKER tasks. They are > threads of the process they work for, created with CLONE_VM. They only > run kernel code: copy_process() gives them a kernel function that ends > in do_exit(). They never return to user space and have no rseq area. > > sched_mm_cid_fork() still makes them users of the CIDs of the mm, like > every task with an mm. A worker takes a CID whenever it runs. It also > counts as a user for max_cids and for the switch to per CPU mode. > > Nothing reports the CID of a worker. But it is one CID fewer for the > threads of the process, which then get larger ones. The added users can > also switch the mm to per CPU mode. A process with io_uring workers > would then read mm_cid values at or above its number of threads. This > was found by reading the code, and has no test. > > Fix this by not making a user worker a user of the CIDs. Kernel threads > are already left out, as they have no mm. > > Fixes: af7f588d8f73 ("sched: Introduce per-memory-map concurrency ID") That's not a fix. That's an optimization and has zero impact on correctness. Thanks, tglx