Skip to content

Commit

Permalink
tools/vm/page_owner_sort.c: avoid repeated judgments
Browse files Browse the repository at this point in the history
I noticed a detail that needs to be adjusted.  When judging whether a page
is allocated by vmalloc, the value of the variable "tmp" was repeatedly
judged, so the code was adjusted.

This work is coauthored by Yinan Zhang, Jiajian Ye, Shenghong Han, Chongxi
Zhao, Yuhong Feng and Yongqiang Liu.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Yixuan Cao <[email protected]>
Cc: Chongxi Zhao <[email protected]>
Cc: Haowen Bai <[email protected]>
Cc: Jiajian Ye <[email protected]>
Cc: Sean Anderson <[email protected]>
Cc: Shenghong Han <[email protected]>
Cc: Yinan Zhang <[email protected]>
Cc: Yongqiang Liu <[email protected]>
Cc: Yuhong Feng <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
Cao-Wuhui authored and akpm00 committed Apr 29, 2022
1 parent f09654b commit c7c4ab8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tools/vm/page_owner_sort.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,8 @@ static int get_allocator(const char *buf, const char *migrate_info)
tmp--;
first_line = ++tmp;
tmp = strstr(tmp, "alloc_pages");
if (tmp) {
if (tmp && first_line <= tmp && tmp < second_line)
allocator |= ALLOCATOR_VMALLOC;
}
if (tmp && first_line <= tmp && tmp < second_line)
allocator |= ALLOCATOR_VMALLOC;
}
if (allocator == 0)
allocator = ALLOCATOR_OTHERS;
Expand Down

0 comments on commit c7c4ab8

Please sign in to comment.