Skip to contentSkip to conversation

Patch 2/2: Add compression support to swsusp.

DISCUSSION Pavel Machek 2 participants 2 messages Jul 8, 2009 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Review static int enough_swap(unsigned int nr_pages) · line 445

Quoted 10 lines
(quoted diff) +1 -1
@@ -437,7 +439,7 @@ static int enough_swap(unsigned int nr_pages)
 	unsigned int free_swap = count_swap_pages(root_swap, 1);
 
 	pr_debug("PM: Free swap pages: %u\n", free_swap);
-	return free_swap > (nr_pages + PAGES_FOR_IO) * 1.01;
+	return free_swap > (nr_pages + PAGES_FOR_IO) * .6;
 }
 
 /**

This is buggy and was buggy before. We may not use floating point in kernel...

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Hi.

Quoted 8 lines · Pavel Machek
Quoted 8 lines
(quoted diff) +1 -1
@@ -437,7 +439,7 @@ static int enough_swap(unsigned int nr_pages)
 	unsigned int free_swap = count_swap_pages(root_swap, 1);
 
 	pr_debug("PM: Free swap pages: %u\n", free_swap);
-	return free_swap > (nr_pages + PAGES_FOR_IO) * 1.01;
+	return free_swap > (nr_pages + PAGES_FOR_IO) * .6;
 }
 
Quoted 4 lines

Review static int enough_swap(unsigned int nr_pages) · line 445

Quoted 1 line
(quoted diff) +0 -0
 /**

This is buggy and was buggy before. We may not use floating point in kernel...

Yeah. Already rewritten. I was trying to simplify things for swsusp, but decided I should just do it right first time.

Regards,

Nigel