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: <95c1590a-1645-ce0e-dea3-d8927bc97704@cn.fujitsu.com>
Date:   Thu, 15 Mar 2018 11:00:39 +0800
From:   Dou Liyang <douly.fnst@...fujitsu.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
CC:     ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Len Brown <lenb@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Artem Bityutskiy <dedekind1@...il.com>, <ming.lei@...hat.com>
Subject: Re: [RFC PATCH] ACPI / processor: Get accurate possible CPU count

Hi Andy,

At 03/15/2018 01:24 AM, Andy Shevchenko wrote:
> On Wed, Mar 14, 2018 at 12:28 PM, Dou Liyang <douly.fnst@...fujitsu.com> wrote:
> 
>> +static void __init acpi_update_possible_map(void)
>> +{
>> +       unsigned int cpu, nr = 0;
>> +
> 
>> +       if (nr_cpu_ids <= nr_unique_ids)
>> +               return;
>> +
>> +       for_each_possible_cpu(cpu) {
>> +               if (nr >= nr_unique_ids)
>> +                       set_cpu_possible(cpu, false);
>> +               nr++;
>> +       }
> 
> IIUC this can be optimized to:
> 

Yes, I agree, It's smarter and clearer. Will use it.

Thanks,
	dou

> if (nr_unique_ids >= nr_cpu_ids)
>      return;
> 
> /* Don't yet figure out if it's superfluous */
> if (nr_unique_ids >= cpumask_last(cpu_possible_mask))
>      return;
> 
> for_each_cpu_wrap(cpu, cpu_possible_mask, nr_unique_ids)
>      set_cpu_possible(cpu, false);
> 



>> +       nr_cpu_ids = nr_unique_ids;
>> +       pr_info("Allowing %d possible CPUs\n", nr_cpu_ids);
>> +}
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ