Commit 730cdc2
mm/ksm: fix ksm_pages_scanned accounting
Patch series "mm/ksm: fix some accounting problems", v3.
We encountered some abnormal ksm_pages_scanned and ksm_zero_pages during
some random tests.
1. ksm_pages_scanned unchanged even ksmd scanning has progress.
2. ksm_zero_pages maybe -1 in some rare cases.
This patch (of 2):
During testing, I found ksm_pages_scanned is unchanged although the
scan_get_next_rmap_item() did return valid rmap_item that is not NULL.
The reason is the scan_get_next_rmap_item() will return NULL after a full
scan, so ksm_do_scan() just return without accounting of the
ksm_pages_scanned.
Fix it by just putting ksm_pages_scanned accounting in that loop, and it
will be accounted more timely if that loop would last for a long time.
Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Fixes: b348b5f ("mm/ksm: add pages scanned metric")
Signed-off-by: Chengming Zhou <[email protected]>
Acked-by: David Hildenbrand <[email protected]>
Reviewed-by: xu xin <[email protected]>
Cc: Andrea Arcangeli <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Ran Xiaokai <[email protected]>
Cc: Stefan Roesch <[email protected]>
Cc: Yang Yang <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>1 parent 2ef3cec commit 730cdc2
1 file changed
+2
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2754 | 2754 | | |
2755 | 2755 | | |
2756 | 2756 | | |
2757 | | - | |
2758 | 2757 | | |
2759 | | - | |
| 2758 | + | |
2760 | 2759 | | |
2761 | 2760 | | |
2762 | 2761 | | |
2763 | 2762 | | |
2764 | 2763 | | |
2765 | 2764 | | |
| 2765 | + | |
2766 | 2766 | | |
2767 | | - | |
2768 | | - | |
2769 | 2767 | | |
2770 | 2768 | | |
2771 | 2769 | | |
| |||
0 commit comments