mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] reduce size of bio mempools
@ 2005-12-28  1:22 Benjamin LaHaise
  0 siblings, 0 replies; only message in thread
From: Benjamin LaHaise @ 2005-12-28  1:22 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel

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>
diff --git a/fs/bio.c b/fs/bio.c
index 460554b..4944009 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -1198,11 +1198,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)
-- 
"You know, I've seen some crystals do some pretty trippy shit, man."
Don't Email: <dont@kvack.org>.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-12-28  1:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-28  1:22 [PATCH] reduce size of bio mempools Benjamin LaHaise

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®