Skip to content

Commit

Permalink
mm,vmacache: count number of system-wide flushes
Browse files Browse the repository at this point in the history
These flushes deal with sequence number overflows, such as for long lived
threads.  These are rare, but interesting from a debugging PoV.  As such,
display the number of flushes when vmacache debugging is enabled.

Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Davidlohr Bueso authored and torvalds committed Dec 13, 2014
1 parent 16a7ade commit f5f302e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/linux/vm_event_item.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
#ifdef CONFIG_DEBUG_VM_VMACACHE
VMACACHE_FIND_CALLS,
VMACACHE_FIND_HITS,
VMACACHE_FULL_FLUSHES,
#endif
NR_VM_EVENT_ITEMS
};
Expand Down
2 changes: 2 additions & 0 deletions mm/vmacache.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ void vmacache_flush_all(struct mm_struct *mm)
{
struct task_struct *g, *p;

count_vm_vmacache_event(VMACACHE_FULL_FLUSHES);

/*
* Single threaded tasks need not iterate the entire
* list of process. We can avoid the flushing as well
Expand Down
1 change: 1 addition & 0 deletions mm/vmstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,7 @@ const char * const vmstat_text[] = {
#ifdef CONFIG_DEBUG_VM_VMACACHE
"vmacache_find_calls",
"vmacache_find_hits",
"vmacache_full_flushes",
#endif
#endif /* CONFIG_VM_EVENTS_COUNTERS */
};
Expand Down

0 comments on commit f5f302e

Please sign in to comment.