Skip to content

Commit

Permalink
mm/swap.c: don't pass "enum lru_list" to trace_mm_lru_insertion()
Browse files Browse the repository at this point in the history
The parameter is redundant in the sense that it can be extracted
from the "struct page" parameter by page_lru() correctly.

Link: https://lore.kernel.org/linux-mm/[email protected]/
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Yu Zhao <[email protected]>
Reviewed-by: Alex Shi <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Roman Gushchin <[email protected]>
Cc: Vladimir Davydov <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
yuzhaogoogle authored and torvalds committed Feb 24, 2021
1 parent 3a9c978 commit 8614045
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
11 changes: 4 additions & 7 deletions include/trace/events/pagemap.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,21 @@

TRACE_EVENT(mm_lru_insertion,

TP_PROTO(
struct page *page,
int lru
),
TP_PROTO(struct page *page),

TP_ARGS(page, lru),
TP_ARGS(page),

TP_STRUCT__entry(
__field(struct page *, page )
__field(unsigned long, pfn )
__field(int, lru )
__field(enum lru_list, lru )
__field(unsigned long, flags )
),

TP_fast_assign(
__entry->page = page;
__entry->pfn = page_to_pfn(page);
__entry->lru = lru;
__entry->lru = page_lru(page);
__entry->flags = trace_pagemap_flags(page);
),

Expand Down
5 changes: 1 addition & 4 deletions mm/swap.c
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,6 @@ EXPORT_SYMBOL(__pagevec_release);

static void __pagevec_lru_add_fn(struct page *page, struct lruvec *lruvec)
{
enum lru_list lru;
int was_unevictable = TestClearPageUnevictable(page);
int nr_pages = thp_nr_pages(page);

Expand Down Expand Up @@ -993,19 +992,17 @@ static void __pagevec_lru_add_fn(struct page *page, struct lruvec *lruvec)
smp_mb__after_atomic();

if (page_evictable(page)) {
lru = page_lru(page);
if (was_unevictable)
__count_vm_events(UNEVICTABLE_PGRESCUED, nr_pages);
} else {
lru = LRU_UNEVICTABLE;
ClearPageActive(page);
SetPageUnevictable(page);
if (!was_unevictable)
__count_vm_events(UNEVICTABLE_PGCULLED, nr_pages);
}

add_page_to_lru_list(page, lruvec);
trace_mm_lru_insertion(page, lru);
trace_mm_lru_insertion(page);
}

/*
Expand Down

0 comments on commit 8614045

Please sign in to comment.