From: Mike Rapoport <rppt@linux.ibm.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: Nicolas Pitre <nicolas.pitre@linaro.org>,
Doug Berger <opendmb@gmail.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Michal Hocko <mhocko@suse.com>,
Russell King <linux@armlinux.org.uk>,
"Steven Rostedt \(VMware\)" <rostedt@goodmis.org>,
linux-kernel@vger.kernel.org, Jinbum Park <jinb.park7@gmail.com>,
Mike Rapoport <rppt@linux.vnet.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ARM: mm: initialize pfn limits with find_limits()
Date: Mon, 21 Jan 2019 23:22:10 +0200 [thread overview]
Message-ID: <20190121212209.GA16047@rapoport-lnx> (raw)
In-Reply-To: <ab09bcea-a55d-e562-6637-0df909b03e22@gmail.com>
On Mon, Jan 21, 2019 at 12:48:09PM -0800, Florian Fainelli wrote:
> On 1/10/19 11:07 AM, Doug Berger wrote:
> > On 12/27/18 3:47 PM, Doug Berger wrote:
> >> The max_low_pfn value must be set before sparse_init() is called to
> >> keep the early memblock allocations and frees balanced for kmemleak
> >> initialization when sparsemem is enabled.
> >>
> >> This commit accomplishes that by replacing the local variables min,
> >> max_low, and max_high with the global limit variables min_low_pfn,
> >> max_low_pfn, and max_pfn respectively in bootmem_init(). The global
> >> variables are initialized directly by find_limits() and used in the
> >> remainder of the function.
> >>
> >> Fixes: 9099daed9c69 ("mm: kmemleak: avoid using __va() on addresses that don't have a lowmem mapping")
> >> Signed-off-by: Doug Berger <opendmb@gmail.com>
> >> ---
> >> arch/arm/mm/init.c | 20 ++++----------------
> >> 1 file changed, 4 insertions(+), 16 deletions(-)
> >>
> >> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
> >> index 32e4845af2b6..98a733f3a5b9 100644
> >> --- a/arch/arm/mm/init.c
> >> +++ b/arch/arm/mm/init.c
> >> @@ -302,15 +302,12 @@ void __init arm_memblock_init(const struct machine_desc *mdesc)
> >>
> >> void __init bootmem_init(void)
> >> {
> >> - unsigned long min, max_low, max_high;
> >> -
> >> memblock_allow_resize();
> >> - max_low = max_high = 0;
> >>
> >> - find_limits(&min, &max_low, &max_high);
> >> + find_limits(&min_low_pfn, &max_low_pfn, &max_pfn);
> >>
> >> - early_memtest((phys_addr_t)min << PAGE_SHIFT,
> >> - (phys_addr_t)max_low << PAGE_SHIFT);
> >> + early_memtest((phys_addr_t)min_low_pfn << PAGE_SHIFT,
> >> + (phys_addr_t)max_low_pfn << PAGE_SHIFT);
> >>
> >> /*
> >> * Sparsemem tries to allocate bootmem in memory_present(),
> >> @@ -328,16 +325,7 @@ void __init bootmem_init(void)
> >> * the sparse mem_map arrays initialized by sparse_init()
> >> * for memmap_init_zone(), otherwise all PFNs are invalid.
> >> */
> >> - zone_sizes_init(min, max_low, max_high);
> >> -
> >> - /*
> >> - * This doesn't seem to be used by the Linux memory manager any
> >> - * more, but is used by ll_rw_block. If we can get rid of it, we
> >> - * also get rid of some of the stuff above as well.
> >> - */
> >> - min_low_pfn = min;
> >> - max_low_pfn = max_low;
> >> - max_pfn = max_high;
> >> + zone_sizes_init(min_low_pfn, max_low_pfn, max_pfn);
> >> }
> >>
> >> /*
> >>
> >
> > Any feedback on this patch?
>
> Mike, Catalin, does this looks sensible to you? If so, should this be
> thrown into Russell's patch tracking system?
Makes perfect sense to me, so
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
> Thanks
> --
> Florian
>
--
Sincerely yours,
Mike.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2019-01-21 21:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-27 23:47 [PATCH] ARM: mm: initialize pfn limits with find_limits() Doug Berger
2019-01-10 19:07 ` Doug Berger
2019-01-21 20:48 ` Florian Fainelli
2019-01-21 21:22 ` Mike Rapoport [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=20190121212209.GA16047@rapoport-lnx \
--to=rppt@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=catalin.marinas@arm.com \
--cc=f.fainelli@gmail.com \
--cc=jinb.park7@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mhocko@suse.com \
--cc=nicolas.pitre@linaro.org \
--cc=opendmb@gmail.com \
--cc=rostedt@goodmis.org \
--cc=rppt@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).