linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
To: David Rientjes <rientjes@google.com>
Cc: a.p.zijlstra@chello.nl, mingo@kernel.org, pjt@google.com,
	paul@paulmenage.org, Andrew Morton <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 2/5] cpusets, hotplug: Restructure functions that are invoked during hotplug
Date: Tue, 15 May 2012 17:55:18 +0530	[thread overview]
Message-ID: <4FB24B2E.4010000@linux.vnet.ibm.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1205141705180.25235@chino.kir.corp.google.com>

On 05/15/2012 05:57 AM, David Rientjes wrote:

> On Mon, 14 May 2012, Srivatsa S. Bhat wrote:
> 
>> Separate out the cpuset related handling for CPU/Memory online/offline.
>> This also helps us exploit the most obvious and basic level of optimization
>> that any notification mechanism (CPU/Mem online/offline) has to offer us:
>> "We *know* why we have been invoked. So stop pretending that we are lost,
>> and do only the necessary amount of processing!".
>>
>> And while at it, rename scan_for_empty_cpusets() to
>> scan_cpusets_upon_hotplug(), which will be more appropriate, considering
>> the upcoming changes.
>>
> 
> If it's more appropriate in upcoming changes, then change it in the 
> upcoming changes that make it more appropriate?
> 


Well, I wanted to split out the core of the fix from the rest of the cleanup,
so that the fix patch can be more focussed, thereby easing review.

And I think renaming this function is more of a noise, when compared with the
fix being implemented in the later patches.. So I thought I'll get it out of
the way by doing it here itself.

Moreover, that renaming is justified in this patch itself, IMHO.. It doesn't
really have to wait till the later ones, because considering the restructuring
that this patch does, the renaming is in order too..

>> Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
>> Cc: stable@vger.kernel.org
>> ---
[...]
>> +
>> +	case CPUSET_MEM_OFFLINE:
>> +		while (!list_empty(&queue)) {
>> +			cp = traverse_cpusets(&queue);
>> +
>> +			/* Continue past cpusets with all mems online */
>> +			if (nodes_subset(cp->mems_allowed,
>> +					node_states[N_HIGH_MEMORY]))
>> +				continue;
>> +
>> +			oldmems = cp->mems_allowed;
>> +
>> +			/* Remove offline mems from this cpuset. */
>> +			mutex_lock(&callback_mutex);
>> +			nodes_and(cp->mems_allowed, cp->mems_allowed,
>>  						node_states[N_HIGH_MEMORY]);
>> -		mutex_unlock(&callback_mutex);
>> +			mutex_unlock(&callback_mutex);
>>  
>> -		/* Move tasks from the empty cpuset to a parent */
>> -		if (cpumask_empty(cp->cpus_allowed) ||
>> -		     nodes_empty(cp->mems_allowed))
>> -			remove_tasks_in_empty_cpuset(cp);
>> -		else {
>> -			update_tasks_cpumask(cp, NULL);
>> -			update_tasks_nodemask(cp, &oldmems, NULL);
>> +			/* Move tasks from the empty cpuset to a parent */
>> +			if (nodes_empty(cp->mems_allowed))
>> +				remove_tasks_in_empty_cpuset(cp);
>> +			else
>> +				update_tasks_nodemask(cp, &oldmems, NULL);
>>  		}
>>  	}
>>  }
> 
> This looks like a good optimization, but the existing comment for 
> scan_for_empty_cpusets() is wrong: we certainly do not lack memory 
> hot-unplug and it will remove nodes from N_HIGH_MEMORY if all present 
> pages from a node are offlined.  I had a patch that emulated node 
> hot-remove on x86 and this worked fine.  So perhaps update that existing 
> comment as well (not shown in this diff)?
> 


Sure, will do.

> Otherwise, looks good.


Thanks a lot!
 
Regards,
Srivatsa S. Bhat


  reply	other threads:[~2012-05-15 12:26 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 [this message]
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
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=4FB24B2E.4010000@linux.vnet.ibm.com \
    --to=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=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@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=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).