Re: [PATCH 00/10] make "order" unsigned int
From: Qian Cai
Date: Thu Jul 25 2019 - 14:52:53 EST
On Fri, 2019-07-26 at 02:42 +0800, Pengfei Li wrote:
> Objective
> ----
> The motivation for this series of patches is use unsigned int for
> "order" in compaction.c, just like in other memory subsystems.
I suppose you will need more justification for this change. Right now, I don't
see much real benefit apart from possibly introducing more regressions in those
tricky areas of the code. Also, your testing seems quite lightweight.
>
> In addition, did some cleanup about "order" in page_alloc
> and vmscan.
>
>
> Description
> ----
> Directly modifying the type of "order" to unsigned int is ok in most
> places, because "order" is always non-negative.
>
> But there are two places that are special, one is next_search_order()
> and the other is compact_node().
>
> For next_search_order(), order may be negative. It can be avoided by
> some modifications.
>
> For compact_node(), order = -1 means performing manual compaction.
> It can be avoided by specifying order = MAX_ORDER.
>
> Key changes in [PATCH 05/10] mm/compaction: make "order" and
> "search_order" unsigned.
>
> More information can be obtained from commit messages.
>
>
> Test
> ----
> I have done some stress testing locally and have not found any problems.
>
> In addition, local tests indicate no performance impact.
>
>
> Pengfei Li (10):
> Â mm/page_alloc: use unsigned int for "order" in should_compact_retry()
> Â mm/page_alloc: use unsigned int for "order" in __rmqueue_fallback()
> Â mm/page_alloc: use unsigned int for "order" in should_compact_retry()
> Â mm/page_alloc: remove never used "order" in alloc_contig_range()
> Â mm/compaction: make "order" and "search_order" unsigned int in struct
> ÂÂÂÂcompact_control
> Â mm/compaction: make "order" unsigned int in compaction.c
> Â trace/events/compaction: make "order" unsigned int
> Â mm/compaction: use unsigned int for "compact_order_failed" in struct
> ÂÂÂÂzone
> Â mm/compaction: use unsigned int for "kcompactd_max_order" in struct
> ÂÂÂÂpglist_data
> Â mm/vmscan: use unsigned int for "kswapd_order" in struct pglist_data
>
> Âinclude/linux/compaction.hÂÂÂÂÂÂÂÂ|ÂÂ30 +++----
> Âinclude/linux/mmzone.hÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ8 +-
> Âinclude/trace/events/compaction.h |ÂÂ40 +++++-----
> Âinclude/trace/events/kmem.hÂÂÂÂÂÂÂ|ÂÂÂ6 +-
> Âinclude/trace/events/oom.hÂÂÂÂÂÂÂÂ|ÂÂÂ6 +-
> Âinclude/trace/events/vmscan.hÂÂÂÂÂ|ÂÂÂ4 +-
> Âmm/compaction.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 127 +++++++++++++++---------------
> Âmm/internal.hÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ6 +-
> Âmm/page_alloc.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ16 ++--
> Âmm/vmscan.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ6 +-
> Â10 files changed, 126 insertions(+), 123 deletions(-)
>