1
0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2026-01-17 20:10:49 +00:00
Sebastian Andrzej Siewior 8f3ce3d996 mm: percpu: increase PERCPU_DYNAMIC_SIZE_SHIFT on certain builds.
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.

Link: https://lkml.kernel.org/r/20241007143049.gyMpEu89@linutronix.de
Fixes: d8fccd9ca5f9 ("arm64: Allow to enable PREEMPT_RT.")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202410020326.iaZIteIx-lkp@intel.com/
Reported-by: Arnd Bergmann <arnd@kernel.org>
Closes: https://lore.kernel.org/20241004095702.637528-1-arnd@kernel.org
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Dennis Zhou <dennis@kernel.org>
Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Tejun Heo <tj@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-10-17 00:28:07 -07:00
..
2024-10-02 17:14:53 -07:00
2024-09-26 12:00:25 -07:00
2024-09-23 14:00:46 -07:00
2024-09-26 10:27:10 -07:00
2024-09-27 09:55:30 -07:00
2024-09-09 16:39:18 -07:00
2024-09-27 12:10:45 -07:00
2024-09-25 14:56:40 -07:00
2024-09-24 14:54:26 -07:00
2024-09-16 08:54:30 +02:00
2024-09-29 08:51:30 -07:00
2024-09-03 21:15:36 -07:00
2024-09-18 07:52:24 +02:00
2024-09-27 12:10:45 -07:00
2024-09-19 10:18:15 +02:00
2024-09-21 09:27:50 -07:00
2024-10-01 17:01:40 +02:00
2024-09-09 16:39:05 -07:00
2024-09-03 21:15:46 -07:00
2024-09-20 18:28:26 +03:00
2024-09-09 16:39:04 -07:00
2024-09-24 14:54:26 -07:00
2024-09-03 21:15:44 -07:00
2024-09-23 15:03:30 -04:00
2024-09-20 17:53:17 -07:00
2024-09-23 14:08:08 -07:00
2024-09-19 14:25:32 -05:00
2024-09-19 14:25:34 -05:00
2024-09-17 01:06:59 -07:00
2024-09-05 11:14:14 +02:00
2024-09-18 08:53:53 +02:00
2024-09-18 08:53:53 +02:00
2024-09-11 20:44:31 -07:00
2024-09-18 07:52:24 +02:00
2024-09-11 20:44:32 -07:00
2024-09-19 10:18:15 +02:00
2024-09-22 11:19:35 -07:00
2024-09-12 12:20:39 +02:00
2024-09-09 16:39:04 -07:00