On Mon, 7 Oct 2024, Sebastian Andrzej Siewior wrote: > Arnd reported a build failure due to the BUILD_BUG_ON() statement in > alloc_kmem_cache_cpus(). The test > > PERCPU_DYNAMIC_EARLY_SIZE < NR_KMALLOC_TYPES * KMALLOC_SHIFT_HIGH * sizeof(struct kmem_cache_cpu) > > The factors that increase the right side of the equation: > - PAGE_SIZE > 4KiB increases KMALLOC_SHIFT_HIGH > - For the local_lock_t in kmem_cache_cpu: > - PREEMPT_RT adds an actual lock. > - LOCKDEP increases the size of the lock. > - LOCK_STAT adds additional bytes plus padding to the lockdep > structure. > > The net difference with and without PREEMPT_RT is 88 bytes for the > lock_lock_t, 96 bytes for kmem_cache_cpu due to additional padding. > This is enough to exceed the 80KiB limit with 16KiB page size - the 8KiB > page size is fine. > > Increase PERCPU_DYNAMIC_SIZE_SHIFT to 13 on configs with PAGE_SIZE larger > than 4KiB and LOCKDEP enabled. > > Fixes: d8fccd9ca5f9 ("arm64: Allow to enable PREEMPT_RT.") > Reported-by: kernel test robot <lkp@xxxxxxxxx> > Closes: https://lore.kernel.org/oe-kbuild-all/202410020326.iaZIteIx-lkp@xxxxxxxxx/ > Reported-by: Arnd Bergmann <arnd@xxxxxxxxxx> > Closes: https://lore.kernel.org/20241004095702.637528-1-arnd@xxxxxxxxxx > Acked-by: Arnd Bergmann <arnd@xxxxxxxx> > Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> Acked-by: David Rientjes <rientjes@xxxxxxxxxx>