linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Eugeniu Rosca <erosca@de.adit-jv.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Michal Hocko <mhocko@suse.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Steven Sistare <steven.sistare@oracle.com>,
	AKASHI Takahiro <takahiro.akashi@linaro.org>,
	Pavel Tatashin <pasha.tatashin@oracle.com>,
	Gioh Kim <gi-oh.kim@profitbricks.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Wei Yang <richard.weiyang@gmail.com>,
	Miles Chen <miles.chen@mediatek.com>,
	Vlastimil Babka <vbabka@suse.cz>, Mel Gorman <mgorman@suse.de>,
	Hillf Danton <hillf.zj@alibaba-inc.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Paul Burton <paul.burton@mips.com>,
	James Hartley <james.hartley@mips.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH v2 1/1] mm: page_alloc: skip over regions of invalid pfns on UMA
Date: Sun, 21 Jan 2018 17:21:56 -0800	[thread overview]
Message-ID: <20180122012156.GA10428@bombadil.infradead.org> (raw)
In-Reply-To: <20180121144753.3109-2-erosca@de.adit-jv.com>


I like the patch.  I think it could be better.

> +++ b/mm/page_alloc.c
> @@ -5344,7 +5344,7 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
>  			goto not_early;
>  
>  		if (!early_pfn_valid(pfn)) {
> -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
> +#ifdef CONFIG_HAVE_MEMBLOCK
>  			/*
>  			 * Skip to the pfn preceding the next valid one (or
>  			 * end_pfn), such that we hit a valid pfn (or end_pfn)

This ifdef makes me sad.  Here's more of the context:

                if (!early_pfn_valid(pfn)) {
#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
                        /*
                         * Skip to the pfn preceding the next valid one (or
                         * end_pfn), such that we hit a valid pfn (or end_pfn)
                         * on our next iteration of the loop.
                         */
                        pfn = memblock_next_valid_pfn(pfn, end_pfn) - 1;
#endif
                        continue;
                }

This is crying out for:

#ifdef CONFIG_HAVE_MEMBLOCK
unsigned long memblock_next_valid_pfn(unsigned long pfn, unsigned long max_pfn);
#else
static inline unsigned long memblock_next_valid_pfn(unsigned long pfn,
		unsigned long max_pfn)
{
	return pfn + 1;
}
#endif

in a header file somewhere.

  reply	other threads:[~2018-01-22  1:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-21 14:47 [PATCH v2 0/1] Skip over regions of invalid pfns with NUMA=n && HAVE_MEMBLOCK=y Eugeniu Rosca
2018-01-21 14:47 ` [PATCH v2 1/1] mm: page_alloc: skip over regions of invalid pfns on UMA Eugeniu Rosca
2018-01-22  1:21   ` Matthew Wilcox [this message]
2018-01-22 20:25     ` Eugeniu Rosca
2018-01-23  0:45       ` Matthew Wilcox
2018-01-23 19:00         ` Eugeniu Rosca
2018-01-23 20:27           ` Matthew Wilcox
2018-01-24 14:51             ` Eugeniu Rosca

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=20180122012156.GA10428@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=erosca@de.adit-jv.com \
    --cc=gi-oh.kim@profitbricks.com \
    --cc=hannes@cmpxchg.org \
    --cc=heiko.carstens@de.ibm.com \
    --cc=hillf.zj@alibaba-inc.com \
    --cc=james.hartley@mips.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@suse.com \
    --cc=miles.chen@mediatek.com \
    --cc=pasha.tatashin@oracle.com \
    --cc=paul.burton@mips.com \
    --cc=richard.weiyang@gmail.com \
    --cc=steven.sistare@oracle.com \
    --cc=takahiro.akashi@linaro.org \
    --cc=vbabka@suse.cz \
    /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).