On 10/09/2014 07:12 PM, Tadeusz Struk wrote:
> On 10/09/2014 02:42 PM, Prarit Bhargava wrote:
>>>> I don't think cpu hotplug matters here. This is one (probe) time
>>>> determination if the configuration is optimal or not and if it makes
>>>> sense to use this accelerator or not.
>> It absolutely matters.  num_online_cpus() *changes* depending on the # of 
>> cpus.
> 
> Sure, but I still think that we are safe here.
> 

No, you're not.  Dropping a single CPU changes num_online_cpus(), which results 
in

static uint8_t adf_get_dev_node_id(struct pci_dev *pdev)
{
        unsigned int bus_per_cpu = 0;
        struct cpuinfo_x86 *c = &cpu_data(num_online_cpus() - 1);  <<< this
being different.

        if (!c->phys_proc_id)
                return 0;

        bus_per_cpu = 256 / (c->phys_proc_id + 1);  <<< this being different

        if (bus_per_cpu != 0)
                return pdev->bus->number / bus_per_cpu; <<< and this being 
different
        return 0;
}

P.
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to