lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0giKO4y=LG9vWc2h+vHt0xr2EAyhQgd6u51vryihM4msw@mail.gmail.com>
Date:   Wed, 4 Aug 2021 20:27:11 +0200
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Peter Zijlstra <peterz@...radead.org>,
        "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Len Brown <lenb@...nel.org>,
        ACPI Devel Maling List <linux-acpi@...r.kernel.org>
Subject: Re: [PATCH 29/38] ACPI: processor: Replace deprecated CPU-hotplug functions.

On Tue, Aug 3, 2021 at 4:17 PM Sebastian Andrzej Siewior
<bigeasy@...utronix.de> wrote:
>
> The functions cpu_hotplug_begin, cpu_hotplug_done, get_online_cpus() and
> put_online_cpus() have been deprecated during the CPU hotplug rework. They map
> directly to cpus_write_lock(), cpus_write_unlock, cpus_read_lock() and
> cpus_read_unlock().
>
> Replace deprecated CPU-hotplug functions with the official version.
> The behavior remains unchanged.
>
> Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>
> Cc: Len Brown <lenb@...nel.org>
> Cc: linux-acpi@...r.kernel.org
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
> ---
>  drivers/acpi/acpi_pad.c       | 4 ++--
>  drivers/acpi/acpi_processor.c | 8 ++++----
>  drivers/acpi/processor_idle.c | 4 ++--
>  3 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c
> index df4adeb335b24..f45979aa2d648 100644
> --- a/drivers/acpi/acpi_pad.c
> +++ b/drivers/acpi/acpi_pad.c
> @@ -249,12 +249,12 @@ static void set_power_saving_task_num(unsigned int num)
>
>  static void acpi_pad_idle_cpus(unsigned int num_cpus)
>  {
> -       get_online_cpus();
> +       cpus_read_lock();
>
>         num_cpus = min_t(unsigned int, num_cpus, num_online_cpus());
>         set_power_saving_task_num(num_cpus);
>
> -       put_online_cpus();
> +       cpus_read_unlock();
>  }
>
>  static uint32_t acpi_pad_idle_cpus_num(void)
> diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c
> index 2d5bd2a6ddcef..6737b1cbf6d69 100644
> --- a/drivers/acpi/acpi_processor.c
> +++ b/drivers/acpi/acpi_processor.c
> @@ -182,7 +182,7 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr)
>                 return -ENODEV;
>
>         cpu_maps_update_begin();
> -       cpu_hotplug_begin();
> +       cpus_write_lock();
>
>         ret = acpi_map_cpu(pr->handle, pr->phys_id, pr->acpi_id, &pr->id);
>         if (ret)
> @@ -203,7 +203,7 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr)
>         pr->flags.need_hotplug_init = 1;
>
>  out:
> -       cpu_hotplug_done();
> +       cpus_write_unlock();
>         cpu_maps_update_done();
>         return ret;
>  }
> @@ -454,13 +454,13 @@ static void acpi_processor_remove(struct acpi_device *device)
>         per_cpu(processors, pr->id) = NULL;
>
>         cpu_maps_update_begin();
> -       cpu_hotplug_begin();
> +       cpus_write_lock();
>
>         /* Remove the CPU. */
>         arch_unregister_cpu(pr->id);
>         acpi_unmap_cpu(pr->id);
>
> -       cpu_hotplug_done();
> +       cpus_write_unlock();
>         cpu_maps_update_done();
>
>         try_offline_node(cpu_to_node(pr->id));
> diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
> index 095c8aca141eb..f37fba9e5ba0b 100644
> --- a/drivers/acpi/processor_idle.c
> +++ b/drivers/acpi/processor_idle.c
> @@ -1301,7 +1301,7 @@ int acpi_processor_power_state_has_changed(struct acpi_processor *pr)
>         if (pr->id == 0 && cpuidle_get_driver() == &acpi_idle_driver) {
>
>                 /* Protect against cpu-hotplug */
> -               get_online_cpus();
> +               cpus_read_lock();
>                 cpuidle_pause_and_lock();
>
>                 /* Disable all cpuidle devices */
> @@ -1330,7 +1330,7 @@ int acpi_processor_power_state_has_changed(struct acpi_processor *pr)
>                         }
>                 }
>                 cpuidle_resume_and_unlock();
> -               put_online_cpus();
> +               cpus_read_unlock();
>         }
>
>         return 0;
> --

Applied as 5.15 material, thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ