Repository navigation
Commit 0dd1c7b
mm/rmap: extend rmap_walk_xxx() to cope with different cases
There are a lot of common parts in traversing functions, but there are
also a little of uncommon parts in it. By assigning proper function
pointer on each rmap_walker_control, we can handle these difference
correctly.
Following are differences we should handle.
1. difference of lock function in anon mapping case
2. nonlinear handling in file mapping case
3. prechecked condition:
checking memcg in page_referenced(),
checking VM_SHARE in page_mkclean()
checking temporary vma in try_to_unmap()
4. exit condition:
checking page_mapped() in try_to_unmap()
So, in this patch, I introduce 4 function pointers to handle above
differences.
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Hugh Dickins <hughd@google.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>1 parent 051ac83 commit 0dd1c7b
3 files changed
Lines changed: 51 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
238 | 248 | | |
239 | 249 | | |
240 | 250 | | |
241 | 251 | | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
242 | 257 | | |
243 | 258 | | |
244 | 259 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2032 | 2032 | | |
2033 | 2033 | | |
2034 | 2034 | | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
2035 | 2038 | | |
2036 | 2039 | | |
2037 | 2040 | | |
2038 | 2041 | | |
2039 | 2042 | | |
2040 | 2043 | | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
2041 | 2048 | | |
2042 | 2049 | | |
2043 | 2050 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1684 | 1684 | | |
1685 | 1685 | | |
1686 | 1686 | | |
1687 | | - | |
| 1687 | + | |
| 1688 | + | |
1688 | 1689 | | |
1689 | 1690 | | |
1690 | 1691 | | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
1691 | 1695 | | |
1692 | 1696 | | |
1693 | 1697 | | |
| |||
1713 | 1717 | | |
1714 | 1718 | | |
1715 | 1719 | | |
1716 | | - | |
| 1720 | + | |
1717 | 1721 | | |
1718 | 1722 | | |
1719 | 1723 | | |
1720 | 1724 | | |
1721 | 1725 | | |
1722 | 1726 | | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
1723 | 1731 | | |
1724 | 1732 | | |
1725 | 1733 | | |
| 1734 | + | |
| 1735 | + | |
1726 | 1736 | | |
1727 | 1737 | | |
1728 | 1738 | | |
| |||
1740 | 1750 | | |
1741 | 1751 | | |
1742 | 1752 | | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
1743 | 1757 | | |
1744 | 1758 | | |
1745 | | - | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
1746 | 1762 | | |
1747 | | - | |
1748 | | - | |
1749 | | - | |
1750 | | - | |
1751 | | - | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
1752 | 1773 | | |
1753 | 1774 | | |
1754 | 1775 | | |
| |||
0 commit comments