From: Roger Oksanen <roger.oksanen@cs.helsinki.fi>
To: linux-mm <linux-mm@kvack.org>
Cc: Mel Gorman <mel@csn.ul.ie>, Roger Oksanen <roger.oksanen@cs.helsinki.fi>
Subject: [RFC,PATCH 1/2] dmapool: Don't warn when allowed to retry allocation.
Date: Wed, 2 Dec 2009 15:20:12 +0200 [thread overview]
Message-ID: <200912021520.12419.roger.oksanen@cs.helsinki.fi> (raw)
In-Reply-To: <200912021518.35877.roger.oksanen@cs.helsinki.fi>
dmapool: Don't warn when allowed to retry allocation.
dmapool uses it's own wait logic, so allocations failing may be retried
if the called specified a waiting GFP_*. Unnecessary warnings only cause
confusion.
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Roger Oksanen <roger.oksanen@cs.helsinki.fi>
---
mm/dmapool.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/mm/dmapool.c b/mm/dmapool.c
index 3df0637..e270f7f 100644
--- a/mm/dmapool.c
+++ b/mm/dmapool.c
@@ -310,6 +310,8 @@ void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags,
struct dma_page *page;
size_t offset;
void *retval;
+ int tries = 0;
+ const gfp_t can_wait = mem_flags & __GFP_WAIT;
spin_lock_irqsave(&pool->lock, flags);
restart:
@@ -317,9 +321,11 @@ void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags,
if (page->offset < pool->allocation)
goto ready;
}
- page = pool_alloc_page(pool, GFP_ATOMIC);
+ tries++;
+ page = pool_alloc_page(pool, GFP_ATOMIC | (can_wait && tries % 10
+ ? __GFP_NOWARN : 0));
if (!page) {
- if (mem_flags & __GFP_WAIT) {
+ if (can_wait) {
DECLARE_WAITQUEUE(wait, current);
__set_current_state(TASK_INTERRUPTIBLE);
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2009-12-02 13:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-02 13:18 [RFC,PATCH 0/2] dmapool: allocation gfp changes Roger Oksanen
2009-12-02 13:20 ` Roger Oksanen [this message]
2009-12-02 19:56 ` [RFC,PATCH 1/2] dmapool: Don't warn when allowed to retry allocation Christoph Lameter
2009-12-02 21:22 ` Roger Oksanen
2009-12-02 13:23 ` [RFC,PATCH 2/2] dmapool: Honor GFP_* flags Roger Oksanen
2009-12-02 20:00 ` Christoph Lameter
2009-12-02 21:39 ` Roger Oksanen
2009-12-02 22:05 ` Christoph Lameter
2009-12-03 12:10 ` Mel Gorman
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=200912021520.12419.roger.oksanen@cs.helsinki.fi \
--to=roger.oksanen@cs.helsinki.fi \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
/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