Skip to content

make "order" unsigned int

Pengfei Li linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10mm/page_alloc: use unsigned int for "order" in should_compact_retry()include/trace/events/oom.h mm/page_alloc.c+6 -72 replies
2/10mm/page_alloc: use unsigned int for "order" in __rmqueue_fallback()include/trace/events/kmem.h mm/page_alloc.c+5 -52 replies
3/10mm/page_alloc: use unsigned int for "order" in should_compact_retry()mm/page_alloc.c+2 -20 replies
4/10mm/page_alloc: remove never used "order" in alloc_contig_range()mm/page_alloc.c+0 -10 replies
5/10mm/compaction: make "order" and "search_order" unsigned int in struct compact_controlmm/compaction.c mm/internal.h+53 -490 replies
6/10mm/compaction: make "order" unsigned int in compaction.cinclude/linux/compaction.h mm/compaction.c+16 -170 replies
7/10trace/events/compaction: make "order" unsigned intinclude/trace/events/compaction.h+8 -80 replies
8/10mm/compaction: use unsigned int for "compact_order_failed" in struct zoneinclude/linux/compaction.h include/linux/mmzone.h include/trace/events/compaction.h +1 more+18 -180 replies
9/10mm/compaction: use unsigned int for "kcompactd_max_order" in struct pglist_datainclude/linux/compaction.h include/linux/mmzone.h mm/compaction.c+6 -40 replies
10/10mm/vmscan: use unsigned int for "kswapd_order" in struct pglist_datainclude/linux/mmzone.h include/trace/events/compaction.h include/trace/events/vmscan.h +1 more+12 -120 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/10] make "order" unsigned int

Objective
----
The motivation for this series of patches is use unsigned int for "order" in compaction.c, just like in other memory subsystems.

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(-)
Signature · 1 line
2.21.0