[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20140211134459.551dd07d697a888e29f1c7b1@linux-foundation.org>
Date: Tue, 11 Feb 2014 13:44:59 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Johannes Weiner <hannes@...xchg.org>
Cc: Rik van Riel <riel@...hat.com>, Dave Hansen <dave@...1.net>,
Michal Hocko <mhocko@...e.cz>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [patch] drop_caches: add some documentation and info message
On Mon, 10 Feb 2014 16:54:16 -0500 Johannes Weiner <hannes@...xchg.org> wrote:
> How about this: we allow disabling the log message, but print the line
> of the disabling call so it's clear who dunnit. To make sure valuable
> info is not missing in bug reports, add counters for the two events in
> /proc/vmstat.
>
> Does that sound acceptable?
Yes, I really don't know what's the right thing to do here or where the
best tradeoff point is situated. Let's start off this way and see what
happens I guess.
> --- a/fs/drop_caches.c
> +++ b/fs/drop_caches.c
> @@ -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;
That identifier wasn't serious, but I kinda like it.
> +
> + 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;
> }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists