From nobody Tue Apr 7 22:03:14 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 379B73B6BEE; Wed, 11 Mar 2026 11:04:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773227055; cv=none; b=aD+lcdFYStGv9S2UMVHuSg06+QxPUHvLdjBigADC6875wJLqSJY+Rsb/kbnZoj50re1lFSqLXyJuLwTFRKU+IEaUNHExFesGzKZS297RaUFNiLy7gfvcUeaSke3NEisf3Jp8Cwi/Yqoffy56NJm0LVdpVoM9Ny46y27oegI2qm4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773227055; c=relaxed/simple; bh=57mZmgXINyMv1H4tcTjm836RYb1Hw+zYpHht5jZViWo=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=XchfVBZZUW23VVdvhQl2aOuHtEWtrgl0gdALMviMfK18RtRa1EwQpT1uWosucTpEnlLlzKPW6o+zEiqIh9+1NzWFOBIGRv5B1a+RyBWLE765wt6hi8Ku1XkIlM7B5px4tnzK6lKCwyDbgmUEDfT3F9CQMU3PQ5DqVkt4pDsBJsU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=njUbpSWu; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=8OFmoNzR; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="njUbpSWu"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="8OFmoNzR" Date: Wed, 11 Mar 2026 11:04:08 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1773227051; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qWcsHlaqMcg33+0b+rMZX8VLjR4xDf5iYVWMiRYoeAo=; b=njUbpSWunGsEQZzWDw11UBiOeJmJQg4vkPmeDOpPc5Lf932BXuHkzrKmrDYpeukBpfbAZ5 2T2Q/9exvFg2kyrMOhn+4Q0g57O4B5u+xnpfo1p4s8eqHugqgBZn4InpyDpDjvA/sgbpuM /x2ZgG3Yic6uaEMORWDMYbFnpiIxK0Adi8RDHbQ0J8vJytvLCfkjYSHRxmiw7M84Af6h+A jZYn+H3SNF805V/lTBd6QVqm/XTOlweYRRmQr1YitXR5i7xDKgTiOwZvV6oDuOwSuFgq20 aSKO+ch9koI0ie82JnWEE3wSSBxmmJXZxaPduvJoUVKcn/Xfzj045ru3lrna8Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1773227051; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qWcsHlaqMcg33+0b+rMZX8VLjR4xDf5iYVWMiRYoeAo=; b=8OFmoNzRRQ76VdRrketew/9TFG7saqUoow3LBSqNW2ZdWDhmhpkQJqYmXB7uHfNCKR2ewp WYuPA7+9Wxd4giAw== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/urgent] sched/mmcid: Handle vfork()/CLONE_VM correctly Cc: Matthieu Baerts , Jiri Slaby , Thomas Gleixner , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260310202526.048657665@kernel.org> References: <20260310202526.048657665@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177322704826.1647592.7568481164740469130.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the sched/urgent branch of tip: Commit-ID: 28b5a1395036d6c7a6c8034d85ad3d7d365f192c Gitweb: https://git.kernel.org/tip/28b5a1395036d6c7a6c8034d85ad3d7d3= 65f192c Author: Thomas Gleixner AuthorDate: Tue, 10 Mar 2026 21:28:58 +01:00 Committer: Peter Zijlstra CommitterDate: Wed, 11 Mar 2026 12:01:06 +01:00 sched/mmcid: Handle vfork()/CLONE_VM correctly Matthieu and Jiri reported stalls where a task endlessly loops in mm_get_cid() when scheduling in. It turned out that the logic which handles vfork()'ed tasks is broken. It is invoked when the number of tasks associated to a process is smaller than the number of MMCID users. It then walks the task list to find the vfork()'ed task, but accounts all the already processed tasks as well. If that double processing brings the number of to be handled tasks to 0, the walk stops and the vfork()'ed task's CID is not fixed up. As a consequence a subsequent schedule in fails to acquire a (transitional) CID and the machine stalls. Cure this by removing the accounting condition and make the fixup always walk the full task list if it could not find the exact number of users in the process' thread list. Fixes: fbd0e71dc370 ("sched/mmcid: Provide CID ownership mode fixup functio= ns") Closes: https://lore.kernel.org/b24ffcb3-09d5-4e48-9070-0b69bc654281@kernel= .org Reported-by: Matthieu Baerts Reported-by: Jiri Slaby Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20260310202526.048657665@kernel.org --- kernel/sched/core.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index d254278..ee59cd1 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -10670,10 +10670,7 @@ static void mm_cid_do_fixup_tasks_to_cpus(struct m= m_struct *mm) for_each_process_thread(p, t) { if (t =3D=3D current || t->mm !=3D mm) continue; - if (mm_cid_fixup_task_to_cpu(t, mm)) { - if (--users =3D=3D 0) - return; - } + mm_cid_fixup_task_to_cpu(t, mm); } } =20