1
0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2026-01-12 17:41:28 +00:00
Hao Ge 59b5ed409d mm/percpu: conditionally define _shared_alloc_tag via CONFIG_ARCH_MODULE_NEEDS_WEAK_PER_CPU
Recently discovered this entry while checking kallsyms on ARM64:
ffff800083e509c0 D _shared_alloc_tag

If ARCH_NEEDS_WEAK_PER_CPU is not defined(it is only defined for s390 and
alpha architectures), there's no need to statically define the percpu
variable _shared_alloc_tag.

Therefore, we need to implement isolation for this purpose.

When building the core kernel code for s390 or alpha architectures,
ARCH_NEEDS_WEAK_PER_CPU remains undefined (as it is gated by #if
defined(MODULE)).  However, when building modules for these architectures,
the macro is explicitly defined.

Therefore, we remove all instances of ARCH_NEEDS_WEAK_PER_CPU from the
code and introduced CONFIG_ARCH_MODULE_NEEDS_WEAK_PER_CPU to replace the
relevant logic.  We can now conditionally define the perpcu variable
_shared_alloc_tag based on CONFIG_ARCH_MODULE_NEEDS_WEAK_PER_CPU.  This
allows architectures (such as s390/alpha) that require weak definitions
for percpu variables in modules to include the definition, while others
can omit it via compile-time exclusion.

Link: https://lkml.kernel.org/r/20250618015809.1235761-1-hao.ge@linux.dev
Signed-off-by: Hao Ge <gehao@kylinos.cn>
Suggested-by: Suren Baghdasaryan <surenb@google.com>
Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>	[s390]
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Chistoph Lameter <cl@linux.com>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Dennis Zhou <dennis@kernel.org>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-07-09 22:42:15 -07:00
..
2025-04-03 21:35:32 +02:00
2025-05-09 23:09:01 +02:00
2025-05-27 15:22:01 -07:00
2025-05-11 17:54:10 -07:00
2025-06-05 08:49:30 -07:00
2025-06-05 08:07:24 -07:00
2025-06-03 16:13:32 -07:00
2025-06-03 08:39:20 -07:00
2025-04-21 10:27:59 +02:00
2025-04-29 15:58:38 -04:00
2025-04-29 15:58:38 -04:00
2025-04-29 15:58:38 -04:00
2025-05-28 15:52:42 -07:00
2025-05-19 08:17:08 -07:00
2025-04-17 10:50:55 -07:00
2025-05-27 20:59:53 -07:00
2025-05-21 13:41:03 +02:00
2025-05-21 13:39:45 +02:00
2025-06-03 07:39:23 -07:00
2025-05-28 15:24:36 -07:00
2025-05-26 08:02:43 -07:00
2025-04-11 18:58:10 -07:00
2025-05-28 15:52:42 -07:00
2025-05-20 05:34:27 +02:00
2025-04-17 10:56:11 +02:00
2025-04-10 10:39:14 +01:00
2025-03-30 12:43:03 -07:00
2025-05-15 20:24:40 +02:00
\n
2025-05-29 10:34:26 -07:00
2025-07-09 22:42:09 -07:00
2025-06-03 08:39:20 -07:00
2025-05-22 11:07:05 +02:00
2025-04-01 18:03:46 -07:00
2025-06-17 14:29:19 +02:00
2025-05-30 10:44:20 -07:00
2025-05-27 08:00:46 -07:00
2025-06-11 11:57:14 -07:00
2025-03-30 12:43:03 -07:00
2025-05-11 17:48:29 -07:00
2025-07-09 22:41:56 -07:00
2025-05-26 08:02:43 -07:00
2025-05-28 15:24:36 -07:00
2025-04-02 17:06:31 -07:00
2025-06-04 09:51:10 +02:00
2025-06-02 15:31:05 -07:00
2025-05-22 20:30:34 +02:00
2025-06-04 11:26:17 -07:00
2025-05-21 16:46:37 +02:00
2025-04-26 08:28:03 +02:00
2025-05-02 11:03:18 +05:30
2025-06-04 11:26:17 -07:00
2025-05-03 12:02:04 +02:00
2025-05-11 17:54:09 -07:00
2025-05-06 11:11:45 -06:00
2025-04-25 15:53:59 +02:00
2025-04-10 18:34:05 -07:00
2025-06-03 07:39:23 -07:00
2025-05-15 04:49:15 +03:00
2025-06-19 12:36:19 +02:00
2025-04-18 10:05:49 -04:00
2025-05-28 14:55:35 -07:00
2025-05-27 20:49:06 -07:00