From nobody Tue Dec 2 02:19:01 2025 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 C918A341068 for ; Wed, 19 Nov 2025 17:26:46 +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=1763573208; cv=none; b=HY32JNfp6QjnlzjUKK+a0jtqWY4uj26WYplGjoh8TZ9yuxeyXHA6jlJMaAs9fOZhHAgZXzf3ozn7Op4F10009xj2KjizQck7jlbLK6PlpYol0hJF7fX5n2xTMB6rYjNjYOeSrcp2LKtkLxCDhJo4WU9k2pQMuO1mpCgnDfIZCmc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763573208; c=relaxed/simple; bh=hjHgFWa13ERyvvguzSsrI4X12LmJfobcWjfBPQ294i4=; h=Message-ID:From:To:Cc:Subject:Date; b=UCyeA3GsHKwhJ6LNREILT2FCsOiTvyHGmt14d81nQKatpDddqYh8AKzAUAvYDB0uq/ATsCCTNg2UU3LL7P4EmpIQJrSFhUTggdwNzc4LwoPAOkiUeV3ntk4/DJ2UQhYpR958epHaRUDCqLQbTUhsmfh+2levhHlHte9wEv7sPrQ= 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=ZJriAHKa; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=dvtWV10j; 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="ZJriAHKa"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="dvtWV10j" Message-ID: <20251119171016.815482037@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1763573204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=umbvKFTqQvz/uDXrdQqPwezMztLA40BdY5V0CtvWxNA=; b=ZJriAHKa5F6lcJ2Xdn7/gIvBNTGt99NsyD3Zz/HpzuX2HtGMgDPVlvGHKjMt6dx7SIoxMF y83tl0cRuR9BSq/hA3gfuuf4jN/PRlsWeP1YWOUyg2nxUqdrG3aGqSdgGxdkNuv66cGyb8 yjXfsVwTysN6E6E3Y8JT4G6zrrLPcZNEqw2sF1SpCJ58Hz9EXRk4ftcCCa1SKEkZRYzrs/ DTDZZVFrqh5YUM13ITa0+4daQEmCksk5kykOulQ1tLG82AhQiGCKyESDZsMPMaghsE+nvu pRVt+RKKAMu2Zn4ejCnzEcLmbnw07GmPalYPZf+XkJRGqG4ZVizrdXCGuVr2hg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1763573204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=umbvKFTqQvz/uDXrdQqPwezMztLA40BdY5V0CtvWxNA=; b=dvtWV10jMRuWbNM13KopJ9yd4xaS+zBrPCZVSNap4Zf6QfQQiZA6+OK2FGvF6lUabe3RKk nQVlUr45SvtZtECw== From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Gabriele Monaco , Mathieu Desnoyers , Michael Jeanson , Jens Axboe , "Paul E. McKenney" , "Gautham R. Shenoy" , Florian Weimer , Tim Chen , Yury Norov , Shrikanth Hegde Subject: [patch V5 00/20] sched: Rewrite MM CID management Date: Wed, 19 Nov 2025 18:26:43 +0100 (CET) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This is a follow up on the V4 series which can be found here: https://lore.kernel.org/20251104075053.700034556@linutronix.de The V1 cover letter contains a detailed analyisis of the issues: https://lore.kernel.org/20251015164952.694882104@linutronix.de TLDR: The CID management is way to complex and adds significant overhead into scheduler hotpaths. The series rewrites MM CID management in a more simplistic way which focusses on low overhead in the scheduler while maintaining per task CIDs as long as the number of threads is not exceeding the number of possible CPUs. The series is based on the V6 series of the rseq rewrite: https://lore.kernel.org/20251027084220.785525188@linutronix.de which is also available from git: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/rseq The series on top of the tip core/rseq branch is available from git as well: git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git rseq/cid Changes vs. V4: - Zero mm_cid::transit on init - Mathieu - Rephrase change logs - Mathiue - Picked up Reviewed/Acked-by tags Delta patch to V4 below. Thanks, tglx --- diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 93a2523908c4..72f368f7d6e2 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -10848,6 +10848,7 @@ void mm_init_cid(struct mm_struct *mm, struct task_= struct *p) { mm->mm_cid.max_cids =3D 0; mm->mm_cid.percpu =3D 0; + mm->mm_cid.transit =3D 0; mm->mm_cid.nr_cpus_allowed =3D p->nr_cpus_allowed; mm->mm_cid.users =3D 0; mm->mm_cid.pcpu_thrs =3D 0;