[RFC][PATCH -mm 0/2] mm: shrink_all_memory improvements

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux