mm: factor out common parts between MADV_COLD and MADV_PAGEOUT

There are many common parts between MADV_COLD and MADV_PAGEOUT.
This patch factor them out to save code duplication.

Signed-off-by: Minchan Kim <>
Suggested-by: Johannes Weiner <>
Acked-by: Michal Hocko <>
Cc: Chris Zankel <>
Cc: Daniel Colascione <>
Cc: Dave Hansen <>
Cc: Hillf Danton <>
Cc: James E.J. Bottomley <>
Cc: Joel Fernandes (Google) <>
Cc: kbuild test robot <>
Cc: Kirill A. Shutemov <>
Cc: Oleksandr Natalenko <>
Cc: Ralf Baechle <>
Cc: Richard Henderson <>
Cc: Shakeel Butt <>
Cc: Sonny Rao <>
Cc: Suren Baghdasaryan <>
Cc: Tim Murray <>
Signed-off-by: Andrew Morton <>
1 file changed