mbox series

[00/12] Tiny cleanup and improvements about SWAP code

Message ID 20250205092721.9395-1-bhe@redhat.com (mailing list archive)
Headers show
Series Tiny cleanup and improvements about SWAP code | expand

Message

Baoquan He Feb. 5, 2025, 9:27 a.m. UTC
These are all made during reviewing and learning below patchset from
Kairui.

[PATCH v3 00/13] mm, swap: rework of swap allocator locks

Baoquan He (12):
  mm/swap_state.c: fix the obsolete code comment
  mm/swap_state.c: optimize the code in clear_shadow_from_swap_cache()
  mm/swap: remove SWAP_FLAG_PRIO_SHIFT
  mm/swap: skip scanning cluster range if it's empty cluster
  mm/swap: rename swap_is_has_cache() to swap_only_has_cache()
  mm/swapfile.c: update the code comment above swap_count_continued()
  mm/swapfile.c: optimize code in setup_clusters()
  mm/swap_state.c: remove the meaningless code comment
  mm/swapfile.c: remove the unneeded checking
  mm/swap: rename swap_swapcount() to swap_entry_swapped()
  mm/swapfile.c: remove the incorrect code comment
  mm/swapfile.c: open code cluster_alloc_swap()

 include/linux/swap.h |  7 ++--
 mm/swap_state.c      | 12 ++-----
 mm/swapfile.c        | 83 +++++++++++++++++---------------------------
 3 files changed, 37 insertions(+), 65 deletions(-)

Comments

Kairui Song Feb. 7, 2025, 9:36 a.m. UTC | #1
On Wed, Feb 5, 2025 at 5:27 PM Baoquan He <bhe@redhat.com> wrote:
>
> These are all made during reviewing and learning below patchset from
> Kairui.

Thanks, I've noticed some obsolete comments and code, currently
refactoring many parts so some of the functions would be just gone
someday.
But this surely cleans things up and is good to have, refactoring will
take much longer time to happen.

With the V2 update of "mm/swapfile.c: update the code comment above
swap_count_continued()":

Reviewed-by: Kairui Song <kasong@tencent.com>

> [PATCH v3 00/13] mm, swap: rework of swap allocator locks

BTW, I noticed most patches here are patching legacy code, and not
directly related to that series.
Just to clarify, so people won't need to worry about missing "Fixes:"
or things like that :)
Baoquan He Feb. 8, 2025, 1:08 a.m. UTC | #2
On 02/07/25 at 05:36pm, Kairui Song wrote:
> On Wed, Feb 5, 2025 at 5:27 PM Baoquan He <bhe@redhat.com> wrote:
> >
> > These are all made during reviewing and learning below patchset from
> > Kairui.
> 
> Thanks, I've noticed some obsolete comments and code, currently
> refactoring many parts so some of the functions would be just gone
> someday.

Thanks a lot for reviewing, Kairui.

I have a queued patchset to refactor the old hdd/cluster code, it could
be made about 2 years ago. Then I heard you and Chris's presentation in
LPC in last fall, and your later rework patchset, just began to notice
the big change in swap code which is not what I knew. Sorry, didn't know
you are still refactoring the code, so will stop touching swap code, look
forward to seeing your new refactoring patches. I will keep an eye so
that I can follow the step to update my knowledge about swap code.

> But this surely cleans things up and is good to have, refactoring will
> take much longer time to happen.

Thanks again. Please help add me to CC when you post, I am interested in
the new change.

> 
> With the V2 update of "mm/swapfile.c: update the code comment above
> swap_count_continued()":
> 
> Reviewed-by: Kairui Song <kasong@tencent.com>
> 
> > [PATCH v3 00/13] mm, swap: rework of swap allocator locks
> 
> BTW, I noticed most patches here are patching legacy code, and not
> directly related to that series.
> Just to clarify, so people won't need to worry about missing "Fixes:"
> or things like that :)

LOL, right, at least people following the recent change of swap won't
misunderstand.