----- On Jul 27, 2017, at 4:58 PM, Mathieu Desnoyers mathieu.desnoyers@xxxxxxxxxxxx wrote:
----- On Jul 27, 2017, at 4:37 PM, Paul E. McKenney paulmck@xxxxxxxxxxxxxxxxxx[...]
wrote:
On Thu, Jul 27, 2017 at 11:04:13PM +0300, Avi Kivity wrote:
Avi, is there an optimization that allows current->mm to be non-nullWould changing the check in this loop to:Good point! The battery-powered embedded guys would probably prefer+This gets you some false positives, if the CPU idled then mm will
+ this_cpu = raw_smp_processor_id();
+ for_each_online_cpu(cpu) {
+ struct task_struct *p;
+
+ if (cpu == this_cpu)
+ continue;
+ rcu_read_lock();
+ p = task_rcu_dereference(&cpu_rq(cpu)->curr);
+ if (p && p->mm == current->mm)
+ __cpumask_set_cpu(cpu, tmpmask);
not have changed.
we not needlessly IPI idle CPUs. We cannot rely on RCU's dyntick-idle
state in nohz_full cases. Not sure if is_idle_task() can be used
safely, given things like play_idle().
if (p && !is_idle_task(p) && p->mm == current->mm) {
work for you ?
when the idle task is scheduled that I am missing ?
I would have expected current->mm to be always NULL for idle
tasks.