All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alasdair G Kergon <agk@redhat.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: Heinz Mauelshagen <heinzm@redhat.com>, dm-devel@redhat.com
Subject: Re: [PATCH] raid1: use __GFP_NOFAIL
Date: Fri, 1 May 2009 00:14:43 +0100	[thread overview]
Message-ID: <20090430231443.GD23302@agk.fab.redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0904270658390.12384@hs20-bc2-1.build.redhat.com>

On Mon, Apr 27, 2009 at 07:01:22AM -0400, Mikulas Patocka wrote:
> This is a bug I found when implementing the barriers. There should be 
> __GFP_NOFAIL if the code can't handle an allocation failure.
 
See also this one:
  dm-raid1-mempool-bug-workaround-reversion.patch

Has the original reason for that workaround gone away now or is that
mempool still being used incorrectly?

Alasdair


From: Alasdair G Kergon <agk@redhat.com>

Implement private fallback if immediate allocation from mempool fails.
Standard mempool_alloc() fallback can yield a deadlock when only the
calling process is able to refill the pool. In out-of-memory situations,
instead of waiting for itself, kmirrord now waits for someone else to
free some space, using a standard blocking allocation.

Signed-off-by: Daniel Kobras <kobras@linux.de>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
---
[AGK - This patch reverses the mempool workaround described above.]

 drivers/md/dm-raid1.c |    4 +---
 1 files changed, 1 insertion(+), 3 deletions(-)

Index: linux-2.6.19/drivers/md/dm-raid1.c
===================================================================
--- linux-2.6.19.orig/drivers/md/dm-raid1.c	2006-12-06 20:49:41.000000000 +0000
+++ linux-2.6.19/drivers/md/dm-raid1.c	2006-12-06 20:49:44.000000000 +0000
@@ -261,9 +261,7 @@ static struct region *__rh_alloc(struct 
 	struct region *reg, *nreg;
 
 	read_unlock(&rh->hash_lock);
-	nreg = mempool_alloc(rh->region_pool, GFP_ATOMIC);
-	if (unlikely(!nreg))
-		nreg = kmalloc(sizeof(struct region), GFP_NOIO);
+	nreg = mempool_alloc(rh->region_pool, GFP_NOIO);
 	nreg->state = rh->log->type->in_sync(rh->log, region, 1) ?
 		RH_CLEAN : RH_NOSYNC;
 	nreg->rh = rh;

  reply	other threads:[~2009-04-30 23:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-27 11:01 [PATCH] raid1: use __GFP_NOFAIL Mikulas Patocka
2009-04-30 23:14 ` Alasdair G Kergon [this message]
2009-05-01 12:04   ` Mikulas Patocka
2009-05-01 18:15     ` Alasdair G Kergon

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=20090430231443.GD23302@agk.fab.redhat.com \
    --to=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=heinzm@redhat.com \
    --cc=mpatocka@redhat.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 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.