linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Kani, Toshimitsu" <toshi.kani@hpe.com>
To: "linux-mm@kvack.org" <linux-mm@kvack.org>,
	"mhocko@kernel.org" <mhocko@kernel.org>
Cc: "zhenzhang.zhang@huawei.com" <zhenzhang.zhang@huawei.com>,
	"tangchen@cn.fujitsu.com" <tangchen@cn.fujitsu.com>,
	"arbab@linux.vnet.ibm.com" <arbab@linux.vnet.ibm.com>,
	"vkuznets@redhat.com" <vkuznets@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"daniel.kiper@oracle.com" <daniel.kiper@oracle.com>,
	"xieyisheng1@huawei.com" <xieyisheng1@huawei.com>,
	"iamjoonsoo.kim@lge.com" <iamjoonsoo.kim@lge.com>,
	"qiuxishi@huawei.com" <qiuxishi@huawei.com>,
	"yasu.isimatu@gmail.com" <yasu.isimatu@gmail.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"aarcange@redhat.com" <aarcange@redhat.com>,
	"vbabka@suse.cz" <vbabka@suse.cz>,
	"imammedo@redhat.com" <imammedo@redhat.com>,
	"rientjes@google.com" <rientjes@google.com>,
	"mgorman@suse.de" <mgorman@suse.de>,
	"ak@linux.intel.com" <ak@linux.intel.com>,
	"slaoub@gmail.com" <slaoub@gmail.com>
Subject: Re: [RFC PATCH] rework memory hotplug onlining
Date: Wed, 15 Mar 2017 23:08:14 +0000	[thread overview]
Message-ID: <1489622542.9118.8.camel@hpe.com> (raw)
In-Reply-To: <20170315091347.GA32626@dhcp22.suse.cz>

On Wed, 2017-03-15 at 10:13 +0100, Michal Hocko wrote:
 :
> @@ -388,39 +389,44 @@ static ssize_t show_valid_zones(struct device
> *dev,
>  				struct device_attribute *attr, char
> *buf)
>  {
>  	struct memory_block *mem = to_memory_block(dev);
> -	unsigned long start_pfn, end_pfn;
> -	unsigned long valid_start, valid_end, valid_pages;
> -	unsigned long nr_pages = PAGES_PER_SECTION *
> sections_per_block;
> +	unsigned long start_pfn, nr_pages;
> +	bool append = false;
>  	struct zone *zone;
> -	int zone_shift = 0;
> +	int nid;
>  
>  	start_pfn = section_nr_to_pfn(mem->start_section_nr);
> -	end_pfn = start_pfn + nr_pages;
> +	zone = page_zone(pfn_to_page(start_pfn));
> +	nr_pages = PAGES_PER_SECTION * sections_per_block;
>  
> -	/* The block contains more than one zone can not be
> offlined. */
> -	if (!test_pages_in_a_zone(start_pfn, end_pfn, &valid_start,
> &valid_end))
> +	/*
> +	 * The block contains more than one zone can not be
> offlined.
> +	 * This can happen e.g. for ZONE_DMA and ZONE_DMA32
> +	 */
> +	if (!test_pages_in_a_zone(start_pfn, start_pfn + nr_pages,
> NULL, NULL))
>  		return sprintf(buf, "none\n");
>  
> -	zone = page_zone(pfn_to_page(valid_start));

Please do not remove the fix made in a96dfddbcc043. zone needs to be
set from valid_start, not from start_pfn.

Thanks,
-Toshi

  parent reply	other threads:[~2017-03-15 23:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-15  9:13 [RFC PATCH] rework memory hotplug onlining Michal Hocko
2017-03-15 10:48 ` Vitaly Kuznetsov
2017-03-15 12:29   ` ZONE_NORMAL vs. ZONE_MOVABLE (was: Re: [RFC PATCH] rework memory hotplug onlining) Michal Hocko
2017-03-15 12:53     ` ZONE_NORMAL vs. ZONE_MOVABLE Vitaly Kuznetsov
2017-03-15 13:11       ` Michal Hocko
2017-03-15 16:37         ` Andrea Arcangeli
2017-03-16  5:31           ` Joonsoo Kim
2017-03-16 19:01             ` Andrea Arcangeli
2017-03-17 10:25               ` Igor Mammedov
2017-03-20  6:33               ` Joonsoo Kim
2017-03-30  7:55                 ` Vlastimil Babka
2017-03-15 23:08 ` Kani, Toshimitsu [this message]
2017-03-16  8:54   ` [RFC PATCH] rework memory hotplug onlining Michal Hocko
2017-03-16 17:19     ` Kani, Toshimitsu
2017-03-16 17:40       ` Michal Hocko
2017-03-17 13:20 ` Michal Hocko
2017-03-21 14:09   ` Dan Williams

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=1489622542.9118.8.camel@hpe.com \
    --to=toshi.kani@hpe.com \
    --cc=aarcange@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=arbab@linux.vnet.ibm.com \
    --cc=daniel.kiper@oracle.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=imammedo@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@kernel.org \
    --cc=qiuxishi@huawei.com \
    --cc=rientjes@google.com \
    --cc=slaoub@gmail.com \
    --cc=tangchen@cn.fujitsu.com \
    --cc=vbabka@suse.cz \
    --cc=vkuznets@redhat.com \
    --cc=xieyisheng1@huawei.com \
    --cc=yasu.isimatu@gmail.com \
    --cc=zhenzhang.zhang@huawei.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).