Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lib/Makefile: make union-find compilation conditional on CONFIG_CPUSETS

Currently, cpuset is the only user of the union-find implementation.
Compiling union-find in all configurations unnecessarily increases the
code size when building the kernel without cgroup support. Modify the
build system to compile union-find only when CONFIG_CPUSETS is enabled.

Link: https://lore.kernel.org/lkml/1ccd6411-5002-4574-bb8e-3e64bba6a757@redhat.com/
Link: https://lkml.kernel.org/r/20241011141214.87096-1-visitorckw@gmail.com
Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Suggested-by: Waiman Long <llong@redhat.com>
Acked-by: Waiman Long <longman@redhat.com>
Acked-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Ching-Chun (Jim) Huang <jserv@ccns.ncku.edu.tw>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Koutný <mkoutny@suse.com>
Cc: Xavier <xavier_qy@163.com>
Cc: Zefan Li <lizefan.x@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Kuan-Wei Chiu and committed by
Andrew Morton
bf9850f6 8801c35c

+6 -1
+1
init/Kconfig
··· 1157 1157 config CPUSETS 1158 1158 bool "Cpuset controller" 1159 1159 depends on SMP 1160 + select UNION_FIND 1160 1161 help 1161 1162 This option will let you create and manage CPUSETs which 1162 1163 allow dynamically partitioning a system into sets of CPUs and
+3
lib/Kconfig
··· 777 777 778 778 config FIRMWARE_TABLE 779 779 bool 780 + 781 + config UNION_FIND 782 + bool
+2 -1
lib/Makefile
··· 35 35 is_single_threaded.o plist.o decompress.o kobject_uevent.o \ 36 36 earlycpio.o seq_buf.o siphash.o dec_and_lock.o \ 37 37 nmi_backtrace.o win_minmax.o memcat_p.o \ 38 - buildid.o objpool.o union_find.o 38 + buildid.o objpool.o 39 39 40 + lib-$(CONFIG_UNION_FIND) += union_find.o 40 41 lib-$(CONFIG_PRINTK) += dump_stack.o 41 42 lib-$(CONFIG_SMP) += cpumask.o 42 43