@@ -979,7 +979,7 @@ partition_and_rebuild_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
979
979
* 'cpus' is removed, then call this routine to rebuild the
980
980
* scheduler's dynamic sched domains.
981
981
*
982
- * Call with cpuset_mutex held. Takes get_online_cpus ().
982
+ * Call with cpuset_mutex held. Takes cpus_read_lock ().
983
983
*/
984
984
static void rebuild_sched_domains_locked (void )
985
985
{
@@ -1040,11 +1040,11 @@ static void rebuild_sched_domains_locked(void)
1040
1040
1041
1041
void rebuild_sched_domains (void )
1042
1042
{
1043
- get_online_cpus ();
1043
+ cpus_read_lock ();
1044
1044
percpu_down_write (& cpuset_rwsem );
1045
1045
rebuild_sched_domains_locked ();
1046
1046
percpu_up_write (& cpuset_rwsem );
1047
- put_online_cpus ();
1047
+ cpus_read_unlock ();
1048
1048
}
1049
1049
1050
1050
/**
@@ -2288,7 +2288,7 @@ static int cpuset_write_u64(struct cgroup_subsys_state *css, struct cftype *cft,
2288
2288
cpuset_filetype_t type = cft -> private ;
2289
2289
int retval = 0 ;
2290
2290
2291
- get_online_cpus ();
2291
+ cpus_read_lock ();
2292
2292
percpu_down_write (& cpuset_rwsem );
2293
2293
if (!is_cpuset_online (cs )) {
2294
2294
retval = - ENODEV ;
@@ -2326,7 +2326,7 @@ static int cpuset_write_u64(struct cgroup_subsys_state *css, struct cftype *cft,
2326
2326
}
2327
2327
out_unlock :
2328
2328
percpu_up_write (& cpuset_rwsem );
2329
- put_online_cpus ();
2329
+ cpus_read_unlock ();
2330
2330
return retval ;
2331
2331
}
2332
2332
@@ -2337,7 +2337,7 @@ static int cpuset_write_s64(struct cgroup_subsys_state *css, struct cftype *cft,
2337
2337
cpuset_filetype_t type = cft -> private ;
2338
2338
int retval = - ENODEV ;
2339
2339
2340
- get_online_cpus ();
2340
+ cpus_read_lock ();
2341
2341
percpu_down_write (& cpuset_rwsem );
2342
2342
if (!is_cpuset_online (cs ))
2343
2343
goto out_unlock ;
@@ -2352,7 +2352,7 @@ static int cpuset_write_s64(struct cgroup_subsys_state *css, struct cftype *cft,
2352
2352
}
2353
2353
out_unlock :
2354
2354
percpu_up_write (& cpuset_rwsem );
2355
- put_online_cpus ();
2355
+ cpus_read_unlock ();
2356
2356
return retval ;
2357
2357
}
2358
2358
@@ -2391,7 +2391,7 @@ static ssize_t cpuset_write_resmask(struct kernfs_open_file *of,
2391
2391
kernfs_break_active_protection (of -> kn );
2392
2392
flush_work (& cpuset_hotplug_work );
2393
2393
2394
- get_online_cpus ();
2394
+ cpus_read_lock ();
2395
2395
percpu_down_write (& cpuset_rwsem );
2396
2396
if (!is_cpuset_online (cs ))
2397
2397
goto out_unlock ;
@@ -2417,7 +2417,7 @@ static ssize_t cpuset_write_resmask(struct kernfs_open_file *of,
2417
2417
free_cpuset (trialcs );
2418
2418
out_unlock :
2419
2419
percpu_up_write (& cpuset_rwsem );
2420
- put_online_cpus ();
2420
+ cpus_read_unlock ();
2421
2421
kernfs_unbreak_active_protection (of -> kn );
2422
2422
css_put (& cs -> css );
2423
2423
flush_workqueue (cpuset_migrate_mm_wq );
@@ -2548,15 +2548,15 @@ static ssize_t sched_partition_write(struct kernfs_open_file *of, char *buf,
2548
2548
return - EINVAL ;
2549
2549
2550
2550
css_get (& cs -> css );
2551
- get_online_cpus ();
2551
+ cpus_read_lock ();
2552
2552
percpu_down_write (& cpuset_rwsem );
2553
2553
if (!is_cpuset_online (cs ))
2554
2554
goto out_unlock ;
2555
2555
2556
2556
retval = update_prstate (cs , val );
2557
2557
out_unlock :
2558
2558
percpu_up_write (& cpuset_rwsem );
2559
- put_online_cpus ();
2559
+ cpus_read_unlock ();
2560
2560
css_put (& cs -> css );
2561
2561
return retval ?: nbytes ;
2562
2562
}
@@ -2762,7 +2762,7 @@ static int cpuset_css_online(struct cgroup_subsys_state *css)
2762
2762
if (!parent )
2763
2763
return 0 ;
2764
2764
2765
- get_online_cpus ();
2765
+ cpus_read_lock ();
2766
2766
percpu_down_write (& cpuset_rwsem );
2767
2767
2768
2768
set_bit (CS_ONLINE , & cs -> flags );
@@ -2815,7 +2815,7 @@ static int cpuset_css_online(struct cgroup_subsys_state *css)
2815
2815
spin_unlock_irq (& callback_lock );
2816
2816
out_unlock :
2817
2817
percpu_up_write (& cpuset_rwsem );
2818
- put_online_cpus ();
2818
+ cpus_read_unlock ();
2819
2819
return 0 ;
2820
2820
}
2821
2821
@@ -2834,7 +2834,7 @@ static void cpuset_css_offline(struct cgroup_subsys_state *css)
2834
2834
{
2835
2835
struct cpuset * cs = css_cs (css );
2836
2836
2837
- get_online_cpus ();
2837
+ cpus_read_lock ();
2838
2838
percpu_down_write (& cpuset_rwsem );
2839
2839
2840
2840
if (is_partition_root (cs ))
@@ -2855,7 +2855,7 @@ static void cpuset_css_offline(struct cgroup_subsys_state *css)
2855
2855
clear_bit (CS_ONLINE , & cs -> flags );
2856
2856
2857
2857
percpu_up_write (& cpuset_rwsem );
2858
- put_online_cpus ();
2858
+ cpus_read_unlock ();
2859
2859
}
2860
2860
2861
2861
static void cpuset_css_free (struct cgroup_subsys_state * css )
0 commit comments