Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-12 Thread Florian Fainelli
On 11/7/20 7:22 AM, Stefan Agner wrote: > Most architectures define MAX_PHYSMEM_BITS in asm/sparsemem.h and don't > include it in asm/pgtable.h. Include asm/sparsemem.h directly to get > the MAX_PHYSMEM_BITS define on all architectures. > > This fixes a crash when accessing zram on 32-bit ARM

Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-12 Thread Minchan Kim
On Wed, Nov 11, 2020 at 03:33:18PM +0100, Arnd Bergmann wrote: > On Wed, Nov 11, 2020 at 2:39 PM Thomas Bogendoerfer > wrote: > > On Wed, Nov 11, 2020 at 11:57:02AM +0100, Arnd Bergmann wrote: > > > On Wed, Nov 11, 2020 at 11:26 AM Mike Rapoport wrote: > > > > > > > > On Wed, Nov 11, 2020 at

Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-12 Thread Minchan Kim
Hi, On Wed, Nov 11, 2020 at 08:52:00AM +0200, Mike Rapoport wrote: > Hi, > > On Tue, Nov 10, 2020 at 03:36:20PM -0800, Minchan Kim wrote: > > On Tue, Nov 10, 2020 at 06:21:55PM +0200, Mike Rapoport wrote: > > > On Tue, Nov 10, 2020 at 12:21:11PM +0100, Arnd Bergmann wrote: > > > > On Tue, Nov

Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-11 Thread Arnd Bergmann
On Wed, Nov 11, 2020 at 2:39 PM Thomas Bogendoerfer wrote: > On Wed, Nov 11, 2020 at 11:57:02AM +0100, Arnd Bergmann wrote: > > On Wed, Nov 11, 2020 at 11:26 AM Mike Rapoport wrote: > > > > > > On Wed, Nov 11, 2020 at 10:33:29AM +0100, Arnd Bergmann wrote: > > > > On Tue, Nov 10, 2020 at 5:21 PM

Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-11 Thread Thomas Bogendoerfer
On Wed, Nov 11, 2020 at 11:57:02AM +0100, Arnd Bergmann wrote: > On Wed, Nov 11, 2020 at 11:26 AM Mike Rapoport wrote: > > > > On Wed, Nov 11, 2020 at 10:33:29AM +0100, Arnd Bergmann wrote: > > > On Tue, Nov 10, 2020 at 5:21 PM Mike Rapoport wrote: > > > > On Tue, Nov 10, 2020 at 12:21:11PM

Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-11 Thread Mike Rapoport
On Wed, Nov 11, 2020 at 11:57:02AM +0100, Arnd Bergmann wrote: > On Wed, Nov 11, 2020 at 11:26 AM Mike Rapoport wrote: > > > > On Wed, Nov 11, 2020 at 10:33:29AM +0100, Arnd Bergmann wrote: > > > On Tue, Nov 10, 2020 at 5:21 PM Mike Rapoport wrote: > > > > On Tue, Nov 10, 2020 at 12:21:11PM

Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-11 Thread Arnd Bergmann
On Wed, Nov 11, 2020 at 11:26 AM Mike Rapoport wrote: > > On Wed, Nov 11, 2020 at 10:33:29AM +0100, Arnd Bergmann wrote: > > On Tue, Nov 10, 2020 at 5:21 PM Mike Rapoport wrote: > > > On Tue, Nov 10, 2020 at 12:21:11PM +0100, Arnd Bergmann wrote: > > > > > > > > To be on the safe side, we could

Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-11 Thread Mike Rapoport
On Wed, Nov 11, 2020 at 10:33:29AM +0100, Arnd Bergmann wrote: > On Tue, Nov 10, 2020 at 5:21 PM Mike Rapoport wrote: > > On Tue, Nov 10, 2020 at 12:21:11PM +0100, Arnd Bergmann wrote: > > > > > > To be on the safe side, we could provoke a compile-time error > > > when CONFIG_PHYS_ADDR_T_64BIT is

Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-11 Thread Arnd Bergmann
On Tue, Nov 10, 2020 at 5:21 PM Mike Rapoport wrote: > On Tue, Nov 10, 2020 at 12:21:11PM +0100, Arnd Bergmann wrote: > > > > To be on the safe side, we could provoke a compile-time error > > when CONFIG_PHYS_ADDR_T_64BIT is set on a 32-bit > > architecture, but MAX_POSSIBLE_PHYSMEM_BITS is not

Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-10 Thread Mike Rapoport
Hi, On Tue, Nov 10, 2020 at 03:36:20PM -0800, Minchan Kim wrote: > On Tue, Nov 10, 2020 at 06:21:55PM +0200, Mike Rapoport wrote: > > On Tue, Nov 10, 2020 at 12:21:11PM +0100, Arnd Bergmann wrote: > > > On Tue, Nov 10, 2020 at 10:58 AM Mike Rapoport wrote: > > > > > > > > > > > > asm/sparsemem.h

Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-10 Thread Minchan Kim
On Tue, Nov 10, 2020 at 06:21:55PM +0200, Mike Rapoport wrote: > On Tue, Nov 10, 2020 at 12:21:11PM +0100, Arnd Bergmann wrote: > > On Tue, Nov 10, 2020 at 10:58 AM Mike Rapoport wrote: > > > > > > > > > > asm/sparsemem.h is not available on some architectures. > > > > > It's better to use

Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-10 Thread Mike Rapoport
On Tue, Nov 10, 2020 at 12:21:11PM +0100, Arnd Bergmann wrote: > On Tue, Nov 10, 2020 at 10:58 AM Mike Rapoport wrote: > > > > > > > > asm/sparsemem.h is not available on some architectures. > > > > It's better to use linux/mmzone.h instead. > > Ah, I missed that, too. > > > > Hm,

Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-10 Thread Arnd Bergmann
On Tue, Nov 10, 2020 at 1:24 PM Stefan Agner wrote: > On 2020-11-10 12:21, Arnd Bergmann wrote: > > Good idea. I wonder what other architectures need the same though. > > >> That's what x86 does: > >> > >> $ git grep -w MAX_POSSIBLE_PHYSMEM_BITS arch/ > >>

Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-10 Thread Stefan Agner
[adding Russell King for ARM] On 2020-11-10 12:21, Arnd Bergmann wrote: > On Tue, Nov 10, 2020 at 10:58 AM Mike Rapoport wrote: >> > > >> > > asm/sparsemem.h is not available on some architectures. >> > > It's better to use linux/mmzone.h instead. > > Ah, I missed that, too. > >> > Hm,

Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-10 Thread Arnd Bergmann
On Tue, Nov 10, 2020 at 10:58 AM Mike Rapoport wrote: > > > > > > asm/sparsemem.h is not available on some architectures. > > > It's better to use linux/mmzone.h instead. Ah, I missed that, too. > > Hm, linux/mmzone.h only includes asm/sparsemem.h when CONFIG_SPARSEMEM > > is enabled. However,

Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-10 Thread Mike Rapoport
On Tue, Nov 10, 2020 at 10:29:54AM +0100, Stefan Agner wrote: > On 2020-11-08 07:46, Mike Rapoport wrote: > > On Sat, Nov 07, 2020 at 04:22:06PM +0100, Stefan Agner wrote: > >> Most architectures define MAX_PHYSMEM_BITS in asm/sparsemem.h and don't > >> include it in asm/pgtable.h. Include

Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-10 Thread Stefan Agner
On 2020-11-08 07:46, Mike Rapoport wrote: > On Sat, Nov 07, 2020 at 04:22:06PM +0100, Stefan Agner wrote: >> Most architectures define MAX_PHYSMEM_BITS in asm/sparsemem.h and don't >> include it in asm/pgtable.h. Include asm/sparsemem.h directly to get >> the MAX_PHYSMEM_BITS define on all

Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-09 Thread Minchan Kim
On Sun, Nov 08, 2020 at 02:16:37AM +0100, Stefan Agner wrote: > On 2020-11-08 01:56, Andrew Morton wrote: > > On Sat, 7 Nov 2020 16:22:06 +0100 Stefan Agner wrote: > > > >> Most architectures define MAX_PHYSMEM_BITS in asm/sparsemem.h and don't > >> include it in asm/pgtable.h. Include

Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-07 Thread Mike Rapoport
On Sat, Nov 07, 2020 at 04:22:06PM +0100, Stefan Agner wrote: > Most architectures define MAX_PHYSMEM_BITS in asm/sparsemem.h and don't > include it in asm/pgtable.h. Include asm/sparsemem.h directly to get > the MAX_PHYSMEM_BITS define on all architectures. > > This fixes a crash when accessing

Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-07 Thread Florian Fainelli
On 11/7/2020 5:16 PM, Stefan Agner wrote: > On 2020-11-08 01:56, Andrew Morton wrote: >> On Sat, 7 Nov 2020 16:22:06 +0100 Stefan Agner wrote: >> >>> Most architectures define MAX_PHYSMEM_BITS in asm/sparsemem.h and don't >>> include it in asm/pgtable.h. Include asm/sparsemem.h directly to

Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-07 Thread Stefan Agner
On 2020-11-08 01:56, Andrew Morton wrote: > On Sat, 7 Nov 2020 16:22:06 +0100 Stefan Agner wrote: > >> Most architectures define MAX_PHYSMEM_BITS in asm/sparsemem.h and don't >> include it in asm/pgtable.h. Include asm/sparsemem.h directly to get >> the MAX_PHYSMEM_BITS define on all

Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-07 Thread Andrew Morton
On Sat, 7 Nov 2020 16:22:06 +0100 Stefan Agner wrote: > Most architectures define MAX_PHYSMEM_BITS in asm/sparsemem.h and don't > include it in asm/pgtable.h. Include asm/sparsemem.h directly to get > the MAX_PHYSMEM_BITS define on all architectures. > > This fixes a crash when accessing zram