lkml.org 
[lkml]   [2012]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v9]: Hibernation: fix the number of pages used for hibernate/thaw buffering
On 2012-04-10 04:47, Bojan Smojver wrote:
> +/*
> + * Number of free pages that are not high.
> + */
> +static unsigned long low_free_pages(void)
> +{
> + struct zone *zone;
> + unsigned long free = 0;
> +
> + for_each_populated_zone(zone)
> + if (!is_highmem(zone))
> + free += zone_page_state(zone, NR_FREE_PAGES);
> + return free;
> +}

Nitpick: it should be faster to calculate "nr_free_pages() -
nr_free_highpages()", at least on systems without high pages. But
perhaps it does not matter.

--
Pelle


\
 
 \ /
  Last update: 2012-04-10 10:51    [W:0.045 / U:0.856 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site