From: Adam Litke <agl@us.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Adam Litke <agl@us.ibm.com>, linux-mm@kvack.org
Subject: [PATCH] hugetlb: Fix dynamic pool resize failure case
Date: Tue, 09 Oct 2007 08:58:45 -0700 [thread overview]
Message-ID: <20071009155845.20191.85647.stgit@kernel> (raw)
When gather_surplus_pages() fails to allocate enough huge pages to satisfy
the requested reservation, it frees what it did allocate back to the buddy
allocator. put_page() should be called instead of update_and_free_page()
to ensure that pool counters are updated as appropriate and the page's
refcount is decremented.
Andrew: This should apply cleanly to my patches in the -mm tree.
Signed-off-by: Adam Litke <agl@us.ibm.com>
---
mm/hugetlb.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 9b3dfac..f349c16 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -281,8 +281,11 @@ free:
list_del(&page->lru);
if ((--needed) >= 0)
enqueue_huge_page(page);
- else
- update_and_free_page(page);
+ else {
+ spin_unlock(&hugetlb_lock);
+ put_page(page);
+ spin_lock(&hugetlb_lock);
+ }
}
return ret;
--
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 reply other threads:[~2007-10-09 15:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-09 15:58 Adam Litke [this message]
2007-10-09 21:20 ` Dave Hansen
2007-10-10 13:58 ` Adam Litke
2007-10-12 19:15 Adam Litke
2007-10-12 19:31 ` Dave Hansen
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=20071009155845.20191.85647.stgit@kernel \
--to=agl@us.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.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