It's possible for a user fault to be triggered during task exit that
results in swap readahead, which is not useful. Skip swap readahead
if the current process is exiting.
Change-Id: I5fad20ebdcc616af732254705726d395eb118cbe
Signed-off-by: Tim Murray <timmurray@google.com>
I know swap is not used with my kernel.
Just picking for future references.
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
if (!mask)
goto skip;
+ /* If exiting, don't do swap readahead. */
+ if (current->flags & PF_EXITING)
+ goto skip;
+
/* Read a page_cluster sized and aligned cluster around offset. */
start_offset = offset & ~mask;
end_offset = offset | mask;