public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH -mm 0/2] mm: shrink_all_memory improvements
@ 2006-02-27 18:26 Rafael J. Wysocki
  2006-02-27 18:28 ` [RFC][PATCH -mm 1/2] mm: make shrink_all_memory overflow-resistant Rafael J. Wysocki
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Rafael J. Wysocki @ 2006-02-27 18:26 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Andrew Morton, LKML

Hi,

The following two patches are designed to improve the shrink_all_memory()
function used by swsusp and other pm functions.

The first patch makes shrink_all_memory() overflow-resistant.  The problem is
that, AFAICT, balance_pgdat(pgdat, nr_to_free, 0) may free more than nr_to_free
pages, in which case nr_to_free, being unsigned, will overflow (and obviously
it cannot be less than 0).  Also if the argument is too big, strange things may
happen.

The first patch adds a workaround of the problem that shrink_all_memory() may
return 0 even if there still are some pages to free.  WIth this patch applied
it sometimes frees 2 times as many pages as without it on my box.

Please have a look and comment.

Greetings,
Rafael


-- 
Beer is proof that God loves us and wants us to be happy - Benjamin Franklin


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2006-02-28 23:04 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-27 18:26 [RFC][PATCH -mm 0/2] mm: shrink_all_memory improvements Rafael J. Wysocki
2006-02-27 18:28 ` [RFC][PATCH -mm 1/2] mm: make shrink_all_memory overflow-resistant Rafael J. Wysocki
2006-02-27 18:53   ` Jesper Juhl
2006-02-27 19:02     ` Pavel Machek
2006-02-27 19:06       ` Jesper Juhl
2006-02-27 23:15     ` Rafael J. Wysocki
2006-02-28  3:16   ` Andrew Morton
2006-02-28 17:28     ` Rafael J. Wysocki
2006-02-27 18:30 ` [RFC][PATCH -mm 2/2] mm: make shrink_all_memory try harder Rafael J. Wysocki
2006-02-28  3:25   ` Andrew Morton
2006-02-28 17:25     ` Rafael J. Wysocki
2006-02-28 18:46       ` Andrew Morton
2006-02-28 23:04         ` Rafael J. Wysocki
2006-02-27 18:33 ` [RFC][PATCH -mm 0/2] mm: shrink_all_memory improvements Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox