All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@kernel.org>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	LKML <linux-kernel@vger.kernel.org>
Cc: Ihor Solodrai <ihor.solodrai@linux.dev>,
	Shrikanth Hegde <sshegde@linux.ibm.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Michael Jeanson <mjeanson@efficios.com>
Subject: Re: [patch 2/4] sched/mmcid: Protect transition on weakly ordered systems
Date: Fri, 30 Jan 2026 17:16:12 +0100	[thread overview]
Message-ID: <87zf5vjctv.ffs@tglx> (raw)
In-Reply-To: <54fc689c-fa9a-4e9d-9f5e-9dfd7da54a02@efficios.com>

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.

  reply	other threads:[~2026-01-30 16:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-29 21:20 [patch 0/4] sched/mmcid: Cure mode transition woes Thomas Gleixner
2026-01-29 21:20 ` [patch 1/4] sched/mmcid: Prevent live lock on task to CPU mode transition Thomas Gleixner
2026-01-30 15:24   ` Mathieu Desnoyers
2026-01-30 16:17     ` Thomas Gleixner
2026-01-29 21:20 ` [patch 2/4] sched/mmcid: Protect transition on weakly ordered systems Thomas Gleixner
2026-01-30 15:36   ` Mathieu Desnoyers
2026-01-30 16:16     ` Thomas Gleixner [this message]
2026-01-30 15:43   ` Mathieu Desnoyers
2026-01-30 18:50   ` Shrikanth Hegde
2026-01-30 18:58     ` Mathieu Desnoyers
2026-01-31  6:10       ` Shrikanth Hegde
2026-01-29 21:20 ` [patch 3/4] sched/mmcid: Drop per CPU CID immediately when switching to per task mode Thomas Gleixner
2026-01-30 15:38   ` Mathieu Desnoyers
2026-01-29 21:20 ` [patch 4/4] sched/mmcid: Optimize transitional CIDs when scheduling out Thomas Gleixner
2026-01-30 15:50   ` Mathieu Desnoyers
2026-01-30 16:13     ` Thomas Gleixner
2026-01-30 16:29       ` Mathieu Desnoyers
2026-01-30  0:20 ` [patch 0/4] sched/mmcid: Cure mode transition woes Ihor Solodrai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zf5vjctv.ffs@tglx \
    --to=tglx@kernel.org \
    --cc=ihor.solodrai@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mjeanson@efficios.com \
    --cc=peterz@infradead.org \
    --cc=sshegde@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.