All of lore.kernel.org
 help / color / mirror / Atom feed
From: Milan Broz <mbroz@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@osdl.org>, Jens Axboe <axboe@suse.de>
Subject: [PATCH] fix creating zero sized bio mempools in low memory system
Date: Mon, 04 Sep 2006 14:31:12 +0200	[thread overview]
Message-ID: <44FC1C90.200@redhat.com> (raw)

In the very low memory systems is in the init_bio call
scale parameter set to zero and it leads to creating
zero sized mempool.

This patch prevents pool_entries parameter become zero,
so the created pool have at least 1 entry.

Mempool with 0 entries lead to incorrect behaviour 
of mempool_free. (Alloc requests are not waken up
and system stalls in mempool_alloc->ioschedule). 


Signed-off-by: Milan Broz <mbroz@redhat.com>

Index: linux-2.6.18-rc6/fs/bio.c
===================================================================
--- linux-2.6.18-rc6.orig/fs/bio.c
+++ linux-2.6.18-rc6/fs/bio.c
@@ -1142,7 +1142,7 @@ static int biovec_create_pools(struct bi
 		struct biovec_slab *bp = bvec_slabs + i;
 		mempool_t **bvp = bs->bvec_pools + i;
 
-		if (i >= scale)
+		if (pool_entries > 1 && i >= scale)
 			pool_entries >>= 1;
 
 		*bvp = mempool_create_slab_pool(pool_entries, bp->slab);



-- 
VGER BF report: U 0.493705

             reply	other threads:[~2006-09-04 12:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-04 12:31 Milan Broz [this message]
2006-09-04 12:43 ` [PATCH] fix creating zero sized bio mempools in low memory system Jens Axboe

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=44FC1C90.200@redhat.com \
    --to=mbroz@redhat.com \
    --cc=akpm@osdl.org \
    --cc=axboe@suse.de \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.