[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 1 of 2] Allow ACPI state change with active cpupools



>>> On 22.03.12 at 09:22, Juergen Gross <juergen.gross@xxxxxxxxxxxxxx> wrote:
> static void cpupool_cpu_add(unsigned int cpu)
> {
>+    struct cpupool **c;
>+
>     spin_lock(&cpupool_lock);
>     cpumask_clear_cpu(cpu, &cpupool_locked_cpus);
>     cpumask_set_cpu(cpu, &cpupool_free_cpus);
>+    if ( cpumask_test_cpu(cpu, &cpupool_free_offline_cpus) )
>+    {
>+        cpumask_clear_cpu(cpu, &cpupool_free_offline_cpus);

cpumask_test_and_clear_cpu()

>+        goto out;
>+    }
>+    for_each_cpupool(c)
>+    {
>+        if ( cpumask_test_cpu(cpu, (*c)->cpu_offline) )
>+        {
>+            cpumask_clear_cpu(cpu, (*c)->cpu_offline);

Here too.

>+            cpupool_assign_cpu_locked(*c, cpu);
>+            goto out;
>+        }
>+    }
>     cpupool_assign_cpu_locked(cpupool0, cpu);
>...
>+void cpupool_disable_cpu(unsigned int cpu)
>+{
>+    struct cpupool *c;
>+
>+    c = per_cpu(cpupool, cpu);
>+    if ( c == NULL )
>+    {
>+        cpumask_clear_cpu(cpu, &cpupool_free_cpus);
>+        cpumask_set_cpu(cpu, &cpupool_free_offline_cpus);
>+    }
>+    else if ( cpumask_test_cpu(cpu, c->cpu_valid) )
>+    {
>+        cpumask_clear_cpu(cpu, c->cpu_valid);

And once more.

>+        cpumask_set_cpu(cpu, c->cpu_offline);
>+    }
>+}

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.