Skip to content

Commit 135eef3

Browse files
Frederic Weisbeckerbp3tk0v
authored andcommitted
x86/resctrl: Use kthread_run_on_cpu()
Use the proper API instead of open coding it. Signed-off-by: Frederic Weisbecker <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Acked-by: Reinette Chatre <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent fac04ef commit 135eef3

File tree

1 file changed

+8
-20
lines changed

1 file changed

+8
-20
lines changed

arch/x86/kernel/cpu/resctrl/pseudo_lock.c

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,29 +1205,21 @@ static int pseudo_lock_measure_cycles(struct rdtgroup *rdtgrp, int sel)
12051205
plr->cpu = cpu;
12061206

12071207
if (sel == 1)
1208-
thread = kthread_create_on_node(measure_cycles_lat_fn, plr,
1209-
cpu_to_node(cpu),
1210-
"pseudo_lock_measure/%u",
1211-
cpu);
1208+
thread = kthread_run_on_cpu(measure_cycles_lat_fn, plr,
1209+
cpu, "pseudo_lock_measure/%u");
12121210
else if (sel == 2)
1213-
thread = kthread_create_on_node(measure_l2_residency, plr,
1214-
cpu_to_node(cpu),
1215-
"pseudo_lock_measure/%u",
1216-
cpu);
1211+
thread = kthread_run_on_cpu(measure_l2_residency, plr,
1212+
cpu, "pseudo_lock_measure/%u");
12171213
else if (sel == 3)
1218-
thread = kthread_create_on_node(measure_l3_residency, plr,
1219-
cpu_to_node(cpu),
1220-
"pseudo_lock_measure/%u",
1221-
cpu);
1214+
thread = kthread_run_on_cpu(measure_l3_residency, plr,
1215+
cpu, "pseudo_lock_measure/%u");
12221216
else
12231217
goto out;
12241218

12251219
if (IS_ERR(thread)) {
12261220
ret = PTR_ERR(thread);
12271221
goto out;
12281222
}
1229-
kthread_bind(thread, cpu);
1230-
wake_up_process(thread);
12311223

12321224
ret = wait_event_interruptible(plr->lock_thread_wq,
12331225
plr->thread_done == 1);
@@ -1315,18 +1307,14 @@ int rdtgroup_pseudo_lock_create(struct rdtgroup *rdtgrp)
13151307

13161308
plr->thread_done = 0;
13171309

1318-
thread = kthread_create_on_node(pseudo_lock_fn, rdtgrp,
1319-
cpu_to_node(plr->cpu),
1320-
"pseudo_lock/%u", plr->cpu);
1310+
thread = kthread_run_on_cpu(pseudo_lock_fn, rdtgrp,
1311+
plr->cpu, "pseudo_lock/%u");
13211312
if (IS_ERR(thread)) {
13221313
ret = PTR_ERR(thread);
13231314
rdt_last_cmd_printf("Locking thread returned error %d\n", ret);
13241315
goto out_cstates;
13251316
}
13261317

1327-
kthread_bind(thread, plr->cpu);
1328-
wake_up_process(thread);
1329-
13301318
ret = wait_event_interruptible(plr->lock_thread_wq,
13311319
plr->thread_done == 1);
13321320
if (ret < 0) {

0 commit comments

Comments
 (0)