From: "NeilBrown" <neilb@suse.de>
To: "Chuck Lever" <chuck.lever@oracle.com>
Cc: "Trond Myklebust" <trond.myklebust@netapp.com>,
linux-nfs@vger.kernel.org,
"Martin Wilck" <martin.wilck@ts.fujitsu.com>
Subject: Re: [PATCH] sunrpc: replace large table of slots with mempool
Date: Sat, 31 Oct 2009 08:51:29 +1100 [thread overview]
Message-ID: <bab6d1956e06e41d618c78588a7bc51d.squirrel@neil.brown.name> (raw)
In-Reply-To: <285206C1-0C8E-4B5A-82FA-EE699BE60507@oracle.com>
On Sat, October 31, 2009 6:25 am, Chuck Lever wrote:
> On Oct 30, 2009, at 1:53 AM, Neil Brown wrote:
>> From: Martin Wilck <martin.wilck@ts.fujitsu.com>
>> Date: Fri, 30 Oct 2009 16:35:19 +1100
>>
>> If {udp,tcp}_slot_table_entries exceeds 111 (on x86-64),
>> the allocated slot table exceeds 32K and so requires an
>> order-4 allocation.
>> As 4 exceeds PAGE_ALLOC_COSTLY_ORDER (==3), these are more
>> likely to fail, so the chance of a mount failing due to low or
>> fragmented memory goes up significantly.
>>
>> This is particularly a problem for autofs which can try a mount
>> at any time and does not retry in the face of failure.
>
> (aye, and that could be addressed too, separately)
>
>> There is no really need for the slots to be allocated in a single
>> slab of memory. Using a kmemcache, particularly when fronted by
>> a mempool to allow allocation to usually succeed in atomic context,
>> avoid the need for a large allocation, and also reduces memory waste
>> in cases where not all of the slots are required.
>>
>> This patch replaces the single kmalloc per client with a mempool
>> shared among all clients.
>
> I've thought getting rid of the slot tables was a good idea for many
> years.
>
> One concern I have, though, is that this shared mempool would be a
> contention point for all RPC transports; especially bothersome on SMP/
> NUMA?
mempools don't fall back on the preallocated memory unless a new
allocation fails.
So the normal case will be a simple calls to kmem_cache_alloc which
scales quite well on SMP/NUMA. When memory gets tight is the only
time when the mempool can become a contention point, and those times
are supposed to be very transient.
(I used the think it very odd that mempools used the preallocated memory
last rather than first, but then Nick Piggin explained the NUMA issues
and it all became much clearer).
NeilBrown
next prev parent reply other threads:[~2009-10-30 21:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-30 5:53 [PATCH] sunrpc: replace large table of slots with mempool Neil Brown
[not found] ` <19178.32618.958277.726234-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2009-10-30 19:25 ` Chuck Lever
2009-10-30 21:51 ` NeilBrown [this message]
2009-10-30 19:53 ` Trond Myklebust
[not found] ` <1256932398.15679.0.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-10-30 21:58 ` NeilBrown
[not found] ` <4f145776da1d0765ddc46cdb4be28b76.squirrel-eq65iwfR9nKIECXXMXunQA@public.gmane.org>
2009-10-30 22:05 ` Chuck Lever
2009-11-04 17:17 ` Martin Wilck
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=bab6d1956e06e41d618c78588a7bc51d.squirrel@neil.brown.name \
--to=neilb@suse.de \
--cc=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=martin.wilck@ts.fujitsu.com \
--cc=trond.myklebust@netapp.com \
/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