Re: [PATCH v3 5/5] cpusets, suspend: Save and restore cpusets duringsuspend/resume

From: David Rientjes
Date: Mon May 14 2012 - 20:37:51 EST


On Mon, 14 May 2012, Srivatsa S. Bhat wrote:

> diff --git a/kernel/cpuset.c b/kernel/cpuset.c
> index 0723183..671bf26 100644
> --- a/kernel/cpuset.c
> +++ b/kernel/cpuset.c
> @@ -93,6 +93,13 @@ struct cpuset {
>
> unsigned long flags; /* "unsigned long" so bitops work */
> cpumask_var_t cpus_allowed; /* CPUs allowed to tasks in cpuset */
> +
> + /*
> + * used to save cpuset's cpus_allowed mask during suspend and restore
> + * it during resume.
> + */
> + cpumask_var_t suspend_cpus_allowed;
> +
> nodemask_t mems_allowed; /* Memory Nodes allowed to tasks */
>
> struct cpuset *parent; /* my parent */

I see what you're doing with this and think it will fix the problem that
you're trying to address, but I think it could become much more general
to just the suspend case: if an admin sets a cpuset to have cpus 4-6, for
example, and cpu 5 goes offline, then I believe the cpuset should once
again become 4-6 if cpu 5 comes back online. So I think this should be
implemented like mempolicies are which save the user intended nodemask
that may become restricted by cpuset placement but will be rebound if the
cpuset includes the intended nodes.

If that's done, then it takes care of the suspend case as well and adds
generic cpu hotplug support, not just for suspend/resume.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/