linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: "Huangpeng (Peter)" <peter.huangpeng@huawei.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"mhocko@suse.cz" <mhocko@suse.cz>,
	"liwanp@linux.vnet.ibm.com" <liwanp@linux.vnet.ibm.com>,
	"n-horiguchi@ah.jp.nec.com" <n-horiguchi@ah.jp.nec.com>,
	"iamjoonsoo.kim@lge.com" <iamjoonsoo.kim@lge.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"Wulizhen (Pss)" <pss.wulizhen@huawei.com>
Subject: Re: [PATCH] mm:bugfix, pfn_valid sometimes return incorrect when memmap parameter specified
Date: Mon, 21 Jul 2014 15:46:14 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.02.1407211544280.29389@chino.kir.corp.google.com> (raw)
In-Reply-To: <615092B2FD0E7648B6E4B43E029BCFB852D66798@SZXEMA503-MBS.china.huawei.com>

On Mon, 21 Jul 2014, Huangpeng (Peter) wrote:

> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> index 835aa3d..c54284b 100644
> --- a/include/linux/mmzone.h
> +++ b/include/linux/mmzone.h
> @@ -1199,7 +1199,7 @@ static inline struct mem_section *__pfn_to_section(unsigned long pfn)
>  #ifndef CONFIG_HAVE_ARCH_PFN_VALID
>  static inline int pfn_valid(unsigned long pfn)
>  {
> - if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS)
> + if (pfn >= max_pfn || pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS)
>   return 0;
>   return valid_section(__nr_to_section(pfn_to_section_nr(pfn)));
>  }

Why should valid_section() return non-zero for sparsemem if it is above 
max_pfn?  (I think you're modifying the wrong function.)

Your patch is also whitespace damaged and cannot be applied, please see 
Documentation/SubmittingPatches which also references 
Documentation/email-clients.txt.

> diff --git a/mm/nobootmem.c b/mm/nobootmem.c
> index 04a9d94..7eb273e 100644
> --- a/mm/nobootmem.c
> +++ b/mm/nobootmem.c
> @@ -31,7 +31,7 @@ EXPORT_SYMBOL(contig_page_data);
>  unsigned long max_low_pfn;
>  unsigned long min_low_pfn;
>  unsigned long max_pfn;
> -
> +EXPORT_SYMBOL(max_pfn);
>  static void * __init __alloc_memory_core_early(int nid, u64 size, u64 align,
>   u64 goal, u64 limit)
>  {

This is an unrelated change.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2014-07-21 22:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-21  5:35 Huangpeng (Peter)
2014-07-21 22:46 ` David Rientjes [this message]

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=alpine.DEB.2.02.1407211544280.29389@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=liwanp@linux.vnet.ibm.com \
    --cc=mhocko@suse.cz \
    --cc=n-horiguchi@ah.jp.nec.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=pss.wulizhen@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