On Fri, 2008-10-03 at 18:37 +0100, Andy Whitcroft wrote:
> @@ -446,6 +447,91 @@ void __lh_setup_mounts(void)
>               debug_show_page_sizes();
>  }
> 
> +#define MAX_POOLS 32
> +int __lh_hpool_sizes(struct hpage_pool *pools, int pcnt)
> +{
> +     long default_size;
> +     int which = 0;
> +     DIR *dir;
> +     struct dirent *entry;
> +
> +     long nr_static;
> +     long nr_over;
> +     long nr_used;
> +     long nr_resv;
> +     long nr_surp;
> +
> +     default_size = size_to_smaller_unit(file_read_ulong(MEMINFO,
> +                                                     "Hugepagesize:"));
> +     if (default_size >= 0) {
> +             nr_used = get_huge_page_counter(default_size, HUGEPAGES_TOTAL);
> +             nr_surp = get_huge_page_counter(default_size, HUGEPAGES_SURP);
> +             nr_over = get_huge_page_counter(default_size, HUGEPAGES_OC);
> +             nr_resv = get_huge_page_counter(default_size, HUGEPAGES_RSVD);
> +
> +             /*
> +              * XXX: this is racy with respect to ongoing
> +              * allocations.  We need to a nr_static_hugepages.
> +              */
> +             nr_static = nr_used - nr_surp;

Should we do some race detection and either print a warning message or
retry when a race is observed?  We could recheck nr_used and nr_surp and
complain/retry if either value has changed.

-- 
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Libhugetlbfs-devel mailing list
Libhugetlbfs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel

Reply via email to