From: Eric Dumazet <dada1@cosmosbay.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Linux Netdev List <netdev@vger.kernel.org>
Subject: Re: [14/14] vcompound: Avoid vmalloc for ehash_locks
Date: Fri, 21 Mar 2008 08:02:11 +0100 [thread overview]
Message-ID: <47E35D73.6060703@cosmosbay.com> (raw)
In-Reply-To: <20080321061727.491610308@sgi.com>
Christoph Lameter a écrit :
> 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);
>
But, isnt it defeating the purpose of this *particular* vmalloc() use ?
CONFIG_NUMA and vmalloc() at boot time means :
Try to distribute the pages on several nodes.
Memory pressure on ehash_locks[] is so high we definitly want to spread it.
(for similar uses of vmalloc(), see also hashdist=1 )
Also, please CC netdev for network patches :)
Thank you
next parent reply other threads:[~2008-03-21 7:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20080321061703.921169367@sgi.com>
[not found] ` <20080321061727.491610308@sgi.com>
2008-03-21 7:02 ` Eric Dumazet [this message]
2008-03-21 7:03 ` [14/14] vcompound: Avoid vmalloc for ehash_locks Christoph Lameter
2008-03-21 7:31 ` David Miller
2008-03-21 7:42 ` Eric Dumazet
2008-03-21 7:31 ` David Miller
2008-03-21 17:31 ` Christoph Lameter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47E35D73.6060703@cosmosbay.com \
--to=dada1@cosmosbay.com \
--cc=clameter@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox