Re: [PATCH] Free swap suspend from dependency on PageReserved

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2005-10-06 at 07:04 +1000, Nigel Cunningham wrote:
> 
> +       for (tmp = 0; tmp < max_low_pfn; tmp++, addr += PAGE_SIZE) {
> +               if (page_is_ram(tmp)) {
> +                       /*
> +                        * Only count reserved RAM pages
> +                        */
> +                       if (PageReserved(mem_map+tmp))
> +                               reservedpages++;

Please don't reference mem_map[] directly outside of #ifdef
CONFIG_FLATMEM areas.  It is not defined for all config cases.  Please
use pfn_to_page(), instead.  It should work in all cases where the page
is valid.

Also, instead of keeping addr defined like you do, and comparing it
during each run of the loop, why not just use pfn_is_nosave(), which is
already defined?  Then, you won't even need the variable.

-- Dave

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux