swapfile.c (64165b1affc5bc16231ac971e66aae7d68d57f2c) swapfile.c (af53d3e9e04024885de5b4fda51e5fa362ae2bd8)
1/*
2 * linux/mm/swapfile.c
3 *
4 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
5 * Swap reorganised 29.12.95, Stephen Tweedie
6 */
7
8#include <linux/mm.h>

--- 2102 unchanged lines hidden (view full) ---

2111 }
2112
2113 /*
2114 * Lets check again to see if there are still swap entries in the map.
2115 * If yes, we would need to do retry the unuse logic again.
2116 * Under global memory pressure, swap entries can be reinserted back
2117 * into process space after the mmlist loop above passes over them.
2118 *
1/*
2 * linux/mm/swapfile.c
3 *
4 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
5 * Swap reorganised 29.12.95, Stephen Tweedie
6 */
7
8#include <linux/mm.h>

--- 2102 unchanged lines hidden (view full) ---

2111 }
2112
2113 /*
2114 * Lets check again to see if there are still swap entries in the map.
2115 * If yes, we would need to do retry the unuse logic again.
2116 * Under global memory pressure, swap entries can be reinserted back
2117 * into process space after the mmlist loop above passes over them.
2118 *
2119 * Limit the number of retries? No: when shmem_unuse()'s igrab() fails,
2120 * a shmem inode using swap is being evicted; and when mmget_not_zero()
2121 * above fails, that mm is likely to be freeing swap from exit_mmap().
2122 * Both proceed at their own independent pace: we could move them to
2123 * separate lists, and wait for those lists to be emptied; but it's
2124 * easier and more robust (though cpu-intensive) just to keep retrying.
2119 * Limit the number of retries? No: when mmget_not_zero() above fails,
2120 * that mm is likely to be freeing swap from exit_mmap(), which proceeds
2121 * at its own independent pace; and even shmem_writepage() could have
2122 * been preempted after get_swap_page(), temporarily hiding that swap.
2123 * It's easy and robust (though cpu-intensive) just to keep retrying.
2125 */
2126 if (si->inuse_pages) {
2127 if (!signal_pending(current))
2128 goto retry;
2129 retval = -EINTR;
2130 }
2131out:
2132 return (retval == FRONTSWAP_PAGES_UNUSED) ? 0 : retval;

--- 1543 unchanged lines hidden ---
2124 */
2125 if (si->inuse_pages) {
2126 if (!signal_pending(current))
2127 goto retry;
2128 retval = -EINTR;
2129 }
2130out:
2131 return (retval == FRONTSWAP_PAGES_UNUSED) ? 0 : retval;

--- 1543 unchanged lines hidden ---