@@ -65,14 +65,6 @@ static const char * const perr_strings[] = {
65
65
[PERR_ACCESS ] = "Enable partition not permitted" ,
66
66
};
67
67
68
- /*
69
- * Legacy hierarchy call to cgroup_transfer_tasks() is handled asynchrously
70
- */
71
- struct cpuset_remove_tasks_struct {
72
- struct work_struct work ;
73
- struct cpuset * cs ;
74
- };
75
-
76
68
/*
77
69
* Exclusive CPUs distributed out to sub-partitions of top_cpuset
78
70
*/
@@ -1144,7 +1136,7 @@ void rebuild_sched_domains(void)
1144
1136
* is used instead of effective_cpus to make sure all offline CPUs are also
1145
1137
* included as hotplug code won't update cpumasks for tasks in top_cpuset.
1146
1138
*/
1147
- static void update_tasks_cpumask (struct cpuset * cs , struct cpumask * new_cpus )
1139
+ void update_tasks_cpumask (struct cpuset * cs , struct cpumask * new_cpus )
1148
1140
{
1149
1141
struct css_task_iter it ;
1150
1142
struct task_struct * task ;
@@ -2597,7 +2589,7 @@ static void *cpuset_being_rebound;
2597
2589
* effective cpuset's. As this function is called with cpuset_mutex held,
2598
2590
* cpuset membership stays stable.
2599
2591
*/
2600
- static void update_tasks_nodemask (struct cpuset * cs )
2592
+ void update_tasks_nodemask (struct cpuset * cs )
2601
2593
{
2602
2594
static nodemask_t newmems ; /* protected by cpuset_mutex */
2603
2595
struct css_task_iter it ;
@@ -3936,90 +3928,6 @@ int __init cpuset_init(void)
3936
3928
return 0 ;
3937
3929
}
3938
3930
3939
- /*
3940
- * If CPU and/or memory hotplug handlers, below, unplug any CPUs
3941
- * or memory nodes, we need to walk over the cpuset hierarchy,
3942
- * removing that CPU or node from all cpusets. If this removes the
3943
- * last CPU or node from a cpuset, then move the tasks in the empty
3944
- * cpuset to its next-highest non-empty parent.
3945
- */
3946
- static void remove_tasks_in_empty_cpuset (struct cpuset * cs )
3947
- {
3948
- struct cpuset * parent ;
3949
-
3950
- /*
3951
- * Find its next-highest non-empty parent, (top cpuset
3952
- * has online cpus, so can't be empty).
3953
- */
3954
- parent = parent_cs (cs );
3955
- while (cpumask_empty (parent -> cpus_allowed ) ||
3956
- nodes_empty (parent -> mems_allowed ))
3957
- parent = parent_cs (parent );
3958
-
3959
- if (cgroup_transfer_tasks (parent -> css .cgroup , cs -> css .cgroup )) {
3960
- pr_err ("cpuset: failed to transfer tasks out of empty cpuset " );
3961
- pr_cont_cgroup_name (cs -> css .cgroup );
3962
- pr_cont ("\n" );
3963
- }
3964
- }
3965
-
3966
- static void cpuset_migrate_tasks_workfn (struct work_struct * work )
3967
- {
3968
- struct cpuset_remove_tasks_struct * s ;
3969
-
3970
- s = container_of (work , struct cpuset_remove_tasks_struct , work );
3971
- remove_tasks_in_empty_cpuset (s -> cs );
3972
- css_put (& s -> cs -> css );
3973
- kfree (s );
3974
- }
3975
-
3976
- static void
3977
- hotplug_update_tasks_legacy (struct cpuset * cs ,
3978
- struct cpumask * new_cpus , nodemask_t * new_mems ,
3979
- bool cpus_updated , bool mems_updated )
3980
- {
3981
- bool is_empty ;
3982
-
3983
- spin_lock_irq (& callback_lock );
3984
- cpumask_copy (cs -> cpus_allowed , new_cpus );
3985
- cpumask_copy (cs -> effective_cpus , new_cpus );
3986
- cs -> mems_allowed = * new_mems ;
3987
- cs -> effective_mems = * new_mems ;
3988
- spin_unlock_irq (& callback_lock );
3989
-
3990
- /*
3991
- * Don't call update_tasks_cpumask() if the cpuset becomes empty,
3992
- * as the tasks will be migrated to an ancestor.
3993
- */
3994
- if (cpus_updated && !cpumask_empty (cs -> cpus_allowed ))
3995
- update_tasks_cpumask (cs , new_cpus );
3996
- if (mems_updated && !nodes_empty (cs -> mems_allowed ))
3997
- update_tasks_nodemask (cs );
3998
-
3999
- is_empty = cpumask_empty (cs -> cpus_allowed ) ||
4000
- nodes_empty (cs -> mems_allowed );
4001
-
4002
- /*
4003
- * Move tasks to the nearest ancestor with execution resources,
4004
- * This is full cgroup operation which will also call back into
4005
- * cpuset. Execute it asynchronously using workqueue.
4006
- */
4007
- if (is_empty && cs -> css .cgroup -> nr_populated_csets &&
4008
- css_tryget_online (& cs -> css )) {
4009
- struct cpuset_remove_tasks_struct * s ;
4010
-
4011
- s = kzalloc (sizeof (* s ), GFP_KERNEL );
4012
- if (WARN_ON_ONCE (!s )) {
4013
- css_put (& cs -> css );
4014
- return ;
4015
- }
4016
-
4017
- s -> cs = cs ;
4018
- INIT_WORK (& s -> work , cpuset_migrate_tasks_workfn );
4019
- schedule_work (& s -> work );
4020
- }
4021
- }
4022
-
4023
3931
static void
4024
3932
hotplug_update_tasks (struct cpuset * cs ,
4025
3933
struct cpumask * new_cpus , nodemask_t * new_mems ,
0 commit comments