Commit dad2dc9
mm: shmem: fix ShmemHugePages at swapout
/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/5ba477c8-a569-70b5-923e-09ab221af45b@google.com
Fixes: 809bc86 ("mm: shmem: support large folio swap out")
Signed-off-by: Hugh Dickins <hughd@google.com>
Reviewed-by: Shakeel Butt <shakeel.butt@linux.dev>
Reviewed-by: Yosry Ahmed <yosryahmed@google.com>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Tested-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>1 parent 7782e3b commit dad2dc9
1 file changed
Lines changed: 12 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
787 | 787 | | |
788 | 788 | | |
789 | 789 | | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
790 | 798 | | |
791 | 799 | | |
792 | 800 | | |
| |||
821 | 829 | | |
822 | 830 | | |
823 | 831 | | |
824 | | - | |
825 | | - | |
826 | | - | |
827 | | - | |
| 832 | + | |
828 | 833 | | |
829 | 834 | | |
830 | 835 | | |
| |||
852 | 857 | | |
853 | 858 | | |
854 | 859 | | |
855 | | - | |
856 | | - | |
| 860 | + | |
857 | 861 | | |
858 | 862 | | |
859 | 863 | | |
| |||
1969 | 1973 | | |
1970 | 1974 | | |
1971 | 1975 | | |
1972 | | - | |
1973 | | - | |
1974 | | - | |
1975 | | - | |
| 1976 | + | |
| 1977 | + | |
1976 | 1978 | | |
1977 | 1979 | | |
1978 | 1980 | | |
| |||
0 commit comments