All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Michal Hocko <mhocko@suse.cz>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	dave.hansen@intel.com, kosaki.motohiro@jp.fujitsu.com,
	kamezawa.hiroyu@jp.fujitsu.com, bp@suse.de,
	Dave Hansen <dave@linux.vnet.ibm.com>
Subject: Re: [PATCH resend] drop_caches: add some documentation and info message
Date: Tue, 30 Jul 2013 01:25:44 -0700	[thread overview]
Message-ID: <20130730012544.2f33ebf6.akpm@linux-foundation.org> (raw)
In-Reply-To: <20130730074531.GA10584@dhcp22.suse.cz>

On Tue, 30 Jul 2013 09:45:31 +0200 Michal Hocko <mhocko@suse.cz> wrote:

> On Mon 29-07-13 13:57:43, Andrew Morton wrote:
> > On Fri, 26 Jul 2013 14:44:29 +0200 Michal Hocko <mhocko@suse.cz> wrote:
> [...]
> > > --- a/fs/drop_caches.c
> > > +++ b/fs/drop_caches.c
> > > @@ -59,6 +59,8 @@ int drop_caches_sysctl_handler(ctl_table *table, int write,
> > >  	if (ret)
> > >  		return ret;
> > >  	if (write) {
> > > +		printk(KERN_INFO "%s (%d): dropped kernel caches: %d\n",
> > > +		       current->comm, task_pid_nr(current), sysctl_drop_caches);
> > >  		if (sysctl_drop_caches & 1)
> > >  			iterate_supers(drop_pagecache_sb, NULL);
> > >  		if (sysctl_drop_caches & 2)
> > 
> > How about we do
> > 
> > 	if (!(sysctl_drop_caches & 4))
> > 		printk(....)
> >
> > so people can turn it off if it's causing problems?
> 
> I am OK with that  but can we use a top bit instead. Maybe we never have
> other entities to drop in the future but it would be better to have a room for them
> just in case.

If we add another flag in the future it can use bit 3?

> So what about using 1<<31 instead?

Could, but negative (or is it positive?) numbers are a bit of a pain.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: Michal Hocko <mhocko@suse.cz>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	dave.hansen@intel.com, kosaki.motohiro@jp.fujitsu.com,
	kamezawa.hiroyu@jp.fujitsu.com, bp@suse.de,
	Dave Hansen <dave@linux.vnet.ibm.com>
Subject: Re: [PATCH resend] drop_caches: add some documentation and info message
Date: Tue, 30 Jul 2013 01:25:44 -0700	[thread overview]
Message-ID: <20130730012544.2f33ebf6.akpm@linux-foundation.org> (raw)
In-Reply-To: <20130730074531.GA10584@dhcp22.suse.cz>

On Tue, 30 Jul 2013 09:45:31 +0200 Michal Hocko <mhocko@suse.cz> wrote:

> On Mon 29-07-13 13:57:43, Andrew Morton wrote:
> > On Fri, 26 Jul 2013 14:44:29 +0200 Michal Hocko <mhocko@suse.cz> wrote:
> [...]
> > > --- a/fs/drop_caches.c
> > > +++ b/fs/drop_caches.c
> > > @@ -59,6 +59,8 @@ int drop_caches_sysctl_handler(ctl_table *table, int write,
> > >  	if (ret)
> > >  		return ret;
> > >  	if (write) {
> > > +		printk(KERN_INFO "%s (%d): dropped kernel caches: %d\n",
> > > +		       current->comm, task_pid_nr(current), sysctl_drop_caches);
> > >  		if (sysctl_drop_caches & 1)
> > >  			iterate_supers(drop_pagecache_sb, NULL);
> > >  		if (sysctl_drop_caches & 2)
> > 
> > How about we do
> > 
> > 	if (!(sysctl_drop_caches & 4))
> > 		printk(....)
> >
> > so people can turn it off if it's causing problems?
> 
> I am OK with that  but can we use a top bit instead. Maybe we never have
> other entities to drop in the future but it would be better to have a room for them
> just in case.

If we add another flag in the future it can use bit 3?

> So what about using 1<<31 instead?

Could, but negative (or is it positive?) numbers are a bit of a pain.

  reply	other threads:[~2013-07-30  8:26 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-26 12:44 [PATCH resend] drop_caches: add some documentation and info message Michal Hocko
2013-07-26 12:44 ` Michal Hocko
2013-07-26 21:37 ` Johannes Weiner
2013-07-26 21:37   ` Johannes Weiner
2013-07-29 20:57 ` Andrew Morton
2013-07-29 20:57   ` Andrew Morton
2013-07-30  7:45   ` Michal Hocko
2013-07-30  7:45     ` Michal Hocko
2013-07-30  8:25     ` Andrew Morton [this message]
2013-07-30  8:25       ` Andrew Morton
2013-07-30 12:55       ` Michal Hocko
2013-07-30 12:55         ` Michal Hocko
2013-07-30 14:39         ` Andrew Morton
2013-07-30 14:39           ` Andrew Morton
2013-07-30 14:47           ` Michal Hocko
2013-07-30 14:47             ` Michal Hocko
2013-07-30 14:47         ` Dave Hansen
2013-07-30 14:47           ` Dave Hansen
2013-07-30 14:54           ` Borislav Petkov
2013-07-30 14:54             ` Borislav Petkov
2013-07-30 15:08           ` Andrew Morton
2013-07-30 15:08             ` Andrew Morton
2013-08-01  3:11   ` KOSAKI Motohiro
2013-08-01  3:11     ` KOSAKI Motohiro
2013-08-01  3:17     ` Andrew Morton
2013-08-01  3:17       ` Andrew Morton
2013-08-02  1:39       ` KOSAKI Motohiro
2013-08-02  1:39         ` KOSAKI Motohiro
2013-08-02  7:33         ` Michal Hocko
2013-08-02  7:33           ` Michal Hocko
2013-08-03 20:16           ` KOSAKI Motohiro
2013-08-03 20:16             ` KOSAKI Motohiro
2013-08-04  8:07             ` Michal Hocko
2013-08-04  8:07               ` Michal Hocko
2013-08-05  1:13               ` KOSAKI Motohiro
2013-08-05  1:13                 ` KOSAKI Motohiro
2013-08-05  7:20                 ` Michal Hocko
2013-08-05  7:20                   ` Michal Hocko
2013-09-17 15:14                   ` Johannes Weiner
2013-09-17 15:14                     ` Johannes Weiner
2013-08-02 16:04       ` Rob Landley
2013-08-02 16:04         ` Rob Landley
2013-08-02 17:10         ` Dave Hansen
2013-08-02 17:10           ` Dave Hansen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130730012544.2f33ebf6.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=bp@suse.de \
    --cc=dave.hansen@intel.com \
    --cc=dave@linux.vnet.ibm.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.