Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-15 Thread Mel Gorman
On Tue, Jan 14, 2014 at 04:35:33PM -0800, Andrew Morton wrote: > > Would it be overkill to save the kernel default both with and without thp > > and then doing a WARN_ON_ONCE() if a user-written value is ever less? > > Well, min_free_kbytes is a userspace thing, not a kernel thing - maybe > THP

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-15 Thread Mel Gorman
On Tue, Jan 14, 2014 at 04:35:33PM -0800, Andrew Morton wrote: Would it be overkill to save the kernel default both with and without thp and then doing a WARN_ON_ONCE() if a user-written value is ever less? Well, min_free_kbytes is a userspace thing, not a kernel thing - maybe THP

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-14 Thread David Rientjes
On Tue, 14 Jan 2014, Andrew Morton wrote: > I've been waiting 10+ years for us to decide to delete that warning due > to the false positives. Hasn't happened yet, and the warning does > find bugs/issues/misconfigurations/etc. > I've found memory leaks from the meminfo that is emitted as part

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-14 Thread Andrew Morton
On Tue, 14 Jan 2014 16:25:10 -0800 (PST) David Rientjes wrote: > On Tue, 14 Jan 2014, Andrew Morton wrote: > > > This is all a bit nasty, isn't it? THP goes and alters min_free_kbytes > > to improve its own reliability, but min_free_kbytes is also > > user-modifiable. And over many years we

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-14 Thread David Rientjes
On Tue, 14 Jan 2014, Andrew Morton wrote: > This is all a bit nasty, isn't it? THP goes and alters min_free_kbytes > to improve its own reliability, but min_free_kbytes is also > user-modifiable. And over many years we have trained a *lot* of users > to alter min_free_kbytes. Often to prevent

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-14 Thread Andrew Morton
On Wed, 15 Jan 2014 04:07:20 +0800 Han Pingtian wrote: > min_free_kbytes may be raised during THP's initialization. Sometimes, > this will change the value being set by user. Showing message will > clarify this confusion. > > Only show this message when changing the value set by user according

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-14 Thread Han Pingtian
On Fri, Jan 10, 2014 at 09:17:44AM +0100, Michal Hocko wrote: > On Fri 10-01-14 00:13:44, Andrew Morton wrote: > > On Fri, 10 Jan 2014 09:05:04 +0100 Michal Hocko wrote: > > > > > > > --- a/mm/huge_memory.c > > > > > +++ b/mm/huge_memory.c > > > > > @@ -100,6 +100,7 @@ static struct

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-14 Thread Han Pingtian
On Fri, Jan 10, 2014 at 09:17:44AM +0100, Michal Hocko wrote: On Fri 10-01-14 00:13:44, Andrew Morton wrote: On Fri, 10 Jan 2014 09:05:04 +0100 Michal Hocko mho...@suse.cz wrote: --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -100,6 +100,7 @@ static struct khugepaged_scan

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-14 Thread Andrew Morton
On Wed, 15 Jan 2014 04:07:20 +0800 Han Pingtian ha...@linux.vnet.ibm.com wrote: min_free_kbytes may be raised during THP's initialization. Sometimes, this will change the value being set by user. Showing message will clarify this confusion. Only show this message when changing the value

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-14 Thread David Rientjes
On Tue, 14 Jan 2014, Andrew Morton wrote: This is all a bit nasty, isn't it? THP goes and alters min_free_kbytes to improve its own reliability, but min_free_kbytes is also user-modifiable. And over many years we have trained a *lot* of users to alter min_free_kbytes. Often to prevent

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-14 Thread Andrew Morton
On Tue, 14 Jan 2014 16:25:10 -0800 (PST) David Rientjes rient...@google.com wrote: On Tue, 14 Jan 2014, Andrew Morton wrote: This is all a bit nasty, isn't it? THP goes and alters min_free_kbytes to improve its own reliability, but min_free_kbytes is also user-modifiable. And over

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-14 Thread David Rientjes
On Tue, 14 Jan 2014, Andrew Morton wrote: I've been waiting 10+ years for us to decide to delete that warning due to the false positives. Hasn't happened yet, and the warning does find bugs/issues/misconfigurations/etc. I've found memory leaks from the meminfo that is emitted as part of

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-10 Thread Han Pingtian
On Fri, Jan 10, 2014 at 09:17:44AM +0100, Michal Hocko wrote: > On Fri 10-01-14 00:13:44, Andrew Morton wrote: > > On Fri, 10 Jan 2014 09:05:04 +0100 Michal Hocko wrote: > > > > > > > --- a/mm/huge_memory.c > > > > > +++ b/mm/huge_memory.c > > > > > @@ -100,6 +100,7 @@ static struct

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-10 Thread Michal Hocko
On Fri 10-01-14 00:13:44, Andrew Morton wrote: > On Fri, 10 Jan 2014 09:05:04 +0100 Michal Hocko wrote: > > > > > --- a/mm/huge_memory.c > > > > +++ b/mm/huge_memory.c > > > > @@ -100,6 +100,7 @@ static struct khugepaged_scan khugepaged_scan = { > > > > .mm_head =

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-10 Thread Andrew Morton
On Fri, 10 Jan 2014 09:05:04 +0100 Michal Hocko wrote: > > > --- a/mm/huge_memory.c > > > +++ b/mm/huge_memory.c > > > @@ -100,6 +100,7 @@ static struct khugepaged_scan khugepaged_scan = { > > > .mm_head = LIST_HEAD_INIT(khugepaged_scan.mm_head), > > > }; > > > > > > +extern int

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-10 Thread Michal Hocko
On Thu 09-01-14 13:15:54, David Rientjes wrote: > On Thu, 9 Jan 2014, Han Pingtian wrote: > > > min_free_kbytes may be raised during THP's initialization. Sometimes, > > this will change the value being set by user. Showing message will > > clarify this confusion. > > > > Only show this message

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-10 Thread Michal Hocko
On Thu 09-01-14 13:15:54, David Rientjes wrote: On Thu, 9 Jan 2014, Han Pingtian wrote: min_free_kbytes may be raised during THP's initialization. Sometimes, this will change the value being set by user. Showing message will clarify this confusion. Only show this message when

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-10 Thread Andrew Morton
On Fri, 10 Jan 2014 09:05:04 +0100 Michal Hocko mho...@suse.cz wrote: --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -100,6 +100,7 @@ static struct khugepaged_scan khugepaged_scan = { .mm_head = LIST_HEAD_INIT(khugepaged_scan.mm_head), }; +extern int

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-10 Thread Michal Hocko
On Fri 10-01-14 00:13:44, Andrew Morton wrote: On Fri, 10 Jan 2014 09:05:04 +0100 Michal Hocko mho...@suse.cz wrote: --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -100,6 +100,7 @@ static struct khugepaged_scan khugepaged_scan = { .mm_head =

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-10 Thread Han Pingtian
On Fri, Jan 10, 2014 at 09:17:44AM +0100, Michal Hocko wrote: On Fri 10-01-14 00:13:44, Andrew Morton wrote: On Fri, 10 Jan 2014 09:05:04 +0100 Michal Hocko mho...@suse.cz wrote: --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -100,6 +100,7 @@ static struct khugepaged_scan

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-09 Thread David Rientjes
On Thu, 9 Jan 2014, Han Pingtian wrote: > min_free_kbytes may be raised during THP's initialization. Sometimes, > this will change the value being set by user. Showing message will > clarify this confusion. > > Only show this message when changing the value set by user according to > Michal

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-09 Thread Michal Hocko
On Thu 09-01-14 15:32:59, Han Pingtian wrote: [...] > From b8db4f157a17d6d8652cc9cff024a192c3ee0779 Mon Sep 17 00:00:00 2001 > From: Han Pingtian > Date: Thu, 9 Jan 2014 15:24:26 +0800 > Subject: [PATCH] mm: show message when raising min_free_kbytes in THP > > min_free_kbytes may be raised

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-09 Thread Michal Hocko
On Thu 09-01-14 15:32:59, Han Pingtian wrote: [...] From b8db4f157a17d6d8652cc9cff024a192c3ee0779 Mon Sep 17 00:00:00 2001 From: Han Pingtian ha...@linux.vnet.ibm.com Date: Thu, 9 Jan 2014 15:24:26 +0800 Subject: [PATCH] mm: show message when raising min_free_kbytes in THP min_free_kbytes

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-09 Thread David Rientjes
On Thu, 9 Jan 2014, Han Pingtian wrote: min_free_kbytes may be raised during THP's initialization. Sometimes, this will change the value being set by user. Showing message will clarify this confusion. Only show this message when changing the value set by user according to Michal Hocko's

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-08 Thread Han Pingtian
On Wed, Jan 08, 2014 at 11:16:11AM +0100, Michal Hocko wrote: > On Wed 08-01-14 16:20:01, Han Pingtian wrote: > > On Mon, Jan 06, 2014 at 05:46:04PM +0100, Michal Hocko wrote: > > > On Sun 05-01-14 08:35:01, Han Pingtian wrote: > > > [...] > > > > From f4d085a880dfae7638b33c242554efb0afc0852b Mon

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-08 Thread Michal Hocko
On Wed 08-01-14 16:20:01, Han Pingtian wrote: > On Mon, Jan 06, 2014 at 05:46:04PM +0100, Michal Hocko wrote: > > On Sun 05-01-14 08:35:01, Han Pingtian wrote: > > [...] > > > From f4d085a880dfae7638b33c242554efb0afc0852b Mon Sep 17 00:00:00 2001 > > > From: Han Pingtian > > > Date: Fri, 3 Jan

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-08 Thread Han Pingtian
On Mon, Jan 06, 2014 at 05:46:04PM +0100, Michal Hocko wrote: > On Sun 05-01-14 08:35:01, Han Pingtian wrote: > [...] > > From f4d085a880dfae7638b33c242554efb0afc0852b Mon Sep 17 00:00:00 2001 > > From: Han Pingtian > > Date: Fri, 3 Jan 2014 11:10:49 +0800 > > Subject: [PATCH] mm: show message

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-08 Thread Han Pingtian
On Mon, Jan 06, 2014 at 05:46:04PM +0100, Michal Hocko wrote: On Sun 05-01-14 08:35:01, Han Pingtian wrote: [...] From f4d085a880dfae7638b33c242554efb0afc0852b Mon Sep 17 00:00:00 2001 From: Han Pingtian ha...@linux.vnet.ibm.com Date: Fri, 3 Jan 2014 11:10:49 +0800 Subject: [PATCH] mm:

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-08 Thread Michal Hocko
On Wed 08-01-14 16:20:01, Han Pingtian wrote: On Mon, Jan 06, 2014 at 05:46:04PM +0100, Michal Hocko wrote: On Sun 05-01-14 08:35:01, Han Pingtian wrote: [...] From f4d085a880dfae7638b33c242554efb0afc0852b Mon Sep 17 00:00:00 2001 From: Han Pingtian ha...@linux.vnet.ibm.com Date:

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-08 Thread Han Pingtian
On Wed, Jan 08, 2014 at 11:16:11AM +0100, Michal Hocko wrote: On Wed 08-01-14 16:20:01, Han Pingtian wrote: On Mon, Jan 06, 2014 at 05:46:04PM +0100, Michal Hocko wrote: On Sun 05-01-14 08:35:01, Han Pingtian wrote: [...] From f4d085a880dfae7638b33c242554efb0afc0852b Mon Sep 17

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-07 Thread Han Pingtian
On Mon, Jan 06, 2014 at 05:46:04PM +0100, Michal Hocko wrote: > On Sun 05-01-14 08:35:01, Han Pingtian wrote: > [...] > > From f4d085a880dfae7638b33c242554efb0afc0852b Mon Sep 17 00:00:00 2001 > > From: Han Pingtian > > Date: Fri, 3 Jan 2014 11:10:49 +0800 > > Subject: [PATCH] mm: show message

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-07 Thread Han Pingtian
On Mon, Jan 06, 2014 at 05:46:04PM +0100, Michal Hocko wrote: On Sun 05-01-14 08:35:01, Han Pingtian wrote: [...] From f4d085a880dfae7638b33c242554efb0afc0852b Mon Sep 17 00:00:00 2001 From: Han Pingtian ha...@linux.vnet.ibm.com Date: Fri, 3 Jan 2014 11:10:49 +0800 Subject: [PATCH] mm:

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-06 Thread Michal Hocko
On Sun 05-01-14 08:35:01, Han Pingtian wrote: [...] > From f4d085a880dfae7638b33c242554efb0afc0852b Mon Sep 17 00:00:00 2001 > From: Han Pingtian > Date: Fri, 3 Jan 2014 11:10:49 +0800 > Subject: [PATCH] mm: show message when raising min_free_kbytes in THP > > min_free_kbytes may be raised

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-06 Thread Michal Hocko
On Sun 05-01-14 08:35:01, Han Pingtian wrote: [...] From f4d085a880dfae7638b33c242554efb0afc0852b Mon Sep 17 00:00:00 2001 From: Han Pingtian ha...@linux.vnet.ibm.com Date: Fri, 3 Jan 2014 11:10:49 +0800 Subject: [PATCH] mm: show message when raising min_free_kbytes in THP min_free_kbytes

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-04 Thread Han Pingtian
On Fri, Jan 03, 2014 at 10:17:54AM -0800, Dave Hansen wrote: > On 01/02/2014 07:33 PM, Han Pingtian wrote: > > @@ -130,8 +130,11 @@ static int set_recommended_min_free_kbytes(void) > > (unsigned long) nr_free_buffer_pages() / 20); > > recommended_min <<=

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-04 Thread Han Pingtian
On Fri, Jan 03, 2014 at 10:17:54AM -0800, Dave Hansen wrote: On 01/02/2014 07:33 PM, Han Pingtian wrote: @@ -130,8 +130,11 @@ static int set_recommended_min_free_kbytes(void) (unsigned long) nr_free_buffer_pages() / 20); recommended_min = (PAGE_SHIFT-10);

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-03 Thread Dave Hansen
On 01/02/2014 07:33 PM, Han Pingtian wrote: > @@ -130,8 +130,11 @@ static int set_recommended_min_free_kbytes(void) > (unsigned long) nr_free_buffer_pages() / 20); > recommended_min <<= (PAGE_SHIFT-10); > > - if (recommended_min > min_free_kbytes) > + if

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-03 Thread Dave Hansen
On 01/02/2014 07:33 PM, Han Pingtian wrote: @@ -130,8 +130,11 @@ static int set_recommended_min_free_kbytes(void) (unsigned long) nr_free_buffer_pages() / 20); recommended_min = (PAGE_SHIFT-10); - if (recommended_min min_free_kbytes) + if

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-02 Thread Han Pingtian
On Thu, Jan 02, 2014 at 10:05:21AM -0800, Dave Hansen wrote: > On 12/31/2013 04:29 PM, Han Pingtian wrote: > > min_free_kbytes may be updated during thp's initialization. Sometimes, > > this will change the value being set by user. Showing message will > > clarify this confusion. > ... > > - if

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-02 Thread Dave Hansen
On 01/02/2014 03:36 PM, David Rientjes wrote: > On Thu, 2 Jan 2014, Dave Hansen wrote: >> Let's say enabling THP made my system behave badly. How do I get it >> back to the state before I enabled THP? The user has to have gone and >> recorded what their min_free_kbytes was before turning THP on

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-02 Thread David Rientjes
On Thu, 2 Jan 2014, Dave Hansen wrote: > > The default value of min_free_kbytes depends on the implementation of the > > VM regardless of any config options that you may have enabled. We don't > > specify what the non-thp default is in the kernel log, so why do we need > > to specify what the

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-02 Thread Dave Hansen
On 01/02/2014 01:58 PM, David Rientjes wrote: > On Thu, 2 Jan 2014, Dave Hansen wrote: > >>> min_free_kbytes may be updated during thp's initialization. Sometimes, >>> this will change the value being set by user. Showing message will >>> clarify this confusion. >> ... >>> - if (recommended_min

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-02 Thread David Rientjes
On Thu, 2 Jan 2014, Dave Hansen wrote: > > min_free_kbytes may be updated during thp's initialization. Sometimes, > > this will change the value being set by user. Showing message will > > clarify this confusion. > ... > > - if (recommended_min > min_free_kbytes) > > + if (recommended_min >

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-02 Thread Dave Hansen
On 12/31/2013 04:29 PM, Han Pingtian wrote: > min_free_kbytes may be updated during thp's initialization. Sometimes, > this will change the value being set by user. Showing message will > clarify this confusion. ... > - if (recommended_min > min_free_kbytes) > + if (recommended_min >

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-02 Thread Dave Hansen
On 12/31/2013 04:29 PM, Han Pingtian wrote: min_free_kbytes may be updated during thp's initialization. Sometimes, this will change the value being set by user. Showing message will clarify this confusion. ... - if (recommended_min min_free_kbytes) + if (recommended_min

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-02 Thread David Rientjes
On Thu, 2 Jan 2014, Dave Hansen wrote: min_free_kbytes may be updated during thp's initialization. Sometimes, this will change the value being set by user. Showing message will clarify this confusion. ... - if (recommended_min min_free_kbytes) + if (recommended_min

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-02 Thread Dave Hansen
On 01/02/2014 01:58 PM, David Rientjes wrote: On Thu, 2 Jan 2014, Dave Hansen wrote: min_free_kbytes may be updated during thp's initialization. Sometimes, this will change the value being set by user. Showing message will clarify this confusion. ... - if (recommended_min

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-02 Thread David Rientjes
On Thu, 2 Jan 2014, Dave Hansen wrote: The default value of min_free_kbytes depends on the implementation of the VM regardless of any config options that you may have enabled. We don't specify what the non-thp default is in the kernel log, so why do we need to specify what the thp

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-02 Thread Dave Hansen
On 01/02/2014 03:36 PM, David Rientjes wrote: On Thu, 2 Jan 2014, Dave Hansen wrote: Let's say enabling THP made my system behave badly. How do I get it back to the state before I enabled THP? The user has to have gone and recorded what their min_free_kbytes was before turning THP on in

Re: [RFC] mm: show message when updating min_free_kbytes in thp

2014-01-02 Thread Han Pingtian
On Thu, Jan 02, 2014 at 10:05:21AM -0800, Dave Hansen wrote: On 12/31/2013 04:29 PM, Han Pingtian wrote: min_free_kbytes may be updated during thp's initialization. Sometimes, this will change the value being set by user. Showing message will clarify this confusion. ... - if