mm,vmacache: count number of system-wide flushes
authorDavidlohr Bueso <dave@stgolabs.net>
Sat, 13 Dec 2014 00:56:10 +0000 (16:56 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 13 Dec 2014 20:42:48 +0000 (12:42 -0800)
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>
include/linux/vm_event_item.h
mm/vmacache.c
mm/vmstat.c

index 730334cdf037c8ea14dc83377eb61073bb9678ed..9246d32dc9734374d893a5357e60fdbdd0c296e3 100644 (file)
@@ -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
 };
index 9f25af825dec6d929348e16db85a6c17ab00f31d..b6e3662fe339532d8b8f1578f58dd208dd23e249 100644 (file)
@@ -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
index b090e9e3d6264c2ef80d35bf0fef230496d62a2a..1284f89fca082aa907973d16ceed3f09d316a780 100644 (file)
@@ -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 */
 };