linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: David Rientjes <rientjes@google.com>
Cc: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>,
	"Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>,
	mingo@kernel.org, pjt@google.com, paul@paulmenage.org,
	akpm@linux-foundation.org, rjw@sisk.pl, nacc@us.ibm.com,
	paulmck@linux.vnet.ibm.com, tglx@linutronix.de,
	seto.hidetoshi@jp.fujitsu.com, tj@kernel.org,
	mschmidt@redhat.com, berrange@redhat.com,
	nikunj@linux.vnet.ibm.com, vatsa@linux.vnet.ibm.com,
	liuj97@gmail.com, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH v3 5/5] cpusets, suspend: Save and restore cpusets during suspend/resume
Date: Tue, 15 May 2012 22:10:53 +0200	[thread overview]
Message-ID: <1337112653.27694.110.camel@twins> (raw)
In-Reply-To: <alpine.DEB.2.00.1205151106490.24304@chino.kir.corp.google.com>

On Tue, 2012-05-15 at 11:31 -0700, David Rientjes wrote:

> However, if a thread did set_mempolicy(MPOL_BIND, 2-3) where cpuset.mems 
> == node_online_map, cpuset.mems changes to 0-1, then cpuset.mems changes 
> back to node_online_map, then I believe (and implemented in the mempolicy 
> code and added the specification in the man page) that the thread should 
> be bound to nodes 2-3.

I disagree, but alas that is done :-(

But what happens if you unplug nodes 2-3?

> > > I fixed this problem by introducing MPOL_F_* flags in set_mempolicy(2)
> > > by saving the user intended nodemask passed by set_mempolicy() and
> > > respecting it whenever allowed by cpusets.
> > 
> > So, if you read that thread, this is what (in essence) Srivatsa proposed
> > in v2. We store the user-defined cpumask and keep it regardless of
> > kernel decisions. We intersect the user-defined cpumask with the kernel
> > (which is really reflecting the administrator's hotplug decisions)
> > topology and run tasks in constrained cpusets on the result. We reflect
> > this decision in a new read-only file in each cpuset that indicates the
> > "actual" cpus that a task in a given cpuset may be scheduled on.
> > 
> 
> I don't think we need a new read-only file that exposes the stored 
> cpumask, I think it should be stored and respected when possible and the 
> set of allowed cpus be exported in the way it always has been, through 
> cpuset.cpus.

I agree we don't want the new file, I'm not sure what you mean with the
rest though.

> If a cpuset is defined to have cpuset.cpus == 2-3, cpu 3 is offlined, and 
> then cpu 3 is onlined, the behavior is currently undefined.  

Uhm, its documented to not restore 3. And changing this at this point
seems pointless, it doesn't solve Srivatsa's problem and is otherwise
pointless churn.

> You could 
> make the argument that cpusets is purely about NUMA and that cpu 3 may no 
> longer have affinity to cpuset.mems in which case I would agree that we 
> should not reset cpuset.cpus to 2-3 in this case.  But that doesn't seem 
> to be the motivation here because we keep talking about suspend.

The problem is that if you have some cpusets configuration and then do a
s/r cycle the entire configuration is wrecked because suspend
hot-unplugs all but cpu0 and resume re-plugs the cpus.

This destroys all masks and migrates all tasks in sets not including
cpu0 to the root set.

Srivatsa proposed to 'fix' this by remembering state of regular hotplug,
to which I strongly oppose, hotplug is destructive and should be,
there's no point in remembering state that might never be used again.
Worse you temporarily 'break' your cpuset 'promise' to then silently
restore it.

The s/r resume case is special in that userspace isn't actually around
to observe the cpus going away and coming back, also it has the
guarantee the cpus will be coming back.

So s/r is special and should not destroy state, hotplug should.

  reply	other threads:[~2012-05-15 20:11 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-13 23:14 [PATCH v3 0/5] CPU hotplug, cpusets: Fix issues with cpusets handling during suspend/resume Srivatsa S. Bhat
2012-05-13 23:15 ` [PATCH v3 1/5] cpusets, hotplug: Implement cpuset tree traversal in a helper function Srivatsa S. Bhat
2012-05-15  0:03   ` David Rientjes
2012-05-15 12:15     ` Srivatsa S. Bhat
2012-05-15 18:04       ` David Rientjes
2012-05-13 23:15 ` [PATCH v3 2/5] cpusets, hotplug: Restructure functions that are invoked during hotplug Srivatsa S. Bhat
2012-05-15  0:27   ` David Rientjes
2012-05-15 12:25     ` Srivatsa S. Bhat
2012-05-13 23:16 ` [PATCH v3 3/5] cpusets: Update tasks' cpus_allowed mask upon updates to root cpuset Srivatsa S. Bhat
2012-05-15  0:31   ` David Rientjes
2012-05-13 23:16 ` [PATCH v3 4/5] cpusets: Add provisions for distinguishing CPU Hotplug in suspend/resume path Srivatsa S. Bhat
2012-05-15  0:33   ` David Rientjes
2012-05-15 12:29     ` Srivatsa S. Bhat
2012-05-15 18:34       ` David Rientjes
2012-05-15 19:17         ` Srivatsa S. Bhat
2012-05-15 20:39           ` David Rientjes
2012-05-13 23:17 ` [PATCH v3 5/5] cpusets, suspend: Save and restore cpusets during suspend/resume Srivatsa S. Bhat
2012-05-15  0:37   ` David Rientjes
2012-05-15  1:40     ` Nishanth Aravamudan
2012-05-15  4:04       ` David Rientjes
2012-05-15  4:45         ` Nishanth Aravamudan
2012-05-15 18:31           ` David Rientjes
2012-05-15 20:10             ` Peter Zijlstra [this message]
2012-05-15 21:05               ` David Rientjes
2012-05-15 21:08                 ` Peter Zijlstra
2012-05-15 21:21                   ` Srivatsa S. Bhat
2012-05-15 21:24                     ` Peter Zijlstra
2012-05-15 21:24                   ` David Rientjes
2012-05-15 21:42                     ` Srivatsa S. Bhat
2012-05-15 21:49                       ` David Rientjes
2012-05-15 22:16                         ` Srivatsa S. Bhat
2012-05-15 22:32                           ` David Rientjes
2012-05-16  8:20                             ` Srivatsa S. Bhat
2012-05-16  8:42                               ` Srivatsa S. Bhat
2012-05-16 21:24                           ` Peter Zijlstra
2012-05-17  9:57                             ` Srivatsa S. Bhat
2012-05-15 21:13                 ` Peter Zijlstra
2012-05-15 21:37                   ` David Rientjes
2012-05-15  9:24       ` Srivatsa S. Bhat
2012-05-14 23:58 ` [PATCH v3 0/5] CPU hotplug, cpusets: Fix issues with cpusets handling " David Rientjes
2012-05-15 12:10   ` Srivatsa S. Bhat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1337112653.27694.110.camel@twins \
    --to=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=berrange@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=liuj97@gmail.com \
    --cc=mingo@kernel.org \
    --cc=mschmidt@redhat.com \
    --cc=nacc@linux.vnet.ibm.com \
    --cc=nacc@us.ibm.com \
    --cc=nikunj@linux.vnet.ibm.com \
    --cc=paul@paulmenage.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=pjt@google.com \
    --cc=rientjes@google.com \
    --cc=rjw@sisk.pl \
    --cc=seto.hidetoshi@jp.fujitsu.com \
    --cc=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=vatsa@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).