From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 63FCC2AD0C for ; Fri, 30 Jan 2026 16:16:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769789776; cv=none; b=Ec7NvXtCQU6hEyrB4f3caSelOe+aONPL6QUwd6CqenCYQH8SYaYvbnIrjaU39js18NKws9BBsmR/dSI9qX0ApEgmkpcsdgBWE/W7RBUwwGrgz6eEOiB5YYxscC1H1K4/XFY6E+tttkxIieFrl/WYIgZmmoQPt5J8BWYMOJvJ6ig= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769789776; c=relaxed/simple; bh=SKMnTtfDDOsqdSl6WzUb7ikb8B+zwVPFlrdOrpA0kpU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=Bky0mjGhouVrzy61YJDdbwtimDj2Rhc4um4yrCAfFhwYShYtDN7seeo6WUb/d05yCbc64dTVxRkpsoJHyOQHKmMASVznz4mX8kfYuFoL9e7jbDerIm2Uq0Gm0x0z3GhyAUZfQQ3UcB9/duNrpGeNJ3od3X8Ep5xOt3OXKPH7M68= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FVe30GRE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FVe30GRE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77300C4CEF7; Fri, 30 Jan 2026 16:16:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769789776; bh=SKMnTtfDDOsqdSl6WzUb7ikb8B+zwVPFlrdOrpA0kpU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=FVe30GREevf2cUD3aaXK+kmWVMeLljGpXW+Iouz3rqlr7luu4lB8gNJcqfTGxdbHb aIghY3BgCI8G9jQSNAoSgkfUKg1+4lEcgpXwBqYyEWjLtwIgBZWx4mc2fk4tGcAFpw OBbBD9VzhAOjuh7joOAFJssBwxKqijliOfuK/OjWho6/u9jAnzR5dITNV3VXOXI7Hn b1IMOjpoyy/4fzyKqPMM7F21Tquo0DgOGiZZXPxmalAkOTV+jDMJmk7TnMyKOQNJmW 1OioAG/QC3adE5kKjNnNsGqm3/aqHx9+oVQF31krhdK3B4ChPBQ5IOYASKDultSqaR FU4ZxS3AJY6iQ== From: Thomas Gleixner To: Mathieu Desnoyers , LKML Cc: Ihor Solodrai , Shrikanth Hegde , Peter Zijlstra , Michael Jeanson Subject: Re: [patch 2/4] sched/mmcid: Protect transition on weakly ordered systems In-Reply-To: <54fc689c-fa9a-4e9d-9f5e-9dfd7da54a02@efficios.com> References: <20260129210219.452851594@kernel.org> <20260129211557.746946556@kernel.org> <54fc689c-fa9a-4e9d-9f5e-9dfd7da54a02@efficios.com> Date: Fri, 30 Jan 2026 17:16:12 +0100 Message-ID: <87zf5vjctv.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Fri, Jan 30 2026 at 10:36, Mathieu Desnoyers wrote: > On 2026-01-29 16:20, Thomas Gleixner wrote: > [...] >> >> -static void mm_cid_fixup_tasks_to_cpus(void) >> +static void mm_cid_do_fixup_tasks_to_cpus(struct mm_struct *mm) >> { >> - struct mm_struct *mm = current->mm; >> struct task_struct *p, *t; >> unsigned int users; >> >> @@ -10590,6 +10598,15 @@ static void mm_cid_fixup_tasks_to_cpus(v >> } >> } >> >> +static void mm_cid_fixup_tasks_to_cpus(void) >> +{ >> + struct mm_struct *mm = current->mm; >> + >> + mm_cid_do_fixup_tasks_to_cpus(mm); >> + /* Clear the transition bit in the mode */ >> + WRITE_ONCE(mm->mm_cid.mode, MM_CID_ONCPU); > > I'm missing something here. Why not just move this write once > to the end of cid_fixup_tasks_to_cpus ? Why the "do" wrapper > that has a single caller ? because do_fixup() has a pile of return points and the wrapper avoids the otherwise required goto mess.