[PATCH 0/4] mm/ksm: fix some accounting problems

Chengming Zhou posted 4 patches 1 year, 7 months ago
There is a newer version of this series
fs/proc/base.c           |  2 +-
include/linux/ksm.h      | 22 +++++++++++++++++++---
include/linux/mm_types.h |  2 +-
mm/ksm.c                 | 33 ++++++++++++++++++++-------------
4 files changed, 41 insertions(+), 18 deletions(-)
[PATCH 0/4] mm/ksm: fix some accounting problems
Posted by Chengming Zhou 1 year, 7 months ago
We encounter 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.

The first two patches fix these problems and the last two patches are
minor optimizations about ksm_stable_node and general_profit calculation.

Thanks for review and comments!

Signed-off-by: Chengming Zhou <chengming.zhou@linux.dev>
---
Chengming Zhou (4):
      mm/ksm: fix ksm_pages_scanned accounting
      mm/ksm: fix ksm_zero_pages accounting
      mm/ksm: union hlist_node with list_head in struct ksm_stable_node
      mm/ksm: calculate general_profit more accurately

 fs/proc/base.c           |  2 +-
 include/linux/ksm.h      | 22 +++++++++++++++++++---
 include/linux/mm_types.h |  2 +-
 mm/ksm.c                 | 33 ++++++++++++++++++++-------------
 4 files changed, 41 insertions(+), 18 deletions(-)
---
base-commit: fb0f40125feec3de7ef4524600ac83946207117e
change-id: 20240508-b4-ksm-counters-04817b40d3ee

Best regards,
-- 
Chengming Zhou <chengming.zhou@linux.dev>
Re: [PATCH 0/4] mm/ksm: fix some accounting problems
Posted by David Hildenbrand 1 year, 7 months ago
On 08.05.24 11:55, Chengming Zhou wrote:
> We encounter 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.
> 
> The first two patches fix these problems and the last two patches 

Can you find+add "Fixes:" tags for these? They look sane after having a 
quick peek.

-- 
Cheers,

David / dhildenb
Re: [PATCH 0/4] mm/ksm: fix some accounting problems
Posted by Chengming Zhou 1 year, 7 months ago
On 2024/5/8 18:24, David Hildenbrand wrote:
> On 08.05.24 11:55, Chengming Zhou wrote:
>> We encounter 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.
>>
>> The first two patches fix these problems and the last two patches 
> 
> Can you find+add "Fixes:" tags for these? They look sane after having a quick peek.
> 

Right, will add "Fixes:" tags.

Thanks.