From: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
To: David Rientjes <rientjes@google.com>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org,
Mel Gorman <mel@csn.ul.ie>, Nishanth Aravamudan <nacc@us.ibm.com>,
Adam Litke <agl@us.ibm.com>
Subject: Re: [PATCH 1/1] Balance Freeing of Huge Pages across Nodes
Date: Mon, 29 Jun 2009 00:55:36 -0400 [thread overview]
Message-ID: <1246251336.30751.3.camel@lts-notebook> (raw)
In-Reply-To: <alpine.DEB.2.00.0906281646110.8440@chino.kir.corp.google.com>
On Sun, 2009-06-28 at 16:54 -0700, David Rientjes wrote:
> On Fri, 26 Jun 2009, Lee Schermerhorn wrote:
>
> > [PATCH] 1/1 Balance Freeing of Huge Pages across Nodes
> >
> > Against: 12jun09 mmotm
> >
> > [applies to 25jun09 mmotm as well]
> >
> > Free huges pages from nodes in round robin fashion in an
> > attempt to keep [persistent a.k.a static] hugepages balanced
> > across nodes
> >
> > New function free_pool_huge_page() is modeled on and
> > performs roughly the inverse of alloc_fresh_huge_page().
> > Replaces dequeue_huge_page() which now has no callers,
> > so this patch removes it.
> >
> > Helper function hstate_next_node_to_free() uses new hstate
> > member next_to_free_nid to distribute "frees" across all
> > nodes with huge pages.
> >
> > V2:
> >
> > At Mel Gorman's suggestion: renamed hstate_next_node() to
> > hstate_next_node_to_alloc() for symmetry. Also, renamed
> > hstate member hugetlb_next_node to next_node_to_free.
> > ["hugetlb" is implicit in the hstate struct, I think].
> >
> > New in this version:
> >
> > Modified adjust_pool_surplus() to use hstate_next_node_to_alloc()
> > and hstate_next_node_to_free() to advance node id for adjusting
> > surplus huge page count, as this is equivalent to allocating and
> > freeing persistent huge pages. [Can't blame Mel for this part.]
> >
> > Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
>
> Acked-by: David Rientjes <rientjes@google.com>
>
> Very useful change!
Thanks, David.
Unfortunately, as I've been working on the next set of changes
[mempolicy-based and per node controls], I noticed that I should
probably fix up return_unused_surplus_pages(), as well. So, I'll send
out v3 of this patch, maybe with a Documentation update, real soon, I
hope.
Lee
>
> > @@ -666,14 +648,15 @@ static int alloc_fresh_huge_page(struct
> > int next_nid;
> > int ret = 0;
> >
> > - start_nid = h->hugetlb_next_nid;
> > + start_nid = h->next_nid_to_alloc;
> > + next_nid = start_nid;
> >
> > do {
> > - page = alloc_fresh_huge_page_node(h, h->hugetlb_next_nid);
> > + page = alloc_fresh_huge_page_node(h, next_nid);
> > if (page)
> > ret = 1;
> > - next_nid = hstate_next_node(h);
> > - } while (!page && h->hugetlb_next_nid != start_nid);
> > + next_nid = hstate_next_node_to_alloc(h);
> > + } while (!page && next_nid != start_nid);
> >
> > if (ret)
> > count_vm_event(HTLB_BUDDY_PGALLOC);
>
> This actually puts the currently unused next_nid to use, nice.
>
> --
> 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>
--
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>
prev parent reply other threads:[~2009-06-29 4:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-26 20:15 [PATCH 0/1] " Lee Schermerhorn
2009-06-26 20:15 ` [PATCH 1/1] " Lee Schermerhorn
2009-06-28 23:54 ` David Rientjes
2009-06-29 4:55 ` Lee Schermerhorn [this message]
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=1246251336.30751.3.camel@lts-notebook \
--to=lee.schermerhorn@hp.com \
--cc=agl@us.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
--cc=nacc@us.ibm.com \
--cc=rientjes@google.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