Skip to content

Commit bf9850f

Browse files
visitorckwakpm00
authored andcommitted
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/[email protected]/ Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Kuan-Wei Chiu <[email protected]> Suggested-by: Waiman Long <[email protected]> Acked-by: Waiman Long <[email protected]> Acked-by: Tejun Heo <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Cc: Ching-Chun (Jim) Huang <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Michal Koutný <[email protected]> Cc: Xavier <[email protected]> Cc: Zefan Li <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 8801c35 commit bf9850f

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

init/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,7 @@ config CGROUP_HUGETLB
11571157
config CPUSETS
11581158
bool "Cpuset controller"
11591159
depends on SMP
1160+
select UNION_FIND
11601161
help
11611162
This option will let you create and manage CPUSETs which
11621163
allow dynamically partitioning a system into sets of CPUs and

lib/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,3 +777,6 @@ config POLYNOMIAL
777777

778778
config FIRMWARE_TABLE
779779
bool
780+
781+
config UNION_FIND
782+
bool

lib/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ lib-y := ctype.o string.o vsprintf.o cmdline.o \
3535
is_single_threaded.o plist.o decompress.o kobject_uevent.o \
3636
earlycpio.o seq_buf.o siphash.o dec_and_lock.o \
3737
nmi_backtrace.o win_minmax.o memcat_p.o \
38-
buildid.o objpool.o union_find.o
38+
buildid.o objpool.o
3939

40+
lib-$(CONFIG_UNION_FIND) += union_find.o
4041
lib-$(CONFIG_PRINTK) += dump_stack.o
4142
lib-$(CONFIG_SMP) += cpumask.o
4243

0 commit comments

Comments
 (0)