Skip to content

Commit

Permalink
mm, vmscan: show LRU name in mm_vmscan_lru_isolate tracepoint
Browse files Browse the repository at this point in the history
mm_vmscan_lru_isolate currently prints only whether the LRU we isolate
from is file or anonymous but we do not know which LRU this is.

It is useful to know whether the list is active or inactive, since we
are using the same function to isolate pages from both of them and it's
hard to distinguish otherwise.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Michal Hocko <[email protected]>
Acked-by: Hillf Danton <[email protected]>
Acked-by: Mel Gorman <[email protected]>
Acked-by: Minchan Kim <[email protected]>
Acked-by: Vlastimil Babka <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Michal Hocko authored and torvalds committed Feb 23, 2017
1 parent 1265e3a commit 32b3f29
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
8 changes: 8 additions & 0 deletions include/trace/events/mmflags.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,13 @@ IF_HAVE_VM_SOFTDIRTY(VM_SOFTDIRTY, "softdirty" ) \
IFDEF_ZONE_HIGHMEM( EM (ZONE_HIGHMEM,"HighMem")) \
EMe(ZONE_MOVABLE,"Movable")

#define LRU_NAMES \
EM (LRU_INACTIVE_ANON, "inactive_anon") \
EM (LRU_ACTIVE_ANON, "active_anon") \
EM (LRU_INACTIVE_FILE, "inactive_file") \
EM (LRU_ACTIVE_FILE, "active_file") \
EMe(LRU_UNEVICTABLE, "unevictable")

/*
* First define the enums in the above macros to be exported to userspace
* via TRACE_DEFINE_ENUM().
Expand All @@ -252,6 +259,7 @@ COMPACTION_STATUS
COMPACTION_PRIORITY
COMPACTION_FEEDBACK
ZONE_TYPE
LRU_NAMES

/*
* Now redefine the EM() and EMe() macros to map the enums to the strings
Expand Down
12 changes: 6 additions & 6 deletions include/trace/events/vmscan.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,9 @@ TRACE_EVENT(mm_vmscan_lru_isolate,
unsigned long nr_skipped,
unsigned long nr_taken,
isolate_mode_t isolate_mode,
int file),
int lru),

TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_skipped, nr_taken, isolate_mode, file),
TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_skipped, nr_taken, isolate_mode, lru),

TP_STRUCT__entry(
__field(int, classzone_idx)
Expand All @@ -289,7 +289,7 @@ TRACE_EVENT(mm_vmscan_lru_isolate,
__field(unsigned long, nr_skipped)
__field(unsigned long, nr_taken)
__field(isolate_mode_t, isolate_mode)
__field(int, file)
__field(int, lru)
),

TP_fast_assign(
Expand All @@ -300,18 +300,18 @@ TRACE_EVENT(mm_vmscan_lru_isolate,
__entry->nr_skipped = nr_skipped;
__entry->nr_taken = nr_taken;
__entry->isolate_mode = isolate_mode;
__entry->file = file;
__entry->lru = lru;
),

TP_printk("isolate_mode=%d classzone=%d order=%d nr_requested=%lu nr_scanned=%lu nr_skipped=%lu nr_taken=%lu file=%d",
TP_printk("isolate_mode=%d classzone=%d order=%d nr_requested=%lu nr_scanned=%lu nr_skipped=%lu nr_taken=%lu lru=%s",
__entry->isolate_mode,
__entry->classzone_idx,
__entry->order,
__entry->nr_requested,
__entry->nr_scanned,
__entry->nr_skipped,
__entry->nr_taken,
__entry->file)
__print_symbolic(__entry->lru, LRU_NAMES))
);

TRACE_EVENT(mm_vmscan_writepage,
Expand Down
3 changes: 1 addition & 2 deletions mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1509,8 +1509,7 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan,
}
*nr_scanned = scan + total_skipped;
trace_mm_vmscan_lru_isolate(sc->reclaim_idx, sc->order, nr_to_scan,
scan, skipped, nr_taken, mode,
is_file_lru(lru));
scan, skipped, nr_taken, mode, lru);
update_lru_sizes(lruvec, lru, nr_zone_taken);
return nr_taken;
}
Expand Down

0 comments on commit 32b3f29

Please sign in to comment.