Skip to contentSkip to conversation

mm/zblock: avoid failing the build

PATCH In review Igor Belousov 3 participants 4 messages Apr 28, 2025 – May 1, 2025 Memory management

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/zblock: avoid failing the build

Don't break the build for a PAGE_SIZE that is not fully supported, just print out a warning in that case.

---
 mm/zblock.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
mm/zblock.h +3 -2
index fd72961c077a..8610196b651e 100644
@@ -21,7 +21,8 @@
 /* max 256 slots per block, max table size 64 */
 #define SLOT_BITS 8
 #else
-#error Unsupported PAGE_SIZE
+#warn This PAGE_SIZE is not quite supported yet
+#define SLOT_BITS 8
 #endif
 
 #define MAX_SLOTS (1 << SLOT_BITS)
@@ -101,7 +102,7 @@ static const struct block_desc block_desc[] = {
 	{ SLOT_SIZE(10, 3), 10, 3 },
 	{ SLOT_SIZE(9, 3), 9, 3 },
 	{ SLOT_SIZE(4, 2), 4, 2 },
-#elif PAGE_SIZE == 0x4000
+#else
 	{ SLOT_SIZE(255, 0), 255, 0 },
 	{ SLOT_SIZE(185, 0), 185, 0 },
 	{ SLOT_SIZE(145, 0), 145, 0 },
Signature · 1 line
2.49.0
#1 lore raw
kernel test robot noticed the following build errors:

Hi Igor,

kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-everything]

url:    https://github.com/intel-lab-lkp/linux/commits/Igor-Belousov/mm-zblock-avoid-failing-the-build/20250428-150012
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20250428065727.57990-1-igor.b%40beldev.am
patch subject: [PATCH mm-new] mm/zblock: avoid failing the build
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20250428/[email protected]/config)
compiler: alpha-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250428/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

In file included from mm/zblock.c:27:

>> mm/zblock.h:24:2: error: invalid preprocessing directive #warn; did you mean #warning?
      24 | #warn This PAGE_SIZE is not quite supported yet
         |  ^~~~
         |  warning

vim +24 mm/zblock.h

    16	
    17	#if PAGE_SIZE == 0x1000
    18	/* max 128 slots per block, max table size 32 */
    19	#define SLOT_BITS 7
    20	#elif PAGE_SIZE == 0x4000
    21	/* max 256 slots per block, max table size 64 */
    22	#define SLOT_BITS 8
    23	#else
  > 24	#warn This PAGE_SIZE is not quite supported yet
    25	#define SLOT_BITS 8
    26	#endif
    27	
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
maintainer
#2 lore raw
In reply to Igor Belousov
Quoted 3 lines · On Mon, 28 Apr 2025 08:57:27 +0200 Igor Belousov <[email protected]> wrote:

Don't break the build for a PAGE_SIZE that is not fully supported, just print out a warning in that case.

I queued these two patches and this fix:

mm/zblock.h renamed from mm/zblock.h~mm-zblock-avoid-failing-the-build-fix +1 -1
@@ -21,7 +21,7 @@
 /* max 256 slots per block, max table size 64 */
 #define SLOT_BITS 8
 #else
-#warn This PAGE_SIZE is not quite supported yet
+#warning This PAGE_SIZE is not quite supported yet
 #define SLOT_BITS 8
 #endif
 

But please be aware that I consider the zblock zeries to be stuck until there is clarity that zblock is something we should add to Linux. Let's continue to address this in the main thread(s), please.

Or perhaps to restart things, do a full resend after having reworked the [0/N] changelog to fully address the issues which have thus far been raised. And Cc'ing the various individuals who have thus far commented.

Thanks.

#3 lore raw
In reply to Igor Belousov
kernel test robot noticed the following build errors:

Hi Igor,

kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-everything]

url:    https://github.com/intel-lab-lkp/linux/commits/Igor-Belousov/mm-zblock-avoid-failing-the-build/20250428-150012
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20250428065727.57990-1-igor.b%40beldev.am
patch subject: [PATCH mm-new] mm/zblock: avoid failing the build
config: powerpc-allyesconfig (https://download.01.org/0day-ci/archive/20250501/[email protected]/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250501/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

In file included from mm/zblock.c:27:

>> mm/zblock.h:24:2: error: invalid preprocessing directive

24 | #warn This PAGE_SIZE is not quite supported yet
| ^
1 error generated.

vim +24 mm/zblock.h

    16	
    17	#if PAGE_SIZE == 0x1000
    18	/* max 128 slots per block, max table size 32 */
    19	#define SLOT_BITS 7
    20	#elif PAGE_SIZE == 0x4000
    21	/* max 256 slots per block, max table size 64 */
    22	#define SLOT_BITS 8
    23	#else
  > 24	#warn This PAGE_SIZE is not quite supported yet
    25	#define SLOT_BITS 8
    26	#endif
    27	
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki