Re: [linux-pm] [PATCH] swsusp: simpler calculation of number of pages in PBE list

2005-07-30 Thread Alan Stern
On Sat, 30 Jul 2005, Rafael J. Wysocki wrote: > Hi, > > On Saturday, 30 of July 2005 15:13, Pavel Machek wrote: > > Hi! > > > > > > px >= n + x > > > > > > > > or > > > > > > > > (p-1)x >= n > > > > > > > > or > > > > > > > > x >= n / (p-1). > > > > > > > > The obvio

[PATCH] swsusp: simpler calculation of number of pages in PBE list

2005-07-30 Thread Pavel Machek
From: Michal Schmidt <[EMAIL PROTECTED]> The function calc_nr uses an iterative algorithm to calculate the number of pages needed for the image and the pagedir. Exactly the same result can be obtained with a one-line expression. Note that this was even proved correct ;-). Signed-off-by: Michal S

Re: [linux-pm] [PATCH] swsusp: simpler calculation of number of pages in PBE list

2005-07-30 Thread Rafael J. Wysocki
Hi, On Saturday, 30 of July 2005 15:13, Pavel Machek wrote: > Hi! > > > > px >= n + x > > > > > > or > > > > > > (p-1)x >= n > > > > > > or > > > > > > x >= n / (p-1). > > > > > > The obvious solution is > > > > > > x = ceiling(n / (p-1)), > > > > > > so calc_nr should return n + c

Re: [PATCH] swsusp: simpler calculation of number of pages in PBE list

2005-07-30 Thread Pavel Machek
On Pá 29-07-05 21:46:40, Michal Schmidt wrote: > The function calc_nr uses an iterative algorithm to calculate the number > of pages needed for the image and the pagedir. Exactly the same result > can be obtained with a one-line expression. > > Signed-off-by: Michal Schmidt <[EMAIL PROTECTED]>

Re: [linux-pm] [PATCH] swsusp: simpler calculation of number of pages in PBE list

2005-07-30 Thread Pavel Machek
Hi! > > px >= n + x > > > > or > > > > (p-1)x >= n > > > > or > > > > x >= n / (p-1). > > > > The obvious solution is > > > > x = ceiling(n / (p-1)), > > > > so calc_nr should return n + ceiling(n / (p-1)), which is exactly what > > Michal's patch computes. > > Nice. :-) >

Re: [linux-pm] [PATCH] swsusp: simpler calculation of number of pages in PBE list

2005-07-30 Thread Rafael J. Wysocki
On Saturday, 30 of July 2005 03:35, Alan Stern wrote: > On Fri, 29 Jul 2005, Michal Schmidt wrote: > > > Rafael J. Wysocki wrote: > > > On Friday, 29 of July 2005 21:46, Michal Schmidt wrote: > > > > > >>The function calc_nr uses an iterative algorithm to calculate the number > > >>of pages need

Re: [linux-pm] [PATCH] swsusp: simpler calculation of number of pages in PBE list

2005-07-29 Thread Alan Stern
On Fri, 29 Jul 2005, Michal Schmidt wrote: > Rafael J. Wysocki wrote: > > On Friday, 29 of July 2005 21:46, Michal Schmidt wrote: > > > >>The function calc_nr uses an iterative algorithm to calculate the number > >>of pages needed for the image and the pagedir. Exactly the same result > >>can b

Re: [linux-pm] [PATCH] swsusp: simpler calculation of number of pages in PBE list

2005-07-29 Thread Rafael J. Wysocki
On Friday, 29 of July 2005 23:14, Michal Schmidt wrote: > Rafael J. Wysocki wrote: > > On Friday, 29 of July 2005 21:46, Michal Schmidt wrote: > > > >>The function calc_nr uses an iterative algorithm to calculate the number > >>of pages needed for the image and the pagedir. Exactly the same resul

Re: [linux-pm] [PATCH] swsusp: simpler calculation of number of pages in PBE list

2005-07-29 Thread Michal Schmidt
Rafael J. Wysocki wrote: On Friday, 29 of July 2005 21:46, Michal Schmidt wrote: The function calc_nr uses an iterative algorithm to calculate the number of pages needed for the image and the pagedir. Exactly the same result can be obtained with a one-line expression. Could you please post

Re: [linux-pm] [PATCH] swsusp: simpler calculation of number of pages in PBE list

2005-07-29 Thread Rafael J. Wysocki
On Friday, 29 of July 2005 21:46, Michal Schmidt wrote: > The function calc_nr uses an iterative algorithm to calculate the number > of pages needed for the image and the pagedir. Exactly the same result > can be obtained with a one-line expression. Could you please post the proof? Rafael --

[PATCH] swsusp: simpler calculation of number of pages in PBE list

2005-07-29 Thread Michal Schmidt
The function calc_nr uses an iterative algorithm to calculate the number of pages needed for the image and the pagedir. Exactly the same result can be obtained with a one-line expression. Signed-off-by: Michal Schmidt <[EMAIL PROTECTED]> diff -Nurp -X dontdiff.new linux-mm/kernel/power/swsusp.c