login
Header Space

 
 

[14/14] vcompound: Avoid vmalloc for ehash_locks

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-mm@...>
Cc: <linux-kernel@...>
Date: Friday, March 21, 2008 - 2:17 am

Avoid the use of vmalloc for the ehash locks.

Signed-off-by: Christoph Lameter <clameter@sgi.com>

---
 include/net/inet_hashtables.h |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Index: linux-2.6.25-rc5-mm1/include/net/inet_hashtables.h
===================================================================
--- linux-2.6.25-rc5-mm1.orig/include/net/inet_hashtables.h	2008-03-20 22:21:02.680501729 -0700
+++ linux-2.6.25-rc5-mm1/include/net/inet_hashtables.h	2008-03-20 22:22:15.416565317 -0700
@@ -164,7 +164,8 @@ static inline int inet_ehash_locks_alloc
 	if (sizeof(rwlock_t) != 0) {
 #ifdef CONFIG_NUMA
 		if (size * sizeof(rwlock_t) > PAGE_SIZE)
-			hashinfo->ehash_locks = vmalloc(size * sizeof(rwlock_t));
+			hashinfo->ehash_locks = __alloc_vcompound(GFP_KERNEL,
+				get_order(size * sizeof(rwlock_t)));
 		else
 #endif
 		hashinfo->ehash_locks =	kmalloc(size * sizeof(rwlock_t),
@@ -185,7 +186,7 @@ static inline void inet_ehash_locks_free
 		unsigned int size = (hashinfo->ehash_locks_mask + 1) *
 							sizeof(rwlock_t);
 		if (size > PAGE_SIZE)
-			vfree(hashinfo->ehash_locks);
+			__free_vcompound(hashinfo->ehash_locks);
 		else
 #endif
 		kfree(hashinfo->ehash_locks);

-- 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[14/14] vcompound: Avoid vmalloc for ehash_locks, Christoph Lameter, (Fri Mar 21, 2:17 am)
Re: [14/14] vcompound: Avoid vmalloc for ehash_locks, Eric Dumazet, (Fri Mar 21, 3:02 am)
Re: [14/14] vcompound: Avoid vmalloc for ehash_locks, David Miller, (Fri Mar 21, 3:31 am)
Re: [14/14] vcompound: Avoid vmalloc for ehash_locks, Christoph Lameter, (Fri Mar 21, 1:31 pm)
Re: [14/14] vcompound: Avoid vmalloc for ehash_locks, Christoph Lameter, (Fri Mar 21, 3:03 am)
Re: [14/14] vcompound: Avoid vmalloc for ehash_locks, David Miller, (Fri Mar 21, 3:31 am)
Re: [14/14] vcompound: Avoid vmalloc for ehash_locks, Eric Dumazet, (Fri Mar 21, 3:42 am)
speck-geostationary