lkml.org 
[lkml]   [2008]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] [4/18] Add basic support for more than one hstate in hugetlbfs
From
Date
With this patch you will call try_to_free_low on all registered page
sizes. As written, when a user reduces the number of one page size, all
page sizes could be affected. I don't think that's what you want to do.
Perhaps just call do_try_to_free_low() on the hstate in question.

On Mon, 2008-03-17 at 02:58 +0100, Andi Kleen wrote:
> Signed-off-by: Andi Kleen <ak@suse.de>
>
> ---
> mm/hugetlb.c | 15 +++++++++++----
> 1 file changed, 11 insertions(+), 4 deletions(-)
>
> Index: linux/mm/hugetlb.c
> ===================================================================
> --- linux.orig/mm/hugetlb.c
> +++ linux/mm/hugetlb.c
> @@ -550,26 +550,33 @@ static unsigned int cpuset_mems_nr(unsig
>
> #ifdef CONFIG_SYSCTL
> #ifdef CONFIG_HIGHMEM
> -static void try_to_free_low(unsigned long count)
> +static void do_try_to_free_low(struct hstate *h, unsigned long count)
> {
> - struct hstate *h = &global_hstate;
> int i;
>
> for (i = 0; i < MAX_NUMNODES; ++i) {
> struct page *page, *next;
> struct list_head *freel = &h->hugepage_freelists[i];
> list_for_each_entry_safe(page, next, freel, lru) {
> - if (count >= nr_huge_pages)
> + if (count >= h->nr_huge_pages)
> return;
> if (PageHighMem(page))
> continue;
> list_del(&page->lru);
> - update_and_free_page(page);
> + update_and_free_page(h, page);
> h->free_huge_pages--;
> h->free_huge_pages_node[page_to_nid(page)]--;
> }
> }
> }
> +
> +static void try_to_free_low(unsigned long count)
> +{
> + struct hstate *h;
> + for_each_hstate (h) {
> + do_try_to_free_low(h, count);
> + }
> +}
> #else
> static inline void try_to_free_low(unsigned long count)
> {
>
> --
> 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>
>
--
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center



\
 
 \ /
  Last update: 2008-03-17 21:29    [W:0.601 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site