Commit a095090
mm: shmem: fix ShmemHugePages at swapout
commit dad2dc9 upstream.
/proc/meminfo ShmemHugePages has been showing overlarge amounts (more than
Shmem) after swapping out THPs: we forgot to update NR_SHMEM_THPS.
Add shmem_update_stats(), to avoid repetition, and risk of making that
mistake again: the call from shmem_delete_from_page_cache() is the bugfix;
the call from shmem_replace_folio() is reassuring, but not really a bugfix
(replace corrects misplaced swapin readahead, but huge swapin readahead
would be a mistake).
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 809bc86 ("mm: shmem: support large folio swap out")
Signed-off-by: Hugh Dickins <[email protected]>
Reviewed-by: Shakeel Butt <[email protected]>
Reviewed-by: Yosry Ahmed <[email protected]>
Reviewed-by: Baolin Wang <[email protected]>
Tested-by: Baolin Wang <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent cb12d61 commit a095090
1 file changed
Lines changed: 12 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
779 | 779 | | |
780 | 780 | | |
781 | 781 | | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
782 | 790 | | |
783 | 791 | | |
784 | 792 | | |
| |||
813 | 821 | | |
814 | 822 | | |
815 | 823 | | |
816 | | - | |
817 | | - | |
818 | | - | |
819 | | - | |
| 824 | + | |
820 | 825 | | |
821 | 826 | | |
822 | 827 | | |
| |||
844 | 849 | | |
845 | 850 | | |
846 | 851 | | |
847 | | - | |
848 | | - | |
| 852 | + | |
849 | 853 | | |
850 | 854 | | |
851 | 855 | | |
| |||
1944 | 1948 | | |
1945 | 1949 | | |
1946 | 1950 | | |
1947 | | - | |
1948 | | - | |
1949 | | - | |
1950 | | - | |
| 1951 | + | |
| 1952 | + | |
1951 | 1953 | | |
1952 | 1954 | | |
1953 | 1955 | | |
| |||
0 commit comments