Subject: [PATCH 26/38] livepatch: Replace deprecated CPU-hotplug functions.

The functions get_online_cpus() and put_online_cpus() have been
deprecated during the CPU hotplug rework. They map directly to
cpus_read_lock() and cpus_read_unlock().

Replace deprecated CPU-hotplug functions with the official version.
The behavior remains unchanged.

Cc: Josh Poimboeuf <[email protected]>
Cc: Jiri Kosina <[email protected]>
Cc: Miroslav Benes <[email protected]>
Cc: Petr Mladek <[email protected]>
Cc: Joe Lawrence <[email protected]>
Cc: [email protected]
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
---
kernel/livepatch/transition.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/livepatch/transition.c b/kernel/livepatch/transition.c
index 3a4beb9395c48..291b857a6e201 100644
--- a/kernel/livepatch/transition.c
+++ b/kernel/livepatch/transition.c
@@ -411,7 +411,7 @@ void klp_try_complete_transition(void)
/*
* Ditto for the idle "swapper" tasks.
*/
- get_online_cpus();
+ cpus_read_lock();
for_each_possible_cpu(cpu) {
task = idle_task(cpu);
if (cpu_online(cpu)) {
@@ -423,7 +423,7 @@ void klp_try_complete_transition(void)
task->patch_state = klp_target_state;
}
}
- put_online_cpus();
+ cpus_read_unlock();

if (!complete) {
if (klp_signals_cnt && !(klp_signals_cnt % SIGNALS_TIMEOUT))
--
2.32.0



2021-08-04 09:10:29

by Petr Mladek

[permalink] [raw]
Subject: Re: [PATCH 26/38] livepatch: Replace deprecated CPU-hotplug functions.

On Tue 2021-08-03 16:16:09, Sebastian Andrzej Siewior wrote:
> The functions get_online_cpus() and put_online_cpus() have been
> deprecated during the CPU hotplug rework. They map directly to
> cpus_read_lock() and cpus_read_unlock().
>
> Replace deprecated CPU-hotplug functions with the official version.
> The behavior remains unchanged.
>
> Cc: Josh Poimboeuf <[email protected]>
> Cc: Jiri Kosina <[email protected]>
> Cc: Miroslav Benes <[email protected]>
> Cc: Petr Mladek <[email protected]>
> Cc: Joe Lawrence <[email protected]>
> Cc: [email protected]
> Signed-off-by: Sebastian Andrzej Siewior <[email protected]>

Reviewed-by: Petr Mladek <[email protected]>

Best Regards,
Petr

2021-08-19 10:05:34

by Jiri Kosina

[permalink] [raw]
Subject: Re: [PATCH 26/38] livepatch: Replace deprecated CPU-hotplug functions.

On Wed, 4 Aug 2021, Petr Mladek wrote:

> > The functions get_online_cpus() and put_online_cpus() have been
> > deprecated during the CPU hotplug rework. They map directly to
> > cpus_read_lock() and cpus_read_unlock().
> >
> > Replace deprecated CPU-hotplug functions with the official version.
> > The behavior remains unchanged.
> >
> > Cc: Josh Poimboeuf <[email protected]>
> > Cc: Jiri Kosina <[email protected]>
> > Cc: Miroslav Benes <[email protected]>
> > Cc: Petr Mladek <[email protected]>
> > Cc: Joe Lawrence <[email protected]>
> > Cc: [email protected]
> > Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
>
> Reviewed-by: Petr Mladek <[email protected]>

As this doesn't seem to have been picked up yet, I've just applied it to
livepatching.git#for-5.15/cpu-hotplug

Thanks,

--
Jiri Kosina
SUSE Labs