Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-22 Thread David Rientjes
On Wed, 22 Jan 2014, Alex Thorlton wrote: > > I would expect that the alternative solution to a per-mm switch is to > > reserve the naturally aligned pages for a THP promotion. Have a threshold > > of pages pages that must be faulted before the full THP's worth of pages > > is allocated, zero'd

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-22 Thread Alex Thorlton
On Wed, Jan 22, 2014 at 10:26:21AM +, Mel Gorman wrote: > On Tue, Jan 14, 2014 at 01:38:01PM -0600, Alex Thorlton wrote: > > On Tue, Jan 14, 2014 at 03:44:57PM +, Mel Gorman wrote: > > > On Fri, Jan 10, 2014 at 04:39:09PM -0600, Alex Thorlton wrote: > > > > On Fri, Jan 10, 2014 at

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-22 Thread Mel Gorman
On Tue, Jan 14, 2014 at 01:38:01PM -0600, Alex Thorlton wrote: > On Tue, Jan 14, 2014 at 03:44:57PM +, Mel Gorman wrote: > > On Fri, Jan 10, 2014 at 04:39:09PM -0600, Alex Thorlton wrote: > > > On Fri, Jan 10, 2014 at 11:10:10PM +0100, Peter Zijlstra wrote: > > > > We already have the

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-22 Thread Mel Gorman
On Tue, Jan 14, 2014 at 01:38:01PM -0600, Alex Thorlton wrote: On Tue, Jan 14, 2014 at 03:44:57PM +, Mel Gorman wrote: On Fri, Jan 10, 2014 at 04:39:09PM -0600, Alex Thorlton wrote: On Fri, Jan 10, 2014 at 11:10:10PM +0100, Peter Zijlstra wrote: We already have the information to

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-22 Thread Alex Thorlton
On Wed, Jan 22, 2014 at 10:26:21AM +, Mel Gorman wrote: On Tue, Jan 14, 2014 at 01:38:01PM -0600, Alex Thorlton wrote: On Tue, Jan 14, 2014 at 03:44:57PM +, Mel Gorman wrote: On Fri, Jan 10, 2014 at 04:39:09PM -0600, Alex Thorlton wrote: On Fri, Jan 10, 2014 at 11:10:10PM +0100,

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-22 Thread David Rientjes
On Wed, 22 Jan 2014, Alex Thorlton wrote: I would expect that the alternative solution to a per-mm switch is to reserve the naturally aligned pages for a THP promotion. Have a threshold of pages pages that must be faulted before the full THP's worth of pages is allocated, zero'd and a

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-14 Thread Alex Thorlton
On Tue, Jan 14, 2014 at 03:44:57PM +, Mel Gorman wrote: > On Fri, Jan 10, 2014 at 04:39:09PM -0600, Alex Thorlton wrote: > > On Fri, Jan 10, 2014 at 11:10:10PM +0100, Peter Zijlstra wrote: > > > We already have the information to determine if a page is shared across > > > nodes, Mel even had

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-14 Thread Mel Gorman
On Sat, Jan 11, 2014 at 12:23:15AM +0200, Kirill A. Shutemov wrote: > On Fri, Jan 10, 2014 at 04:01:55PM -0600, Alex Thorlton wrote: > > On Fri, Jan 10, 2014 at 10:23:10PM +0200, Kirill A. Shutemov wrote: > > > Do you know what cause the difference? I prefer to fix THP instead of > > > adding new

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-14 Thread Mel Gorman
On Fri, Jan 10, 2014 at 04:39:09PM -0600, Alex Thorlton wrote: > On Fri, Jan 10, 2014 at 11:10:10PM +0100, Peter Zijlstra wrote: > > We already have the information to determine if a page is shared across > > nodes, Mel even had some prototype code to do splits under those > > conditions. > > I'm

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-14 Thread Mel Gorman
On Fri, Jan 10, 2014 at 04:39:09PM -0600, Alex Thorlton wrote: On Fri, Jan 10, 2014 at 11:10:10PM +0100, Peter Zijlstra wrote: We already have the information to determine if a page is shared across nodes, Mel even had some prototype code to do splits under those conditions. I'm aware

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-14 Thread Mel Gorman
On Sat, Jan 11, 2014 at 12:23:15AM +0200, Kirill A. Shutemov wrote: On Fri, Jan 10, 2014 at 04:01:55PM -0600, Alex Thorlton wrote: On Fri, Jan 10, 2014 at 10:23:10PM +0200, Kirill A. Shutemov wrote: Do you know what cause the difference? I prefer to fix THP instead of adding new knob to

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-14 Thread Alex Thorlton
On Tue, Jan 14, 2014 at 03:44:57PM +, Mel Gorman wrote: On Fri, Jan 10, 2014 at 04:39:09PM -0600, Alex Thorlton wrote: On Fri, Jan 10, 2014 at 11:10:10PM +0100, Peter Zijlstra wrote: We already have the information to determine if a page is shared across nodes, Mel even had some

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-13 Thread Alex Thorlton
On Sun, Jan 12, 2014 at 02:56:00PM +0100, Oleg Nesterov wrote: > On 01/11, Alex Thorlton wrote: > > > > On Sat, Jan 11, 2014 at 04:53:37PM +0100, Oleg Nesterov wrote: > > > > > I simply can't understand, this all looks like overkill. Can't you simply > > > add > > > > > > #idfef

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-13 Thread Alex Thorlton
On Sun, Jan 12, 2014 at 02:56:00PM +0100, Oleg Nesterov wrote: On 01/11, Alex Thorlton wrote: On Sat, Jan 11, 2014 at 04:53:37PM +0100, Oleg Nesterov wrote: I simply can't understand, this all looks like overkill. Can't you simply add #idfef CONFIG_TRANSPARENT_HUGEPAGE

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-12 Thread Oleg Nesterov
On 01/11, Alex Thorlton wrote: > > On Sat, Jan 11, 2014 at 04:53:37PM +0100, Oleg Nesterov wrote: > > > I simply can't understand, this all looks like overkill. Can't you simply > > add > > > > #idfef CONFIG_TRANSPARENT_HUGEPAGE > > case GET: > > error =

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-12 Thread Oleg Nesterov
On 01/11, Alex Thorlton wrote: On Sat, Jan 11, 2014 at 04:53:37PM +0100, Oleg Nesterov wrote: I simply can't understand, this all looks like overkill. Can't you simply add #idfef CONFIG_TRANSPARENT_HUGEPAGE case GET: error = test_bit(MMF_THP_DISABLE);

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-11 Thread Alex Thorlton
On Sat, Jan 11, 2014 at 04:53:37PM +0100, Oleg Nesterov wrote: > On 01/10, Alex Thorlton wrote: > > > > This patch adds an mm flag (MMF_THP_DISABLE) to disable transparent > > hugepages using prctl. It is based on my original patch to add a > > per-task_struct flag to disable THP: > > I leave

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-11 Thread Oleg Nesterov
On 01/10, Kirill A. Shutemov wrote: > > I prefer to fix THP instead of > adding new knob to disable it. I agree. But if we have the per-vma MADV/VM_ flags, it looks natural to also have the per-mm know which affects all vmas. Besides this allows to control the thp behaviour after exec. Oleg.

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-11 Thread Oleg Nesterov
On 01/10, Alex Thorlton wrote: > > This patch adds an mm flag (MMF_THP_DISABLE) to disable transparent > hugepages using prctl. It is based on my original patch to add a > per-task_struct flag to disable THP: I leave the "whether we need this feature" to other reviewers, although personally I

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-11 Thread Oleg Nesterov
On 01/10, Alex Thorlton wrote: This patch adds an mm flag (MMF_THP_DISABLE) to disable transparent hugepages using prctl. It is based on my original patch to add a per-task_struct flag to disable THP: I leave the whether we need this feature to other reviewers, although personally I think it

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-11 Thread Oleg Nesterov
On 01/10, Kirill A. Shutemov wrote: I prefer to fix THP instead of adding new knob to disable it. I agree. But if we have the per-vma MADV/VM_ flags, it looks natural to also have the per-mm know which affects all vmas. Besides this allows to control the thp behaviour after exec. Oleg. --

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-11 Thread Alex Thorlton
On Sat, Jan 11, 2014 at 04:53:37PM +0100, Oleg Nesterov wrote: On 01/10, Alex Thorlton wrote: This patch adds an mm flag (MMF_THP_DISABLE) to disable transparent hugepages using prctl. It is based on my original patch to add a per-task_struct flag to disable THP: I leave the whether

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-10 Thread Alex Thorlton
On Fri, Jan 10, 2014 at 11:10:10PM +0100, Peter Zijlstra wrote: > We already have the information to determine if a page is shared across > nodes, Mel even had some prototype code to do splits under those > conditions. I'm aware that we can determine if pages are shared across nodes, but I

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-10 Thread Kirill A. Shutemov
On Fri, Jan 10, 2014 at 04:01:55PM -0600, Alex Thorlton wrote: > On Fri, Jan 10, 2014 at 10:23:10PM +0200, Kirill A. Shutemov wrote: > > Do you know what cause the difference? I prefer to fix THP instead of > > adding new knob to disable it. > > The issue is that when you touch 1 byte of an

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-10 Thread Peter Zijlstra
On Fri, Jan 10, 2014 at 04:01:55PM -0600, Alex Thorlton wrote: > On Fri, Jan 10, 2014 at 10:23:10PM +0200, Kirill A. Shutemov wrote: > > Do you know what cause the difference? I prefer to fix THP instead of > > adding new knob to disable it. > > The issue is that when you touch 1 byte of an

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-10 Thread Alex Thorlton
On Fri, Jan 10, 2014 at 10:23:10PM +0200, Kirill A. Shutemov wrote: > Do you know what cause the difference? I prefer to fix THP instead of > adding new knob to disable it. The issue is that when you touch 1 byte of an untouched, contiguous 2MB chunk, a THP will be handed out, and the THP will be

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-10 Thread Kirill A. Shutemov
On Fri, Jan 10, 2014 at 01:55:18PM -0600, Alex Thorlton wrote: > This patch adds an mm flag (MMF_THP_DISABLE) to disable transparent > hugepages using prctl. It is based on my original patch to add a > per-task_struct flag to disable THP: > > v1 - https://lkml.org/lkml/2013/8/2/671 > v2 -

[RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-10 Thread Alex Thorlton
This patch adds an mm flag (MMF_THP_DISABLE) to disable transparent hugepages using prctl. It is based on my original patch to add a per-task_struct flag to disable THP: v1 - https://lkml.org/lkml/2013/8/2/671 v2 - https://lkml.org/lkml/2013/8/2/703 After looking at alternate methods of

[RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-10 Thread Alex Thorlton
This patch adds an mm flag (MMF_THP_DISABLE) to disable transparent hugepages using prctl. It is based on my original patch to add a per-task_struct flag to disable THP: v1 - https://lkml.org/lkml/2013/8/2/671 v2 - https://lkml.org/lkml/2013/8/2/703 After looking at alternate methods of

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-10 Thread Kirill A. Shutemov
On Fri, Jan 10, 2014 at 01:55:18PM -0600, Alex Thorlton wrote: This patch adds an mm flag (MMF_THP_DISABLE) to disable transparent hugepages using prctl. It is based on my original patch to add a per-task_struct flag to disable THP: v1 - https://lkml.org/lkml/2013/8/2/671 v2 -

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-10 Thread Alex Thorlton
On Fri, Jan 10, 2014 at 10:23:10PM +0200, Kirill A. Shutemov wrote: Do you know what cause the difference? I prefer to fix THP instead of adding new knob to disable it. The issue is that when you touch 1 byte of an untouched, contiguous 2MB chunk, a THP will be handed out, and the THP will be

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-10 Thread Peter Zijlstra
On Fri, Jan 10, 2014 at 04:01:55PM -0600, Alex Thorlton wrote: On Fri, Jan 10, 2014 at 10:23:10PM +0200, Kirill A. Shutemov wrote: Do you know what cause the difference? I prefer to fix THP instead of adding new knob to disable it. The issue is that when you touch 1 byte of an untouched,

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-10 Thread Kirill A. Shutemov
On Fri, Jan 10, 2014 at 04:01:55PM -0600, Alex Thorlton wrote: On Fri, Jan 10, 2014 at 10:23:10PM +0200, Kirill A. Shutemov wrote: Do you know what cause the difference? I prefer to fix THP instead of adding new knob to disable it. The issue is that when you touch 1 byte of an untouched,

Re: [RFC PATCH] mm: thp: Add per-mm_struct flag to control THP

2014-01-10 Thread Alex Thorlton
On Fri, Jan 10, 2014 at 11:10:10PM +0100, Peter Zijlstra wrote: We already have the information to determine if a page is shared across nodes, Mel even had some prototype code to do splits under those conditions. I'm aware that we can determine if pages are shared across nodes, but I thought