From: Ed L Cashin <ecashin@coraid.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ATA over Ethernet driver for 2.6.9 (with changes)
Date: Tue, 14 Dec 2004 08:39:16 -0500 [thread overview]
Message-ID: <87mzwhov7f.fsf@coraid.com> (raw)
In-Reply-To: 20041213201941.GC3399@suse.de
Jens Axboe <axboe@suse.de> writes:
> On Mon, Dec 13 2004, Ed L Cashin wrote:
>> * use mempool allocation in make_request_fn
>
> It's not good enough, if cannot use a higher allocation priority
> that GFP_NOIO here - basically guarantee that your allocation will
> not block on further io. Currently you have the very same deadlock
> as before, the mempool does not help you since you call into the
> allocator and deadlock before ever blocking on the mempool.
Do you mean that with GFP_KERNEL we may still deadlock on line 199 of
the snippet below (from mm/mempool.c)? That alloc pointer points to
mempool_alloc_slab, which gets called with __GFP_WAIT turned off. The
kmem_cache allocator doesn't get called with the allocation priority
we specify in our make_request_fn, so we won't block there.
190 void * mempool_alloc(mempool_t *pool, int gfp_mask)
191 {
192 void *element;
193 unsigned long flags;
194 DEFINE_WAIT(wait);
195 int gfp_nowait = gfp_mask & ~(__GFP_WAIT | __GFP_IO);
196
197 might_sleep_if(gfp_mask & __GFP_WAIT);
198 repeat_alloc:
199 element = pool->alloc(gfp_nowait|__GFP_NOWARN, pool->pool_data);
200 if (likely(element != NULL))
201 return element;
202
If we block later on the pool, that's because there are 16 objects in
use, which means that mempool_free is going to get called 16 times as
I/O completes, so I/O is throttled and forward progress is guaranteed.
Otherwise, how does the mempool mechanism help in preventing deadlock?
It looks like we can simply change GFP_KERNEL to GFP_IO in our
make_request_fn, but I'd also like to understand why that's necessary
when there's a dedicated pre-allocated pool per aoe device.
--
Ed L Cashin <ecashin@coraid.com>
next prev parent reply other threads:[~2004-12-14 13:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-13 16:04 [PATCH] ATA over Ethernet driver for 2.6.9 (with changes) Ed L Cashin
2004-12-13 20:19 ` Jens Axboe
2004-12-14 13:39 ` Ed L Cashin [this message]
2004-12-14 13:52 ` Jens Axboe
2004-12-13 21:23 ` Jan-Benedict Glaw
2004-12-14 20:39 ` Ed L Cashin
2004-12-13 21:54 ` Greg KH
2004-12-14 13:50 ` Ed L Cashin
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=87mzwhov7f.fsf@coraid.com \
--to=ecashin@coraid.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox