mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Local execution of ipi_sync_rq_state() on sync_runqueues_membarrier_state()
@ 2021-02-16 21:35 Nadav Amit
  2021-02-17 14:54 ` Mathieu Desnoyers
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nadav Amit @ 2021-02-16 21:35 UTC (permalink / raw)
  To: Mathieu Desnoyers; +Cc: LKML, Peter Zijlstra

Hello Mathieu,

While trying to find some unrelated by, something in
sync_runqueues_membarrier_state() caught my eye:


  static int sync_runqueues_membarrier_state(struct mm_struct *mm)
  {
        if (atomic_read(&mm->mm_users) == 1 || num_online_cpus() == 1) {
                this_cpu_write(runqueues.membarrier_state, membarrier_state);

                /*
                 * For single mm user, we can simply issue a memory barrier
                 * after setting MEMBARRIER_STATE_GLOBAL_EXPEDITED in the
                 * mm and in the current runqueue to guarantee that no memory
                 * access following registration is reordered before
                 * registration. 
                 */
                smp_mb();
                return 0;
        }

 [ snip ]

  	smp_call_function_many(tmpmask, ipi_sync_rq_state, mm, 1);


And ipi_sync_rq_state() does:

	this_cpu_write(runqueues.membarrier_state,
                       atomic_read(&mm->membarrier_state));


So my question: are you aware smp_call_function_many() would not run
ipi_sync_rq_state() on the local CPU? Is that the intention of the code?

Thanks,
Nadav

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-06 11:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-16 21:35 Local execution of ipi_sync_rq_state() on sync_runqueues_membarrier_state() Nadav Amit
2021-02-17 14:54 ` Mathieu Desnoyers
2021-03-01 10:16 ` [tip: sched/urgent] sched/membarrier: fix missing local execution of ipi_sync_rq_state() tip-bot2 for Mathieu Desnoyers
2021-03-06 11:42 ` [tip: sched/core] " tip-bot2 for Mathieu Desnoyers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome