lkml.org 
[lkml]   [2005]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] [35/48] Suspend2 2.1.9.8 for 2.6.12: 611-io.patch
Hi!

> + //p->pageset_size = pageset_size;

Please don't leave commented code in.

> +unsigned long suspend2_get_nonconflicting_pages(const int order)
> +{
> + struct page * page;
> + unsigned long new_page;
> + int more = 0;
> + unsigned long pgcount;
> +
> + do {
> + new_page = __get_free_pages(GFP_ATOMIC | __GFP_NOWARN, order);
> + if (!new_page)
> + return 0;
> + more = 0;
> + for (pgcount = 0; pgcount < (1UL << order); pgcount++) {
> + page = virt_to_page(new_page + PAGE_SIZE * pgcount);
> + if (PagePageset1(page)) {
> + more = 1;
> + break;
> + }
> + }
> + if (more) {
> + page = virt_to_page(new_page);
> + list_add(&page->lru, &conflicting_pages);
> +
> + /* since this page is technically free, we can abuse it to
> + * store the order. When we resume it'll just be overwritten,
> + * but we need this value when freeing it in
> + * suspend2_release_conflicting_pages. */
> + *((int*)new_page) = order;
> + }
> + }
> + while (more);
> +
> + memset((void*)new_page, 0, PAGE_SIZE * (1<<order));
> + return new_page;
> +}
> +
> +/* suspend2_get_nonconflicting_page
> + *
> + * Description: Gets a page that will not be overwritten as we copy the
> + * original kernel page.
> + */
> +
> +unsigned long suspend2_get_nonconflicting_page(void)
> +{
> + return suspend2_get_nonconflicting_pages(0);
> +}

Can you just replace it in callers?

> +#define pageset1_size (pagedir1.pageset_size)
> +#define pageset2_size (pagedir2.pageset_size)

This only makes reading code harder...

Pavel
--
teflon -- maybe it is a trademark, but it should not be.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-07-10 20:15    [W:0.494 / U:1.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site