Skip to contentSkip to conversation

sched: Do not clear PF_NO_SETAFFINITY flag in select_fallback_rq()

PATCH In review Steven Rostedt 2 participants 2 messages Jul 1, 2014 – Feb 17, 2015 Scheduler

lore
Share & tools
lore

Steven Rostedt

author reviewer
#0 lore raw

PATCH 1/1 sched: Do not clear PF_NO_SETAFFINITY flag in select_fallback_rq()

I talked with Peter Zijlstra about this, and he told me that the clearing of the PF_NO_SETAFFINITY flag was to deal with the optimization of migrate_disable/enable() that ignores tasks that have that flag set. But that optimization was removed when I did a rework of the cpu hotplug code.

I found that ignoring tasks that had that flag set would cause those tasks to not sync with the hotplug code and cause the kernel to crash. Thus it needed to not treat them special and those tasks had to go though the same work as tasks without that flag set.

Now that those tasks are not treated special, there's no reason to clear the flag.

May still need to be tested as the migrate_me() code does not ignore those flags.

---

kernel/sched/core.c +0 -6
index ce80b93..352239e 100644
@@ -1393,12 +1393,6 @@ out:
 		}
 	}
 
-	/*
-	 * Clear PF_NO_SETAFFINITY, otherwise we wreckage
-	 * migrate_disable/enable. See optimization for
-	 * PF_NO_SETAFFINITY tasks there.
-	 */
-	p->flags &= ~PF_NO_SETAFFINITY;
 	return dest_cpu;
 }
 
#1 lore raw
Quoted 4 lines · * Steven Rostedt | 2014-07-01 11:14:44 [-0400]:

I talked with Peter Zijlstra about this, and he told me that the clearing of the PF_NO_SETAFFINITY flag was to deal with the optimization of migrate_disable/enable() that ignores tasks that have that flag set. But that optimization was removed when I did a rework of the cpu hotplug code.

This has been already applied. You took it into v3.14 and while applying the latest v3.14 patches it made its way into v3.18 as well.

Sebastian