[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <efb11b1a-2f32-8a62-b7e3-bb89ead7a3eb@intel.com>
Date: Tue, 12 Nov 2024 14:00:16 -0800
From: Fenghua Yu <fenghua.yu@...el.com>
To: Frederic Weisbecker <frederic@...nel.org>, LKML
<linux-kernel@...r.kernel.org>
CC: Reinette Chatre <reinette.chatre@...el.com>, Ingo Molnar
<mingo@...hat.com>, Borislav Petkov <bp@...en8.de>, Dave Hansen
<dave.hansen@...ux.intel.com>, <x86@...nel.org>, "H. Peter Anvin"
<hpa@...or.com>, Andrew Morton <akpm@...ux-foundation.org>, Peter Zijlstra
<peterz@...radead.org>, Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 02/21] x86/resctrl: Use kthread_run_on_cpu()
On 11/12/24 06:22, Frederic Weisbecker wrote:
> Use the proper API instead of open coding it.
>
> Acked-by: Reinette Chatre <reinette.chatre@...el.com>
> Signed-off-by: Frederic Weisbecker <frederic@...nel.org>
Acked-by: Fenghua Yu <fenghua.yu@...el.com>
> ---
> arch/x86/kernel/cpu/resctrl/pseudo_lock.c | 28 +++++++----------------
> 1 file changed, 8 insertions(+), 20 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/resctrl/pseudo_lock.c b/arch/x86/kernel/cpu/resctrl/pseudo_lock.c
> index 972e6b6b0481..6c60c16a9dd0 100644
> --- a/arch/x86/kernel/cpu/resctrl/pseudo_lock.c
> +++ b/arch/x86/kernel/cpu/resctrl/pseudo_lock.c
> @@ -1205,20 +1205,14 @@ static int pseudo_lock_measure_cycles(struct rdtgroup *rdtgrp, int sel)
> plr->cpu = cpu;
>
> if (sel == 1)
> - thread = kthread_create_on_node(measure_cycles_lat_fn, plr,
> - cpu_to_node(cpu),
> - "pseudo_lock_measure/%u",
> - cpu);
> + thread = kthread_run_on_cpu(measure_cycles_lat_fn, plr,
> + cpu, "pseudo_lock_measure/%u");
> else if (sel == 2)
> - thread = kthread_create_on_node(measure_l2_residency, plr,
> - cpu_to_node(cpu),
> - "pseudo_lock_measure/%u",
> - cpu);
> + thread = kthread_run_on_cpu(measure_l2_residency, plr,
> + cpu, "pseudo_lock_measure/%u");
> else if (sel == 3)
> - thread = kthread_create_on_node(measure_l3_residency, plr,
> - cpu_to_node(cpu),
> - "pseudo_lock_measure/%u",
> - cpu);
> + thread = kthread_run_on_cpu(measure_l3_residency, plr,
> + cpu, "pseudo_lock_measure/%u");
> else
> goto out;
>
> @@ -1226,8 +1220,6 @@ static int pseudo_lock_measure_cycles(struct rdtgroup *rdtgrp, int sel)
> ret = PTR_ERR(thread);
> goto out;
> }
> - kthread_bind(thread, cpu);
> - wake_up_process(thread);
>
> ret = wait_event_interruptible(plr->lock_thread_wq,
> plr->thread_done == 1);
> @@ -1315,18 +1307,14 @@ int rdtgroup_pseudo_lock_create(struct rdtgroup *rdtgrp)
>
> plr->thread_done = 0;
>
> - thread = kthread_create_on_node(pseudo_lock_fn, rdtgrp,
> - cpu_to_node(plr->cpu),
> - "pseudo_lock/%u", plr->cpu);
> + thread = kthread_run_on_cpu(pseudo_lock_fn, rdtgrp,
> + plr->cpu, "pseudo_lock/%u");
> if (IS_ERR(thread)) {
> ret = PTR_ERR(thread);
> rdt_last_cmd_printf("Locking thread returned error %d\n", ret);
> goto out_cstates;
> }
>
> - kthread_bind(thread, plr->cpu);
> - wake_up_process(thread);
> -
> ret = wait_event_interruptible(plr->lock_thread_wq,
> plr->thread_done == 1);
> if (ret < 0) {
Thanks.
-Fenghua
Powered by blists - more mailing lists