Skip to contentSkip to conversation

: [XFRM]: Dynamic xfrm_state hash table sizing.

PATCH New David Miller 1 participant 1 message Aug 17, 2006

Subsystems (5)
lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 5/15 : [XFRM]: Dynamic xfrm_state hash table sizing.

[XFRM]: Dynamic xfrm_state hash table sizing.

The grow algorithm is simple, we grow if:

1) we see a hash chain collision at insert, and
2) we haven't hit the hash size limit (currently 1*1024*1024 slots), and
3) the number of xfrm_state objects is > the current hash mask

All of this needs some tweaking.

Remove __initdata from "hashdist" so we can use it safely at run time.

---
 include/linux/bootmem.h |    2 
 mm/page_alloc.c         |    2 
 net/xfrm/xfrm_state.c   |  200 ++++++++++++++++++++++++++++++++++++++---------
 3 files changed, 165 insertions(+), 39 deletions(-)
include/linux/bootmem.h +1 -1
index 1021f50..e319c64 100644
@@ -114,7 +114,7 @@ #define HASHDIST_DEFAULT 1
 #else
 #define HASHDIST_DEFAULT 0
 #endif
-extern int __initdata hashdist;		/* Distribute hashes across NUMA nodes? */
+extern int hashdist;		/* Distribute hashes across NUMA nodes? */
 
 
 #endif /* _LINUX_BOOTMEM_H */
mm/page_alloc.c +1 -1
index 54a4f53..3b5358a 100644
@@ -2363,7 +2363,7 @@ int percpu_pagelist_fraction_sysctl_hand
 	return 0;
 }
 
-__initdata int hashdist = HASHDIST_DEFAULT;
+int hashdist = HASHDIST_DEFAULT;
 
 #ifdef CONFIG_NUMA
 static int __init set_hashdist(char *str)
net/xfrm/xfrm_state.c +163 -37

298 lines not on this page · raw message

Signature · 1 line
1.4.2.rc2.g3e042