[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140123164334.GA7097@redhat.com>
Date: Thu, 23 Jan 2014 17:43:34 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Hugh Dickins <hughd@...gle.com>,
Gerald Schaefer <gerald.schaefer@...ibm.com>,
Martin Schwidefsky <schwidefsky@...ibm.com>,
Heiko Carstens <heiko.carstens@...ibm.com>
Cc: Alex Thorlton <athorlton@....com>,
Andrew Morton <akpm@...ux-foundation.org>,
"Kirill A. Shutemov" <kirill@...temov.name>,
linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Rik van Riel <riel@...hat.com>,
Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Andy Lutomirski <luto@...capital.net>,
Al Viro <viro@...iv.linux.org.uk>,
Kees Cook <keescook@...omium.org>,
Andrea Arcangeli <aarcange@...hat.com>,
Martin Schwidefsky <schwidefsky@...ibm.com>
Subject: Re: [PATCH 2/2] mm: thp: kill the bogus ->def_flags check in
hugepage_madvise()
On 01/22, Hugh Dickins wrote:
>
> On Wed, 22 Jan 2014, Oleg Nesterov wrote:
>
> > hugepage_madvise() checks "mm->def_flags & VM_NOHUGEPAGE" but
> > this can be never true, currently mm->def_flags can only have
> > VM_LOCKED.
>
> But line 1087 of arch/s390/mm/pgtable.c says
> mm->def_flags |= VM_NOHUGEPAGE;
> from 3eabaee998c787e7e1565574821652548f7fc003
> "KVM: s390: allow sie enablement for multi-threaded programs".
Argh. Thanks Hugh!
Another case when I forgot about /bin/grep. So the patch is wrong,
at least the changelog is certainly is. I am stupid.
But, perhaps, this all still can work? Looks like, s390 already
implements PR_SET_THP_DISABLE using the same idea, it would be
nice to avoid another hack.
Gerald, any chance we can revert 8e72033f2a489 "thp: make MADV_HUGEPAGE
check for mm->def_flags" ? The changelog says "In order to also prevent
MADV_HUGEPAGE on such an mm", is it really important? I mean, if the
application calls madvise(MADV_HUGEPAGE) it should probably know what
it does and, this can be useful after if PR_SET_THP_DISABLE or
KVM_S390_ENABLE_SIE. Of course I do not understand this code, perhaps
MADV_HUGEPAGE is simply impossible.
Another question, can't fork/exec preserve VM_NOHUGEPAGE in ->def_flags?
This is what PR_SET_THP_DISABLE wants.
I'll send you mbox with the previous discussion privately.
Thanks,
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists