lib/rhashtable: make build optional
Subsystems (2)
PATCH 1/1 lib/rhashtable: make build optional
From: Aristeu Rozanski <[email protected]>
rhashtable currently is built unconditionally:
text data bss dec hex filename 9158 2008 5264 16430 402e lib/rhashtable.o 9158 2008 5264 16430 402e (TOTALS)
and it's used by netlink (which currently can't be optionally built if CONFIG_NET is enabled) and netfilter_hash. This patch is useful for situations in which memory footprint is a concern and networking is not enabled.
--- lib/Kconfig | 6 ++++++ lib/Makefile | 4 +++- net/Kconfig | 1 + 3 files changed, 10 insertions(+), 1 deletion(-)
lib/Kconfig +6 -0
@@ -369,6 +369,12 @@ config ASSOCIATIVE_ARRAY for more information. +config RHASH_TABLE + bool "Resizable hash table" + default y + help + Resizable, scalable and concurrent hash table implementation. + config HAS_IOMEM boolean depends on !NO_IOMEM
lib/Makefile +3 -1
@@ -26,7 +26,7 @@ obj-y += bcd.o div64.o sort.o parser.o debug_locks.o random32.o \ bust_spinlocks.o hexdump.o kasprintf.o bitmap.o scatterlist.o \ gcd.o lcm.o list_sort.o uuid.o iovec.o clz_ctz.o \ bsearch.o find_last_bit.o find_next_bit.o llist.o memweight.o kfifo.o \ - percpu-refcount.o percpu_ida.o hash.o rhashtable.o + percpu-refcount.o percpu_ida.o hash.o obj-y += string_helpers.o obj-$(CONFIG_TEST_STRING_HELPERS) += test-string_helpers.o obj-y += kstrtox.o
@@ -155,6 +155,8 @@ obj-$(CONFIG_GENERIC_NET_UTILS) += net_utils.o obj-$(CONFIG_STMP_DEVICE) += stmp_device.o +obj-$(CONFIG_RHASH_TABLE) += rhashtable.o + libfdt_files = fdt.o fdt_ro.o fdt_wip.o fdt_rw.o fdt_sw.o fdt_strerror.o \ fdt_empty_tree.o $(foreach file, $(libfdt_files), \
net/Kconfig +1 -0
@@ -7,6 +7,7 @@ menuconfig NET select NLATTR select GENERIC_NET_UTILS select BPF + select RHASH_TABLE ---help--- Unless you really know what you are doing, you should say Y here. The reason is that some programs need kernel networking support even
Signature · 1 line
1.8.3.1
Quoted 12 lines · Aristeu Rozanski
From: Aristeu Rozanski <[email protected]>
rhashtable currently is built unconditionally:
text data bss dec hex filename 9158 2008 5264 16430 402e lib/rhashtable.o 9158 2008 5264 16430 402e (TOTALS)and it's used by netlink (which currently can't be optionally built if
CONFIG_NETis enabled) andnetfilter_hash. This patch is useful for situations in which memory footprint is a concern and networking is not enabled.
Quoted 9 lines
Cc David S. Miller <[email protected]>Cc Fabian Frederick <[email protected]>Cc Geert Uytterhoeven <[email protected]>Cc Linus Torvalds <[email protected]>Cc Pablo Neira Ayuso <[email protected]>Cc Thomas Graf <[email protected]>Cc Ying Xue <[email protected]>Cc Josh Triplett <[email protected]>Signed-off-by Aristeu Rozanski <[email protected]>
I already have a patch for this in the tiny tree (tiny/no-rhashtable), using a non-user-visible Kconfig symbol.
Sorry that you ran into some projects that have already been completed. I'll try to keep the tinification projects list more up to date; I've been getting patches *very* rapidly, and just about the entire "small" project list is either done or in progress.
- Josh Triplett
Quoted 59 lines
lib/Kconfig | 6 ++++++ lib/Makefile | 4 +++- net/Kconfig | 1 + 3 files changed, 10 insertions(+), 1 deletion(-)lib/Kconfig +6
-0@@ -369,6 +369,12 @@ config ASSOCIATIVE_ARRAY for more information. +config RHASH_TABLE + bool "Resizable hash table" + default y + help + Resizable, scalable and concurrent hash table implementation. + config HAS_IOMEM boolean depends on !NO_IOMEMlib/Makefile +3
-1@@ -26,7 +26,7 @@ obj-y += bcd.o div64.o sort.o parser.o debug_locks.o random32.o \ bust_spinlocks.o hexdump.o kasprintf.o bitmap.o scatterlist.o \ gcd.o lcm.o list_sort.o uuid.o iovec.o clz_ctz.o \ bsearch.o find_last_bit.o find_next_bit.o llist.o memweight.o kfifo.o \ - percpu-refcount.o percpu_ida.o hash.o rhashtable.o + percpu-refcount.o percpu_ida.o hash.o obj-y += string_helpers.o obj-$(CONFIG_TEST_STRING_HELPERS) += test-string_helpers.o obj-y += kstrtox.o@@ -155,6 +155,8 @@ obj-$(CONFIG_GENERIC_NET_UTILS) += net_utils.o obj-$(CONFIG_STMP_DEVICE) += stmp_device.o +obj-$(CONFIG_RHASH_TABLE) += rhashtable.o + libfdt_files = fdt.o fdt_ro.o fdt_wip.o fdt_rw.o fdt_sw.o fdt_strerror.o \ fdt_empty_tree.o $(foreach file, $(libfdt_files), \net/Kconfig +1
-0@@ -7,6 +7,7 @@ menuconfig NET select NLATTR select GENERIC_NET_UTILS select BPF + select RHASH_TABLE ---help--- Unless you really know what you are doing, you should say Y here. The reason is that some programs need kernel networking support evenSignature · 1 line
1.8.3.1