@@ -1882,7 +1882,7 @@ static void scan_for_empty_cpusets(const struct cpuset *root)
1882
1882
* in order to minimize text size.
1883
1883
*/
1884
1884
1885
- static void common_cpu_mem_hotplug_unplug (void )
1885
+ static void common_cpu_mem_hotplug_unplug (int rebuild_sd )
1886
1886
{
1887
1887
cgroup_lock ();
1888
1888
@@ -1894,7 +1894,8 @@ static void common_cpu_mem_hotplug_unplug(void)
1894
1894
* Scheduler destroys domains on hotplug events.
1895
1895
* Rebuild them based on the current settings.
1896
1896
*/
1897
- rebuild_sched_domains ();
1897
+ if (rebuild_sd )
1898
+ rebuild_sched_domains ();
1898
1899
1899
1900
cgroup_unlock ();
1900
1901
}
@@ -1912,11 +1913,22 @@ static void common_cpu_mem_hotplug_unplug(void)
1912
1913
static int cpuset_handle_cpuhp (struct notifier_block * unused_nb ,
1913
1914
unsigned long phase , void * unused_cpu )
1914
1915
{
1915
- if (phase == CPU_DYING || phase == CPU_DYING_FROZEN )
1916
+ switch (phase ) {
1917
+ case CPU_UP_CANCELED :
1918
+ case CPU_UP_CANCELED_FROZEN :
1919
+ case CPU_DOWN_FAILED :
1920
+ case CPU_DOWN_FAILED_FROZEN :
1921
+ case CPU_ONLINE :
1922
+ case CPU_ONLINE_FROZEN :
1923
+ case CPU_DEAD :
1924
+ case CPU_DEAD_FROZEN :
1925
+ common_cpu_mem_hotplug_unplug (1 );
1926
+ break ;
1927
+ default :
1916
1928
return NOTIFY_DONE ;
1929
+ }
1917
1930
1918
- common_cpu_mem_hotplug_unplug ();
1919
- return 0 ;
1931
+ return NOTIFY_OK ;
1920
1932
}
1921
1933
1922
1934
#ifdef CONFIG_MEMORY_HOTPLUG
@@ -1929,7 +1941,7 @@ static int cpuset_handle_cpuhp(struct notifier_block *unused_nb,
1929
1941
1930
1942
void cpuset_track_online_nodes (void )
1931
1943
{
1932
- common_cpu_mem_hotplug_unplug ();
1944
+ common_cpu_mem_hotplug_unplug (0 );
1933
1945
}
1934
1946
#endif
1935
1947
0 commit comments