On 27/02/14 18:23, Alex Thorlton wrote:
> As Christian pointed out, the recent 'Revert "thp: make MADV_HUGEPAGE
> check for mm->def_flags"' breaks qemu, it does QEMU_MADV_HUGEPAGE for
> all kvm pages but this doesn't work after s390_enable_sie/thp_split_mm.
> 
> Paolo suggested that instead of failing on the call to madvise, we
> simply ignore the call (return 0).
> 
> Reported-by: Christian Borntraeger <[email protected]>
> Suggested-by: Paolo Bonzini <[email protected]>
> Suggested-by: Oleg Nesterov <[email protected]>
> Signed-off-by: Alex Thorlton <[email protected]>
> Cc: Gerald Schaefer <[email protected]>
> Cc: Martin Schwidefsky <[email protected]>
> Cc: Heiko Carstens <[email protected]>
> Cc: Christian Borntraeger <[email protected]>
> Cc: Andrew Morton <[email protected]>
> Cc: Paolo Bonzini <[email protected]>
> Cc: "Kirill A. Shutemov" <[email protected]>
> Cc: Mel Gorman <[email protected]>
> Cc: Rik van Riel <[email protected]>
> Cc: Ingo Molnar <[email protected]>
> Cc: Peter Zijlstra <[email protected]>
> Cc: Andrea Arcangeli <[email protected]>
> Cc: Oleg Nesterov <[email protected]>
> Cc: "Eric W. Biederman" <[email protected]>
> Cc: Alexander Viro <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> 
> ---
>  mm/huge_memory.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index a4310a5..61d234d 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -1970,6 +1970,15 @@ int hugepage_madvise(struct vm_area_struct *vma,
>  {
>       switch (advice) {
>       case MADV_HUGEPAGE:
> +#ifdef CONFIG_S390
> +             /*
> +              * qemu blindly sets MADV_HUGEPAGE on all allocations, but s390
> +              * can't handle this properly after s390_enable_sie, so we 
> simply
> +              * ignore the madvise to prevent qemu from causing a SIGSEGV.
> +              */
> +             if (mm_has_pgste(vma->vm_mm))
> +                     return 0;
> +#endif
>               /*
>                * Be somewhat over-protective like KSM for now!
>                */
> 


Tested-by: Christian Borntraeger <[email protected]>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to