Skip to content

mm/ksm: clean up scan_get_next_rmap_item() initialization

Xu Xin (vivo) linux-mm lkml 4 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 1 replyApplied
  2. v32 patches 2 repliesSuperseded
  3. v22 patches 1 replySuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches6 repliesSuperseded

Changes in v4 from the cover letter

- [PATCH 2/2] Drop redundant comment in scan_should_start_new_cycle() and update the comment in scan_get_first_mm() to refer to scan_get_next_rmap_item()'s list_empty() check (Lorenzo).
- [PATCH 2/2] Add Reviewed-by tags.

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/2mm/ksm: extract helper functions for scan cycle cleanupmm/ksm.c+31 -230 replies
2/2mm/ksm: add initialization helpers for scan_get_next_rmap_item()mm/ksm.c+34 -130 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchLorenzo Stoakes (ARM)David Hildenbrand (Arm)
1/2R-b A-b
2/2R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/2] mm/ksm: clean up scan_get_next_rmap_item() initialization

Currently, scan_get_next_rmap_item() has grown quite large and complex. When introducing new features, such as the only-merge-zero-page mode we are currently working on, we don't want to add more complexity to it and don't want to touch rmap_item structures to avoid unnecessary overhead, so we need to extract some common logic.

With these changes, the entry of scan_get_next_rmap_item() becomes much cleaner and easier to follow, instead of being cluttered with unrelated boilerplate such as stale stable_node pruning and cycle initialization.

Let's start by cleaning up these two parts at the beginning (where I think abstraction is necessary), and we can continue cleaning up further if needed later.

Changes in v4:
- [PATCH 2/2] Drop redundant comment in scan_should_start_new_cycle() and update the comment in scan_get_first_mm() to refer to scan_get_next_rmap_item()'s list_empty() check (Lorenzo).
- [PATCH 2/2] Add Reviewed-by tags.

Changes in v3:
- [PATCH 2/2] Initialize mm_slot = ksm_scan.mm_slot in the else branch when continuing the current scan cycle, fixing an uninitialized variable warning/bug (kernel test robot).
- [PATCH 2/2] Drop Lorenzo's Reviewed-by tag due to the v2 bug fix.

Changes in v2:
- [PATCH 2/2] Rename scan_begin_new_cycle() to scan_should_start_new_cycle and keep it simple (David).
- [PATCH 2/2] Keep lru_add_drain_all() in scan_get_next_rmap_item (David).
- [PATCH 2/2] Use scoped_guard(spinlock, &ksm_mmlist_lock) in

              scan_get_first_mm() (Lorenzo).

Xu Xin (vivo) (2):
mm/ksm: extract helper functions for scan cycle cleanup mm/ksm: add initialization helpers for scan_get_next_rmap_item()

 mm/ksm.c | 101 +++++++++++++++++++++++++++++++++++--------------------
 1 file changed, 65 insertions(+), 36 deletions(-)
Signature · 1 line
2.34.1