diff options
author | Benjamin LaHaise <bcrl@kvack.org> | 2006-03-23 06:01:08 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-23 10:38:18 -0500 |
commit | b0e6e962992b76580f4900b166a337bad7c1e81b (patch) | |
tree | 0caae9380c729a437e89acd5d5817a285156e26e /fs | |
parent | b73b459f72f746a031d1ef4cc7659b20a1f1acb9 (diff) |
[PATCH] reduce size of bio mempools
The biovec default mempool limit of 256 entries results in over 3MB of RAM
being permanently pinned, even on systems with only 128MB of RAM. Since
mempool tries to allocate from the system pool first, it makes sense to
reduce the size of the mempool fallbacks to a more reasonable limit of 1-5
entries -- enough for the system to be able to make progress even under
load.
Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
Acked-by: Jens Axboe <axboe@suse.de>
Cc: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/bio.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1243,11 +1243,11 @@ static int __init init_bio(void) | |||
1243 | scale = 4; | 1243 | scale = 4; |
1244 | 1244 | ||
1245 | /* | 1245 | /* |
1246 | * scale number of entries | 1246 | * Limit number of entries reserved -- mempools are only used when |
1247 | * the system is completely unable to allocate memory, so we only | ||
1248 | * need enough to make progress. | ||
1247 | */ | 1249 | */ |
1248 | bvec_pool_entries = megabytes * 2; | 1250 | bvec_pool_entries = 1 + scale; |
1249 | if (bvec_pool_entries > 256) | ||
1250 | bvec_pool_entries = 256; | ||
1251 | 1251 | ||
1252 | fs_bio_set = bioset_create(BIO_POOL_SIZE, bvec_pool_entries, scale); | 1252 | fs_bio_set = bioset_create(BIO_POOL_SIZE, bvec_pool_entries, scale); |
1253 | if (!fs_bio_set) | 1253 | if (!fs_bio_set) |