On Thu, Jul 27, 2017 at 06:06:56PM +0200, Vlastimil Babka wrote: > The code of kswapd_try_to_sleep() is unnecessarily hard to follow. Also we > needlessly call prepare_kswapd_sleep() twice, if the first one fails. > Restructure the code so that each non-success case is accounted and returns > immediately. > > This patch should not introduce any functional change, except when the first > prepare_kswapd_sleep() would have returned false, and then the second would be > true (because somebody else has freed memory), kswapd would sleep before this > patch and now it won't. This has likely been an accidental property of the > implementation, and extremely rare to happen in practice anyway. > > Signed-off-by: Vlastimil Babka <vbabka@xxxxxxx> Acked-by: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx> -- Mel Gorman SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>