lkml.org 
[lkml]   [2010]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] introduce sys_membarrier(): process-wide memory barrier
* Steven Rostedt (rostedt@goodmis.org) wrote:
> On Sat, 2010-01-09 at 18:05 -0500, Steven Rostedt wrote:
>
> > Then we should have O(tasks) for spinlocks taken, and
> > O(min(tasks, CPUS)) for IPIs.
> >
>
> And for nr tasks >> CPUS, this may help too:
>
> > cpumask = 0;
> > foreach task {
>
> if (cpumask == online_cpus)
> break;

This is not required with for_each_cpu(cpu, mm_cpumask(current->mm)),
because it only iterates on active cpus on which the current process
threads are scheduled.

Thanks,

Mathieu

>
> > spin_lock(task_rq(task)->rq->lock);
> > if (task_rq(task)->curr == task)
> > cpu_set(task_cpu(task), cpumask);
> > spin_unlock(task_rq(task)->rq->lock);
> > }
> > send_ipi(cpumask);
> >
>
> -- Steve
>
>

--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68


\
 
 \ /
  Last update: 2010-01-10 02:13    [W:0.551 / U:1.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site