diff options
Diffstat (limited to 'fs/drop_caches.c')
-rw-r--r-- | fs/drop_caches.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/fs/drop_caches.c b/fs/drop_caches.c index 9fd702f5bfb2..9280202e488c 100644 --- a/fs/drop_caches.c +++ b/fs/drop_caches.c | |||
@@ -59,10 +59,22 @@ int drop_caches_sysctl_handler(ctl_table *table, int write, | |||
59 | if (ret) | 59 | if (ret) |
60 | return ret; | 60 | return ret; |
61 | if (write) { | 61 | if (write) { |
62 | if (sysctl_drop_caches & 1) | 62 | static int stfu; |
63 | |||
64 | if (sysctl_drop_caches & 1) { | ||
63 | iterate_supers(drop_pagecache_sb, NULL); | 65 | iterate_supers(drop_pagecache_sb, NULL); |
64 | if (sysctl_drop_caches & 2) | 66 | count_vm_event(DROP_PAGECACHE); |
67 | } | ||
68 | if (sysctl_drop_caches & 2) { | ||
65 | drop_slab(); | 69 | drop_slab(); |
70 | count_vm_event(DROP_SLAB); | ||
71 | } | ||
72 | if (!stfu) { | ||
73 | pr_info("%s (%d): drop_caches: %d\n", | ||
74 | current->comm, task_pid_nr(current), | ||
75 | sysctl_drop_caches); | ||
76 | } | ||
77 | stfu |= sysctl_drop_caches & 4; | ||
66 | } | 78 | } |
67 | return 0; | 79 | return 0; |
68 | } | 80 | } |