lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241011141214.87096-1-visitorckw@gmail.com>
Date: Fri, 11 Oct 2024 22:12:14 +0800
From: Kuan-Wei Chiu <visitorckw@...il.com>
To: akpm@...ux-foundation.org,
	hch@...radead.org
Cc: llong@...hat.com,
	xavier_qy@....com,
	lizefan.x@...edance.com,
	tj@...nel.org,
	hannes@...xchg.org,
	mkoutny@...e.com,
	jserv@...s.ncku.edu.tw,
	linux-kernel@...r.kernel.org,
	cgroups@...r.kernel.org,
	Kuan-Wei Chiu <visitorckw@...il.com>,
	Waiman Long <longman@...hat.com>
Subject: [PATCH v2] 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/
Suggested-by: Waiman Long <llong@...hat.com>
Signed-off-by: Kuan-Wei Chiu <visitorckw@...il.com>
Acked-by: Waiman Long <longman@...hat.com>
Acked-by: Tejun Heo <tj@...nel.org>
---
 init/Kconfig | 1 +
 lib/Kconfig  | 3 +++
 lib/Makefile | 3 ++-
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/init/Kconfig b/init/Kconfig
index 530a382ee0fe..323206ff5848 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1153,6 +1153,7 @@ config CGROUP_HUGETLB
 config CPUSETS
 	bool "Cpuset controller"
 	depends on SMP
+	select UNION_FIND
 	help
 	  This option will let you create and manage CPUSETs which
 	  allow dynamically partitioning a system into sets of CPUs and
diff --git a/lib/Kconfig b/lib/Kconfig
index b38849af6f13..cf303bd91dda 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -777,3 +777,6 @@ config POLYNOMIAL
 
 config FIRMWARE_TABLE
 	bool
+
+config UNION_FIND
+	bool
diff --git a/lib/Makefile b/lib/Makefile
index 773adf88af41..03b88b501b49 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -35,8 +35,9 @@ lib-y := ctype.o string.o vsprintf.o cmdline.o \
 	 is_single_threaded.o plist.o decompress.o kobject_uevent.o \
 	 earlycpio.o seq_buf.o siphash.o dec_and_lock.o \
 	 nmi_backtrace.o win_minmax.o memcat_p.o \
-	 buildid.o objpool.o union_find.o
+	 buildid.o objpool.o
 
+lib-$(CONFIG_UNION_FIND) += union_find.o
 lib-$(CONFIG_PRINTK) += dump_stack.o
 lib-$(CONFIG_SMP) += cpumask.o
 
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ