Message ID | 1570915861-17633-1-git-send-email-rppt@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | mm: memblock: do not enforce current limit for memblock_phys* family | expand |
On Sun, 13 Oct 2019 00:31:01 +0300 Mike Rapoport <rppt@kernel.org> wrote: > Until commit 92d12f9544b7 ("memblock: refactor internal allocation > functions") the maximal address for memblock allocations was forced to > memblock.current_limit only for the allocation functions returning virtual > address. The changes introduced by that commit moved the limit enforcement > into the allocation core and as a result the allocation functions returning > physical address also started to limit allocations to > memblock.current_limit. > > This caused breakage of etnaviv GPU driver: > > ... > So I'll add a cc:stable, yes?
On October 15, 2019 12:44:23 AM GMT+02:00, Andrew Morton <akpm@linux-foundation.org> wrote: >On Sun, 13 Oct 2019 00:31:01 +0300 Mike Rapoport <rppt@kernel.org> >wrote: > >> Until commit 92d12f9544b7 ("memblock: refactor internal allocation >> functions") the maximal address for memblock allocations was forced >to >> memblock.current_limit only for the allocation functions returning >virtual >> address. The changes introduced by that commit moved the limit >enforcement >> into the allocation core and as a result the allocation functions >returning >> physical address also started to limit allocations to >> memblock.current_limit. >> >> This caused breakage of etnaviv GPU driver: >> >> ... >> > >So I'll add a cc:stable, yes? Yeah, right. Somehow I've missed that...
diff --git a/mm/memblock.c b/mm/memblock.c index 7d4f61a..c4b16ca 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -1356,9 +1356,6 @@ static phys_addr_t __init memblock_alloc_range_nid(phys_addr_t size, align = SMP_CACHE_BYTES; } - if (end > memblock.current_limit) - end = memblock.current_limit; - again: found = memblock_find_in_range_node(size, align, start, end, nid, flags); @@ -1469,6 +1466,9 @@ static void * __init memblock_alloc_internal( if (WARN_ON_ONCE(slab_is_available())) return kzalloc_node(size, GFP_NOWAIT, nid); + if (max_addr > memblock.current_limit) + max_addr = memblock.current_limit; + alloc = memblock_alloc_range_nid(size, align, min_addr, max_addr, nid); /* retry allocation without lower limit */