From: Nishanth Aravamudan <nacc@us.ibm.com>
To: clameter@sgi.com
Cc: anton@samba.org, lee.schermerhorn@hp.com, wli@holomorphy.com,
linux-mm@kvack.org
Subject: [RFC][PATCH 2/4] hugetlb: fix pool allocation with empty nodes
Date: Wed, 8 Aug 2007 17:49:14 -0700 [thread overview]
Message-ID: <20070809004914.GI16588@us.ibm.com> (raw)
In-Reply-To: <20070809004726.GH16588@us.ibm.com>
[V10] hugetlb: fix pool allocation with empty nodes
Anton found a problem with the hugetlb pool allocation when some nodes
have no memory (http://marc.info/?l=linux-mm&m=118133042025995&w=2). Lee
worked on versions that tried to fix it, but none were accepted.
Christoph has created a set of patches which allow for GFP_THISNODE
allocations to fail if the node has no memory and for exporting a
nodemask indicating which nodes have memory. Simply interleave across
this nodemask rather than the online nodemask.
---
Note: given that alloc_fresh_huge_page() now interleaves using
GFP_THISNODE, it might be the case that this patch is no longer needed?
Instead, we'll just end up skipping over those memoryless nodes more
when we could just ignore them altogether.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Cc: Anton Blanchard <anton@samba.org>
Cc: Lee Schermerhorn <lee.schermerhon@hp.com>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: William Lee Irwin III <wli@holomorphy.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 7f6ab1b..7ca37f6 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -129,7 +129,7 @@ static int alloc_fresh_huge_page(void)
int ret = 0;
if (nid < 0)
- nid = first_node(node_online_map);
+ nid = first_node(node_states[N_HIGH_MEMORY]);
start_nid = nid;
do {
@@ -147,9 +147,9 @@ static int alloc_fresh_huge_page(void)
* successfully allocated a hugepage so that the next
* caller gets hugepages on the next node.
*/
- next_nid = next_node(nid, node_online_map);
+ next_nid = next_node(nid, node_states[N_HIGH_MEMORY]);
if (next_nid == MAX_NUMNODES)
- next_nid = first_node(node_online_map);
+ next_nid = first_node(node_states[N_HIGH_MEMORY]);
nid = next_nid;
} while (!page && nid != start_nid);
--
Nishanth Aravamudan <nacc@us.ibm.com>
IBM Linux Technology Center
--
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:[~2007-08-09 0:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-09 0:47 [RFC][PATCH 1/4] hugetlb: search harder for memory in alloc_fresh_huge_page() Nishanth Aravamudan
2007-08-09 0:49 ` Nishanth Aravamudan [this message]
2007-08-09 0:51 ` [RFC][PATCH 3/4] hugetlb: interleave dequeueing of huge pages Nishanth Aravamudan
2007-08-09 0:52 ` [RFC][PATCH 4/4] hugetlb: add per-node nr_hugepages sysfs attribute Nishanth Aravamudan
2007-08-13 17:55 ` Dave Hansen
2007-08-22 21:17 ` Nishanth Aravamudan
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=20070809004914.GI16588@us.ibm.com \
--to=nacc@us.ibm.com \
--cc=anton@samba.org \
--cc=clameter@sgi.com \
--cc=lee.schermerhorn@hp.com \
--cc=linux-mm@kvack.org \
--cc=wli@holomorphy.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox