Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Harry Yoo (Oracle)" <harry@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [harry:slab-allow-runtime-parameter-tuning-rfc-v1r1-wip 2/6] mm/slub.c:7791:39: error: use of undeclared identifier 'USHORT_MAX'
Date: Wed, 13 May 2026 18:24:01 +0800	[thread overview]
Message-ID: <202605131848.ohpPqW3E-lkp@intel.com> (raw)

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

                 reply	other threads:[~2026-05-13 10:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202605131848.ohpPqW3E-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=harry@kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox