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

On Mon, 2005-07-11 at 04:12, Pavel Machek wrote:
> Hi!
>
> > + //p->pageset_size = pageset_size;
>
> Please don't leave commented code in.

Fixed.

> > +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?

Done.

> > +#define pageset1_size (pagedir1.pageset_size)
> > +#define pageset2_size (pagedir2.pageset_size)
>
> This only makes reading code harder...

Removed.

Regards,

Nigel
--
Evolution.
Enumerate the requirements.
Consider the interdependencies.
Calculate the probabilities.
Be amazed that people believe it happened.

-
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-12 10:46    [W:0.114 / U:2.416 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site