Skip to content

Commit

Permalink
[PATCH] reduce size of bio mempools
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Benjamin LaHaise authored and Linus Torvalds committed Mar 23, 2006
1 parent b73b459 commit b0e6e96
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fs/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1243,11 +1243,11 @@ static int __init init_bio(void)
scale = 4;

/*
* scale number of entries
* Limit number of entries reserved -- mempools are only used when
* the system is completely unable to allocate memory, so we only
* need enough to make progress.
*/
bvec_pool_entries = megabytes * 2;
if (bvec_pool_entries > 256)
bvec_pool_entries = 256;
bvec_pool_entries = 1 + scale;

fs_bio_set = bioset_create(BIO_POOL_SIZE, bvec_pool_entries, scale);
if (!fs_bio_set)
Expand Down

0 comments on commit b0e6e96

Please sign in to comment.