[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100107150758.GA14259@Krystal>
Date: Thu, 7 Jan 2010 10:07:58 -0500
From: Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Josh Triplett <josh@...htriplett.org>,
Steven Rostedt <rostedt@...dmis.org>,
linux-kernel@...r.kernel.org,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Ingo Molnar <mingo@...e.hu>, akpm@...ux-foundation.org,
tglx@...utronix.de, Valdis.Kletnieks@...edu, dhowells@...hat.com,
laijs@...fujitsu.com, dipankar@...ibm.com
Subject: Re: [RFC PATCH] introduce sys_membarrier(): process-wide memory
barrier
* Peter Zijlstra (peterz@...radead.org) wrote:
> On Wed, 2010-01-06 at 22:35 -0800, Josh Triplett wrote:
> >
> > The number of threads doesn't matter nearly as much as the number of
> > threads typically running at a time compared to the number of
> > processors. Of course, we can't measure that as easily, but I don't
> > know that your proposed heuristic would approximate it well.
>
> Quite agreed, and not disturbing RT tasks is even more important.
>
> A simple:
>
> for_each_cpu(cpu, current->mm->cpu_vm_mask) {
> if (cpu_curr(cpu)->mm == current->mm)
> smp_call_function_single(cpu, func, NULL, 1);
> }
>
> seems far preferable over anything else, if you really want you can use
> a cpumask to copy cpu_vm_mask in and unset bits and use the mask with
> smp_call_function_any(), but that includes having to allocate the
> cpumask, which might or might not be too expensive for Mathieu.
>
I like this ! :)
Following some testing, I think I'll go with your scheme, with 2
smp_call_function_single (one function call for the local thread, one
IPI). If we need more than that, then we allocate a cpumask and call
smp_call_function_many() for the other cpus. I provide benchmarks in my
reply to Josh justifying this choice.
Thanks,
Mathieu
--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists