Re: [PATCH] memremap: Fix NULL pointer BUG in get_zone_device_page()

From: Kani, Toshimitsu
Date: Wed Aug 24 2016 - 10:40:16 EST


On Tue, 2016-08-23 at 21:48 -0700, Dan Williams wrote:
> On Tue, Aug 23, 2016 at 9:28 PM, Kani, Toshimitsu <toshi.kani@xxxxxxx
> >
> > BTW, why does devm_memremap_pages() put a whole range to
> > pgmap_radix as device memory, but only initialize page->pgmap for
> > its data range?ÂÂIs there particular reason for this inconsistency?
>
> The radix tree is indexed by section number, but we don't always
> initialize a full section.ÂÂThe cases when we don't use a full
> section is when it overlaps device metadata, or if a platform
> multiplexes the device memory range with another resource within the
> same section.

I see, but I still feel odd about makingÂget_dev_pagemap() to work for
metadata, butÂget_page() ->Âget_zone_device_page() to crash like this.
Âfollow_devmap_pmd() assumes get_page() to work when get_dev_pagemap()
returns a valid pgmap...

Thanks,
-Toshi