]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/drop_caches.c
Merge branch 'pull/l3noc/dts-fixes' of https://github.com/nmenon/linux-2.6-playground...
[karo-tx-linux.git] / fs / drop_caches.c
index 9fd702f5bfb2886a715e787b6470615ea07021e0..9280202e488c0557f1478f8bcde6ebfd0893710d 100644 (file)
@@ -59,10 +59,22 @@ int drop_caches_sysctl_handler(ctl_table *table, int write,
        if (ret)
                return ret;
        if (write) {
-               if (sysctl_drop_caches & 1)
+               static int stfu;
+
+               if (sysctl_drop_caches & 1) {
                        iterate_supers(drop_pagecache_sb, NULL);
-               if (sysctl_drop_caches & 2)
+                       count_vm_event(DROP_PAGECACHE);
+               }
+               if (sysctl_drop_caches & 2) {
                        drop_slab();
+                       count_vm_event(DROP_SLAB);
+               }
+               if (!stfu) {
+                       pr_info("%s (%d): drop_caches: %d\n",
+                               current->comm, task_pid_nr(current),
+                               sysctl_drop_caches);
+               }
+               stfu |= sysctl_drop_caches & 4;
        }
        return 0;
 }