lkml.org 
[lkml]   [2008]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] [2/18] Add basic support for more than one hstate in hugetlbfs
Hi Andi

sorry for very late review.

> @@ -497,11 +501,34 @@ static int __init hugetlb_init(void)
> break;
> }
> max_huge_pages = h->free_huge_pages = h->nr_huge_pages = i;
> - printk("Total HugeTLB memory allocated, %ld\n", h->free_huge_pages);
> +
> + printk(KERN_INFO "Total HugeTLB memory allocated, %ld %dMB pages\n",
> + h->free_huge_pages,
> + 1 << (h->order + PAGE_SHIFT - 20));
> return 0;
> }

IA64 arch support 64k hugepage, assumption >1MB size is wrong.


> +/* Should be called on processing a hugepagesz=... option */
> +void __init huge_add_hstate(unsigned order)
> +{
> + struct hstate *h;
> + BUG_ON(max_hstate >= HUGE_MAX_HSTATE);
> + BUG_ON(order <= HPAGE_SHIFT - PAGE_SHIFT);
> + h = &hstates[max_hstate++];
> + h->order = order;
> + h->mask = ~((1ULL << (order + PAGE_SHIFT)) - 1);
> + hugetlb_init_hstate(h);
> + parsed_hstate = h;
> +}

this function is called once by one boot parameter, right?
if so, this function cause panic when stupid user write many
hugepagesz boot parameter.

Why don't you use following check.

if (max_hstate >= HUGE_MAX_HSTATE) {
printk("hoge hoge");
return;
}



- kosaki




\
 
 \ /
  Last update: 2008-03-23 11:41    [W:0.256 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site