mbox series

[5.4,0/5] memblock, arm: fixes for freeing of the memory map

Message ID 20211213085710.28962-1-mark-pk.tsai@mediatek.com (mailing list archive)
Headers show
Series memblock, arm: fixes for freeing of the memory map | expand

Message

Mark-PK Tsai (蔡沛剛) Dec. 13, 2021, 8:57 a.m. UTC
When linux memory is not aligned with page block size and have hole in zone,
the 5.4-lts arm kernel might crash in move_freepages() as Kefen Wang reported in [1].
Backport the upstream fix commits by Mike Rapoport [2] to 5.4 can fix this issue.

And free_unused_memmap() of arm and arm64 are moved to generic mm/memblock in
the below upstream commit, so I applied the first two patches to free_unused_memmap()
in arch/arm/mm/init.c.

(4f5b0c178996 arm, arm64: move free_unused_memmap() to generic mm)

[1] https://lore.kernel.org/lkml/2a1592ad-bc9d-4664-fd19-f7448a37edc0@huawei.com/
[2] https://lore.kernel.org/lkml/20210630071211.21011-1-rppt@kernel.org/#t

Mike Rapoport (5):
  memblock: free_unused_memmap: use pageblock units instead of MAX_ORDER
  memblock: align freed memory map on pageblock boundaries with
    SPARSEMEM
  memblock: ensure there is no overflow in memblock_overlaps_region()
  arm: extend pfn_valid to take into account freed memory map alignment
  arm: ioremap: don't abuse pfn_valid() to check if pfn is in RAM

 arch/arm/mm/init.c    | 37 +++++++++++++++++++++++++------------
 arch/arm/mm/ioremap.c |  4 +++-
 mm/memblock.c         |  3 ++-
 3 files changed, 30 insertions(+), 14 deletions(-)

Comments

Greg Kroah-Hartman Dec. 13, 2021, 9:07 a.m. UTC | #1
On Mon, Dec 13, 2021 at 04:57:05PM +0800, Mark-PK Tsai wrote:
> When linux memory is not aligned with page block size and have hole in zone,
> the 5.4-lts arm kernel might crash in move_freepages() as Kefen Wang reported in [1].
> Backport the upstream fix commits by Mike Rapoport [2] to 5.4 can fix this issue.
> 
> And free_unused_memmap() of arm and arm64 are moved to generic mm/memblock in
> the below upstream commit, so I applied the first two patches to free_unused_memmap()
> in arch/arm/mm/init.c.
> 
> (4f5b0c178996 arm, arm64: move free_unused_memmap() to generic mm)
> 
> [1] https://lore.kernel.org/lkml/2a1592ad-bc9d-4664-fd19-f7448a37edc0@huawei.com/
> [2] https://lore.kernel.org/lkml/20210630071211.21011-1-rppt@kernel.org/#t
> 
> Mike Rapoport (5):
>   memblock: free_unused_memmap: use pageblock units instead of MAX_ORDER
>   memblock: align freed memory map on pageblock boundaries with
>     SPARSEMEM
>   memblock: ensure there is no overflow in memblock_overlaps_region()
>   arm: extend pfn_valid to take into account freed memory map alignment
>   arm: ioremap: don't abuse pfn_valid() to check if pfn is in RAM
> 
>  arch/arm/mm/init.c    | 37 +++++++++++++++++++++++++------------
>  arch/arm/mm/ioremap.c |  4 +++-
>  mm/memblock.c         |  3 ++-
>  3 files changed, 30 insertions(+), 14 deletions(-)
> 
> -- 
> 2.18.0
> 

These look like they also are required in 5.10.y as well, right?  Please
also provide a backported series for that tree, we can not have users
moving to a newer kernel version and having regressions.

I can't take this series until then, sorry.

thanks,

greg k-h
Greg Kroah-Hartman Dec. 15, 2021, 2:02 p.m. UTC | #2
On Mon, Dec 13, 2021 at 10:07:40AM +0100, Greg KH wrote:
> On Mon, Dec 13, 2021 at 04:57:05PM +0800, Mark-PK Tsai wrote:
> > When linux memory is not aligned with page block size and have hole in zone,
> > the 5.4-lts arm kernel might crash in move_freepages() as Kefen Wang reported in [1].
> > Backport the upstream fix commits by Mike Rapoport [2] to 5.4 can fix this issue.
> > 
> > And free_unused_memmap() of arm and arm64 are moved to generic mm/memblock in
> > the below upstream commit, so I applied the first two patches to free_unused_memmap()
> > in arch/arm/mm/init.c.
> > 
> > (4f5b0c178996 arm, arm64: move free_unused_memmap() to generic mm)
> > 
> > [1] https://lore.kernel.org/lkml/2a1592ad-bc9d-4664-fd19-f7448a37edc0@huawei.com/
> > [2] https://lore.kernel.org/lkml/20210630071211.21011-1-rppt@kernel.org/#t
> > 
> > Mike Rapoport (5):
> >   memblock: free_unused_memmap: use pageblock units instead of MAX_ORDER
> >   memblock: align freed memory map on pageblock boundaries with
> >     SPARSEMEM
> >   memblock: ensure there is no overflow in memblock_overlaps_region()
> >   arm: extend pfn_valid to take into account freed memory map alignment
> >   arm: ioremap: don't abuse pfn_valid() to check if pfn is in RAM
> > 
> >  arch/arm/mm/init.c    | 37 +++++++++++++++++++++++++------------
> >  arch/arm/mm/ioremap.c |  4 +++-
> >  mm/memblock.c         |  3 ++-
> >  3 files changed, 30 insertions(+), 14 deletions(-)
> > 
> > -- 
> > 2.18.0
> > 
> 
> These look like they also are required in 5.10.y as well, right?  Please
> also provide a backported series for that tree, we can not have users
> moving to a newer kernel version and having regressions.
> 
> I can't take this series until then, sorry.

Ah, now I see your 5.10 series, thanks.  I'll go queue both of these
series up now, thanks for the backports.

greg k-h