Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [harry:slab-allow-runtime-parameter-tuning-rfc-v1r1-wip 2/6] mm/slub.c:7791:39: error: use of undeclared identifier 'USHORT_MAX'
@ 2026-05-13 10:24 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-05-13 10:24 UTC (permalink / raw)
  To: Harry Yoo (Oracle); +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/harry/linux.git slab-allow-runtime-parameter-tuning-rfc-v1r1-wip
head:   10c188407341817c6baf9dad9c788928f8387800
commit: c31e168e0f0f0b695792c4c9a82bd77ab9d94d12 [2/6] mm/slab: store sheaf capacity for all sheaves
config: um-allnoconfig (https://download.01.org/0day-ci/archive/20260513/202605131848.ohpPqW3E-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 5bac06718f502014fade905512f1d26d578a18f3)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260513/202605131848.ohpPqW3E-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605131848.ohpPqW3E-lkp@intel.com/

All errors (new ones prefixed by >>):

>> mm/slub.c:7791:39: error: use of undeclared identifier 'USHORT_MAX'
    7791 |         return max_t(unsigned int, capacity, USHORT_MAX);
         |                                              ^~~~~~~~~~
   1 error generated.


vim +/USHORT_MAX +7791 mm/slub.c

  7745	
  7746	static unsigned short calculate_sheaf_capacity(struct kmem_cache *s,
  7747						       struct kmem_cache_args *args)
  7748	
  7749	{
  7750		unsigned int capacity;
  7751		size_t size;
  7752	
  7753	
  7754		if (IS_ENABLED(CONFIG_SLUB_TINY) || s->flags & SLAB_DEBUG_FLAGS)
  7755			return 0;
  7756	
  7757		/*
  7758		 * Bootstrap caches can't have sheaves for now (SLAB_NO_OBJ_EXT).
  7759		 * SLAB_NOLEAKTRACE caches (e.g., kmemleak's object_cache) must not
  7760		 * have sheaves to avoid recursion when sheaf allocation triggers
  7761		 * kmemleak tracking.
  7762		 */
  7763		if (s->flags & (SLAB_NO_OBJ_EXT | SLAB_NOLEAKTRACE))
  7764			return 0;
  7765	
  7766		/*
  7767		 * For now we use roughly similar formula (divided by two as there are
  7768		 * two percpu sheaves) as what was used for percpu partial slabs, which
  7769		 * should result in similar lock contention (barn or list_lock)
  7770		 */
  7771		if (s->size >= PAGE_SIZE)
  7772			capacity = 4;
  7773		else if (s->size >= 1024)
  7774			capacity = 12;
  7775		else if (s->size >= 256)
  7776			capacity = 26;
  7777		else
  7778			capacity = 60;
  7779	
  7780		/* Increment capacity to make sheaf exactly a kmalloc size bucket */
  7781		size = struct_size_t(struct slab_sheaf, objects, capacity);
  7782		size = kmalloc_size_roundup(size);
  7783		capacity = (size - struct_size_t(struct slab_sheaf, objects, 0)) / sizeof(void *);
  7784	
  7785		/*
  7786		 * Respect an explicit request for capacity that's typically motivated by
  7787		 * expected maximum size of kmem_cache_prefill_sheaf() to not end up
  7788		 * using low-performance oversize sheaves
  7789		 */
  7790		capacity = max(capacity, args->sheaf_capacity);
> 7791		return max_t(unsigned int, capacity, USHORT_MAX);
  7792	}
  7793	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-13 10:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-13 10:24 [harry:slab-allow-runtime-parameter-tuning-rfc-v1r1-wip 2/6] mm/slub.c:7791:39: error: use of undeclared identifier 'USHORT_MAX' kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox