Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-27 Thread Alex Thorlton
On Wed, Feb 26, 2014 at 06:01:53PM -0600, Alex Thorlton wrote: > On Wed, Feb 26, 2014 at 03:24:34PM -0800, Andrew Morton wrote: > > On Wed, 26 Feb 2014 13:39:17 -0600 Alex Thorlton wrote: > > > > > > > > > > > > > > > I'd suggest the patch below on top of your changes, but I won't argue. > > >

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-27 Thread Oleg Nesterov
On 02/26, Gerald Schaefer wrote: > > On Wed, 26 Feb 2014 19:06:03 +0100 > Oleg Nesterov wrote: > > > It would be nice to also change thp_split_mm() to not not play with > > mm->def_flags, but I am not sure if we can do this. > > Hmm, I'm also wondering about this. Basically, we only need

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-27 Thread Oleg Nesterov
On 02/26, Paolo Bonzini wrote: > > > +#ifdef CONFIG_S390 > > + /* > > +* MADV_HUGEPAGE is broken after s390_enable_sie(), qemu > > +* blindly does madvise(MADV_HUGEPAGE) for for all kvm pages > > +* and expects it must fail on s390. Avoid a possible

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-27 Thread Oleg Nesterov
On 02/26, Paolo Bonzini wrote: +#ifdef CONFIG_S390 + /* +* MADV_HUGEPAGE is broken after s390_enable_sie(), qemu +* blindly does madvise(MADV_HUGEPAGE) for for all kvm pages +* and expects it must fail on s390. Avoid a possible SIGSEGV +

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-27 Thread Oleg Nesterov
On 02/26, Gerald Schaefer wrote: On Wed, 26 Feb 2014 19:06:03 +0100 Oleg Nesterov o...@redhat.com wrote: It would be nice to also change thp_split_mm() to not not play with mm-def_flags, but I am not sure if we can do this. Hmm, I'm also wondering about this. Basically, we only need

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-27 Thread Alex Thorlton
On Wed, Feb 26, 2014 at 06:01:53PM -0600, Alex Thorlton wrote: On Wed, Feb 26, 2014 at 03:24:34PM -0800, Andrew Morton wrote: On Wed, 26 Feb 2014 13:39:17 -0600 Alex Thorlton athorl...@sgi.com wrote: I'd suggest the patch below on top of your changes, but I won't argue.

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Alex Thorlton
On Wed, Feb 26, 2014 at 03:24:34PM -0800, Andrew Morton wrote: > On Wed, 26 Feb 2014 13:39:17 -0600 Alex Thorlton wrote: > > > > > > > > > > > I'd suggest the patch below on top of your changes, but I won't argue. > > > > I like this approach, and your updated comment as well. This should >

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Andrew Morton
On Wed, 26 Feb 2014 13:39:17 -0600 Alex Thorlton wrote: > > > > > > > I'd suggest the patch below on top of your changes, but I won't argue. > > I like this approach, and your updated comment as well. This should > probably go in as [PATCH 2/4] in my series. Do I need to spin a v5 > with

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Paolo Bonzini
> +#ifdef CONFIG_S390 > + /* > + * MADV_HUGEPAGE is broken after s390_enable_sie(), qemu > + * blindly does madvise(MADV_HUGEPAGE) for for all kvm pages > + * and expects it must fail on s390. Avoid a possible SIGSEGV > + * until

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Alex Thorlton
On Wed, Feb 26, 2014 at 08:27:36PM +0100, Christian Borntraeger wrote: > On 26/02/14 19:06, Oleg Nesterov wrote: > > On 02/26, Alex Thorlton wrote: > >> > >> + * MADV_HUGEPAGE after PRCTL_THP_DISABLE is broken on s390 because > >> + * qemu blindly does madvise(MADV_HUGEPAGE) after

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Christian Borntraeger
On 26/02/14 19:06, Oleg Nesterov wrote: > On 02/26, Alex Thorlton wrote: >> >> + * MADV_HUGEPAGE after PRCTL_THP_DISABLE is broken on s390 because >> + * qemu blindly does madvise(MADV_HUGEPAGE) after s390_enable_sie(). >> + */ >> +#ifdef CONFIG_S390 >> + if

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Gerald Schaefer
On Wed, 26 Feb 2014 19:06:03 +0100 Oleg Nesterov wrote: > On 02/26, Alex Thorlton wrote: > > > > + * MADV_HUGEPAGE after PRCTL_THP_DISABLE is broken on s390 because > > + * qemu blindly does madvise(MADV_HUGEPAGE) after s390_enable_sie(). > > + */ > > +#ifdef CONFIG_S390 > > + if

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Oleg Nesterov
On 02/26, Peter Zijlstra wrote: > > On Wed, Feb 26, 2014 at 04:31:44PM +0100, Oleg Nesterov wrote: > > /* > > @@ -1977,8 +1975,12 @@ int hugepage_madvise(struct vm_area_stru > > */ > > if (*vm_flags & (VM_HUGEPAGE | VM_NO_THP)) > > return

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Oleg Nesterov
On 02/26, Alex Thorlton wrote: > > + * MADV_HUGEPAGE after PRCTL_THP_DISABLE is broken on s390 because > + * qemu blindly does madvise(MADV_HUGEPAGE) after s390_enable_sie(). > + */ > +#ifdef CONFIG_S390 > + if (mm_has_pgste(vma->vm_mm)) > return -EINVAL; >

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Alex Thorlton
On Wed, Feb 26, 2014 at 05:57:59PM +0100, Peter Zijlstra wrote: > On Wed, Feb 26, 2014 at 04:31:44PM +0100, Oleg Nesterov wrote: > Do we want a comment here, explaining why s390 is special again? Here's what I've got, with everybody's suggestions spun together: diff --git a/mm/huge_memory.c

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Peter Zijlstra
On Wed, Feb 26, 2014 at 04:31:44PM +0100, Oleg Nesterov wrote: > --- x/arch/s390/mm/pgtable.c > +++ x/arch/s390/mm/pgtable.c > @@ -1084,7 +1084,6 @@ static inline void thp_split_mm(struct m > vma->vm_flags &= ~VM_HUGEPAGE; > vma->vm_flags |= VM_NOHUGEPAGE; > } > -

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Gerald Schaefer
On Wed, 26 Feb 2014 16:31:44 +0100 Oleg Nesterov wrote: > On 02/26, Christian Borntraeger wrote: > > > > On 26/02/14 15:50, Oleg Nesterov wrote: > > > > > > But perhaps qemu can be changed to avoid MADV_HUGEPAGE on s390 ? > > > Otherwise I'd suggest the change below. > > > > > > Oleg. > > > > >

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Oleg Nesterov
On 02/26, Christian Borntraeger wrote: > > On 26/02/14 15:50, Oleg Nesterov wrote: > > > > But perhaps qemu can be changed to avoid MADV_HUGEPAGE on s390 ? > > Otherwise I'd suggest the change below. > > > > Oleg. > > > > > > --- x/mm/huge_memory.c > > +++ x/mm/huge_memory.c > > @@ -1968,8 +1968,6

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Kirill A. Shutemov
Christian Borntraeger wrote: > On 26/02/14 15:50, Oleg Nesterov wrote: > [...] > > >> NAK. > >> > >> Since 2012 qemu does call "qemu_madvise(new_block->host, size, > >> QEMU_MADV_HUGEPAGE);" for all kvm pages. > >> (commit ad0b5321f1f797274603ebbe20108b0750baee94 Call MADV_HUGEPAGE for > >>

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Christian Borntraeger
On 26/02/14 15:50, Oleg Nesterov wrote: [...] >> NAK. >> >> Since 2012 qemu does call "qemu_madvise(new_block->host, size, >> QEMU_MADV_HUGEPAGE);" for all kvm pages. >> (commit ad0b5321f1f797274603ebbe20108b0750baee94 Call MADV_HUGEPAGE for >> guest RAM allocations) so this >> breaks any

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Oleg Nesterov
On 02/26, Christian Borntraeger wrote: > > On 26/02/14 00:53, a...@linux-foundation.org wrote: > > Subject: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch > > added to -mm tree > > To: > > athorl...@sgi.com,aarca...@redhat.com,borntrae...@de

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Oleg Nesterov
On 02/26, Christian Borntraeger wrote: On 26/02/14 00:53, a...@linux-foundation.org wrote: Subject: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree To: athorl...@sgi.com,aarca...@redhat.com,borntrae...@de.ibm.com,ebied...@xmission.com,gerald.schae

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Christian Borntraeger
On 26/02/14 15:50, Oleg Nesterov wrote: [...] NAK. Since 2012 qemu does call qemu_madvise(new_block-host, size, QEMU_MADV_HUGEPAGE); for all kvm pages. (commit ad0b5321f1f797274603ebbe20108b0750baee94 Call MADV_HUGEPAGE for guest RAM allocations) so this breaks any recent kvm guest on

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Kirill A. Shutemov
Christian Borntraeger wrote: On 26/02/14 15:50, Oleg Nesterov wrote: [...] NAK. Since 2012 qemu does call qemu_madvise(new_block-host, size, QEMU_MADV_HUGEPAGE); for all kvm pages. (commit ad0b5321f1f797274603ebbe20108b0750baee94 Call MADV_HUGEPAGE for guest RAM allocations) so

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Oleg Nesterov
On 02/26, Christian Borntraeger wrote: On 26/02/14 15:50, Oleg Nesterov wrote: But perhaps qemu can be changed to avoid MADV_HUGEPAGE on s390 ? Otherwise I'd suggest the change below. Oleg. --- x/mm/huge_memory.c +++ x/mm/huge_memory.c @@ -1968,8 +1968,6 @@ out: int

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Gerald Schaefer
On Wed, 26 Feb 2014 16:31:44 +0100 Oleg Nesterov o...@redhat.com wrote: On 02/26, Christian Borntraeger wrote: On 26/02/14 15:50, Oleg Nesterov wrote: But perhaps qemu can be changed to avoid MADV_HUGEPAGE on s390 ? Otherwise I'd suggest the change below. Oleg. ---

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Peter Zijlstra
On Wed, Feb 26, 2014 at 04:31:44PM +0100, Oleg Nesterov wrote: --- x/arch/s390/mm/pgtable.c +++ x/arch/s390/mm/pgtable.c @@ -1084,7 +1084,6 @@ static inline void thp_split_mm(struct m vma-vm_flags = ~VM_HUGEPAGE; vma-vm_flags |= VM_NOHUGEPAGE; } -

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Alex Thorlton
On Wed, Feb 26, 2014 at 05:57:59PM +0100, Peter Zijlstra wrote: On Wed, Feb 26, 2014 at 04:31:44PM +0100, Oleg Nesterov wrote: Do we want a comment here, explaining why s390 is special again? Here's what I've got, with everybody's suggestions spun together: diff --git a/mm/huge_memory.c

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Oleg Nesterov
On 02/26, Alex Thorlton wrote: + * MADV_HUGEPAGE after PRCTL_THP_DISABLE is broken on s390 because + * qemu blindly does madvise(MADV_HUGEPAGE) after s390_enable_sie(). + */ +#ifdef CONFIG_S390 + if (mm_has_pgste(vma-vm_mm)) return -EINVAL; +#endif

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Oleg Nesterov
On 02/26, Peter Zijlstra wrote: On Wed, Feb 26, 2014 at 04:31:44PM +0100, Oleg Nesterov wrote: /* @@ -1977,8 +1975,12 @@ int hugepage_madvise(struct vm_area_stru */ if (*vm_flags (VM_HUGEPAGE | VM_NO_THP)) return -EINVAL; -

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Gerald Schaefer
On Wed, 26 Feb 2014 19:06:03 +0100 Oleg Nesterov o...@redhat.com wrote: On 02/26, Alex Thorlton wrote: + * MADV_HUGEPAGE after PRCTL_THP_DISABLE is broken on s390 because + * qemu blindly does madvise(MADV_HUGEPAGE) after s390_enable_sie(). + */ +#ifdef CONFIG_S390 + if

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Christian Borntraeger
On 26/02/14 19:06, Oleg Nesterov wrote: On 02/26, Alex Thorlton wrote: + * MADV_HUGEPAGE after PRCTL_THP_DISABLE is broken on s390 because + * qemu blindly does madvise(MADV_HUGEPAGE) after s390_enable_sie(). + */ +#ifdef CONFIG_S390 + if (mm_has_pgste(vma-vm_mm))

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Alex Thorlton
On Wed, Feb 26, 2014 at 08:27:36PM +0100, Christian Borntraeger wrote: On 26/02/14 19:06, Oleg Nesterov wrote: On 02/26, Alex Thorlton wrote: + * MADV_HUGEPAGE after PRCTL_THP_DISABLE is broken on s390 because + * qemu blindly does madvise(MADV_HUGEPAGE) after s390_enable_sie(). + */

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Paolo Bonzini
+#ifdef CONFIG_S390 + /* + * MADV_HUGEPAGE is broken after s390_enable_sie(), qemu + * blindly does madvise(MADV_HUGEPAGE) for for all kvm pages + * and expects it must fail on s390. Avoid a possible SIGSEGV + * until qemu is

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Andrew Morton
On Wed, 26 Feb 2014 13:39:17 -0600 Alex Thorlton athorl...@sgi.com wrote: I'd suggest the patch below on top of your changes, but I won't argue. I like this approach, and your updated comment as well. This should probably go in as [PATCH 2/4] in my series. Do I need to spin a v5

Re: + mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch added to -mm tree

2014-02-26 Thread Alex Thorlton
On Wed, Feb 26, 2014 at 03:24:34PM -0800, Andrew Morton wrote: On Wed, 26 Feb 2014 13:39:17 -0600 Alex Thorlton athorl...@sgi.com wrote: I'd suggest the patch below on top of your changes, but I won't argue. I like this approach, and your updated comment as well. This should