RFC mm: shrink_all_memory improvements
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest2 patches 11 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | mm: make shrink_all_memory overflow-resistantinclude/ mm/ | +6 | 6 replies | |
| 2/2 | mm: make shrink_all_memory try hardermm/ | +15 | 4 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC][PATCH -mm 0/2] mm: shrink_all_memory improvements
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
Signature · 1 line
Beer is proof that God loves us and wants us to be happy - Benjamin Franklin