|
@@ -1381,7 +1381,7 @@ static void double_lock(spinlock_t *l1, spinlock_t *l2)
|
|
|
spin_lock_nested(l2, SINGLE_DEPTH_NESTING);
|
|
|
}
|
|
|
|
|
|
-static void task_numa_group(struct task_struct *p, int cpupid)
|
|
|
+static void task_numa_group(struct task_struct *p, int cpupid, int flags)
|
|
|
{
|
|
|
struct numa_group *grp, *my_grp;
|
|
|
struct task_struct *tsk;
|
|
@@ -1439,10 +1439,16 @@ static void task_numa_group(struct task_struct *p, int cpupid)
|
|
|
if (my_grp->nr_tasks == grp->nr_tasks && my_grp > grp)
|
|
|
goto unlock;
|
|
|
|
|
|
- if (!get_numa_group(grp))
|
|
|
- goto unlock;
|
|
|
+ /* Always join threads in the same process. */
|
|
|
+ if (tsk->mm == current->mm)
|
|
|
+ join = true;
|
|
|
+
|
|
|
+ /* Simple filter to avoid false positives due to PID collisions */
|
|
|
+ if (flags & TNF_SHARED)
|
|
|
+ join = true;
|
|
|
|
|
|
- join = true;
|
|
|
+ if (join && !get_numa_group(grp))
|
|
|
+ join = false;
|
|
|
|
|
|
unlock:
|
|
|
rcu_read_unlock();
|
|
@@ -1539,7 +1545,7 @@ void task_numa_fault(int last_cpupid, int node, int pages, int flags)
|
|
|
} else {
|
|
|
priv = cpupid_match_pid(p, last_cpupid);
|
|
|
if (!priv && !(flags & TNF_NO_GROUP))
|
|
|
- task_numa_group(p, last_cpupid);
|
|
|
+ task_numa_group(p, last_cpupid, flags);
|
|
|
}
|
|
|
|
|
|
/*
|