All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pasha Tatashin <Pavel.Tatashin@microsoft.com>
To: Oscar Salvador <osalvador@techadventures.net>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>
Cc: "mhocko@suse.com" <mhocko@suse.com>,
	"dan.j.williams@intel.com" <dan.j.williams@intel.com>,
	"david@redhat.com" <david@redhat.com>,
	"Jonathan.Cameron@huawei.com" <Jonathan.Cameron@huawei.com>,
	"yasu.isimatu@gmail.com" <yasu.isimatu@gmail.com>,
	"malat@debian.org" <malat@debian.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Oscar Salvador <osalvador@suse.de>
Subject: Re: [PATCH 2/5] mm/memory_hotplug: Avoid node_set/clear_state(N_HIGH_MEMORY) when !CONFIG_HIGHMEM
Date: Thu, 20 Sep 2018 20:59:18 +0000	[thread overview]
Message-ID: <e66c7d55-7145-dd6c-4b11-27893ed7a7d0@microsoft.com> (raw)
In-Reply-To: <20180919100819.25518-3-osalvador@techadventures.net>



On 9/19/18 6:08 AM, Oscar Salvador wrote:
> From: Oscar Salvador <osalvador@suse.de>
> 
> Currently, when !CONFIG_HIGHMEM, status_change_nid_high is being set
> to status_change_nid_normal, but on such systems N_HIGH_MEMORY falls
> back to N_NORMAL_MEMORY.
> That means that if status_change_nid_normal is not -1,
> we will perform two calls to node_set_state for the same memory type.
> 
> Set status_change_nid_high to -1 for !CONFIG_HIGHMEM, so we skip the
> double call in node_states_set_node.
> 
> The same goes for node_clear_state.
> 
> Signed-off-by: Oscar Salvador <osalvador@suse.de>

Reviewed-by: Pavel Tatashin <pavel.tatashin@microsoft.com>

This is a rare case where I think comments are unnecessary as the code
is self explanatory. So, I would remove the comments before:

> +	arg->status_change_nid_high = -1;

Pavel

> ---
>  mm/memory_hotplug.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 63facfc57224..c2c7359bd0a7 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -731,7 +731,11 @@ static void node_states_check_changes_online(unsigned long nr_pages,
>  	else
>  		arg->status_change_nid_high = -1;
>  #else
> -	arg->status_change_nid_high = arg->status_change_nid_normal;
> +	/*
> +	 * When !CONFIG_HIGHMEM, N_HIGH_MEMORY equals N_NORMAL_MEMORY
> +	 * so setting the node for N_NORMAL_MEMORY is enough.
> +	 */
> +	arg->status_change_nid_high = -1;
>  #endif
>  
>  	/*
> @@ -1555,7 +1559,11 @@ static void node_states_check_changes_offline(unsigned long nr_pages,
>  	else
>  		arg->status_change_nid_high = -1;
>  #else
> -	arg->status_change_nid_high = arg->status_change_nid_normal;
> +	/*
> +	 * When !CONFIG_HIGHMEM, N_HIGH_MEMORY equals N_NORMAL_MEMORY
> +	 * so clearing the node for N_NORMAL_MEMORY is enough.
> +	 */
> +	arg->status_change_nid_high = -1;
>  #endif
>  
>  	/*
> 

  reply	other threads:[~2018-09-20 21:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-19 10:08 [PATCH 0/5] Refactor node_states_check_changes_online/offline Oscar Salvador
2018-09-19 10:08 ` [PATCH 1/5] mm/memory_hotplug: Spare unnecessary calls to node_set_state Oscar Salvador
2018-09-20 20:53   ` Pasha Tatashin
2018-09-19 10:08 ` [PATCH 2/5] mm/memory_hotplug: Avoid node_set/clear_state(N_HIGH_MEMORY) when !CONFIG_HIGHMEM Oscar Salvador
2018-09-20 20:59   ` Pasha Tatashin [this message]
2018-09-21 10:31     ` Oscar Salvador
2018-09-19 10:08 ` [PATCH 3/5] mm/memory_hotplug: Tidy up node_states_clear_node Oscar Salvador
2018-09-20 23:40   ` Pasha Tatashin
2018-09-19 10:08 ` [PATCH 4/5] mm/memory_hotplug: Simplify node_states_check_changes_online Oscar Salvador
2018-09-21  0:15   ` Pasha Tatashin
2018-09-21 10:30     ` Oscar Salvador
2018-09-19 10:08 ` [PATCH 5/5] mm/memory_hotplug: Clean up node_states_check_changes_offline Oscar Salvador
2018-09-21  0:38   ` Pasha Tatashin

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=e66c7d55-7145-dd6c-4b11-27893ed7a7d0@microsoft.com \
    --to=pavel.tatashin@microsoft.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=dan.j.williams@intel.com \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=malat@debian.org \
    --cc=mhocko@suse.com \
    --cc=osalvador@suse.de \
    --cc=osalvador@techadventures.net \
    --cc=yasu.isimatu@gmail.com \
    --subject='Re: [PATCH 2/5] mm/memory_hotplug: Avoid node_set/clear_state(N_HIGH_MEMORY) when '\!'CONFIG_HIGHMEM' \
    /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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.