lkml.org 
[lkml]   [2005]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [swsusp] Rework image freeing
Date
Hi,

On Thursday, 22 of September 2005 11:46, Pavel Machek wrote:
> Hi!
>
> > > -
> > > -/**
> > > - * calc_nr - Determine the number of pages needed for a pbe list.
> > > - */
> > > -
> > > -static int calc_nr(int nr_copy)
> > > -{
> > > - return nr_copy + (nr_copy+PBES_PER_PAGE-2)/(PBES_PER_PAGE-1);
> > > -}
> >
> > I can't see why you are going to drop this function. Isn't it necessary any more?
>
> I've actually decreased on-disk memory requirements by... guess what:
> (nr_copy+PBES_PER_PAGE-2)/(PBES_PER_PAGE-1) factor. I do not store two
> copies of page directories any more.

On-disk - yes, but we still need to allocate RAM to create the "pagedir".
It takes ca (nr_copy_pages/(PBS_PER_PAGE-1) + !!(nr_copy_pages % (PBS_PER_PAGE-1))),
so we should include this number in the check for free RAM and in the message
in swsusp_alloc(), I think.

Besides, the checks for free RAM and swap could be moved to
suspend_prepare_image(), along with the accompanying printk()s,
so that we call swsusp_alloc() only after we have verified there should
be enough resources.

Greetings,
Rafael


--
- Would you tell me, please, which way I ought to go from here?
- That depends a good deal on where you want to get to.
-- Lewis Carroll "Alice's Adventures in Wonderland"
-
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-09-23 22:58    [W:0.053 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site