Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752766AbaJQOKO (ORCPT ); Fri, 17 Oct 2014 10:10:14 -0400 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:36989 "EHLO e06smtp17.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751939AbaJQOKL (ORCPT ); Fri, 17 Oct 2014 10:10:11 -0400 From: Dominik Dingel To: Andrew Morton , linux-mm@kvack.org, Mel Gorman , Michal Hocko , Rik van Riel Cc: Andrea Arcangeli , Andy Lutomirski , "Aneesh Kumar K.V" , Bob Liu , Christian Borntraeger , Cornelia Huck , Gleb Natapov , Heiko Carstens , "H. Peter Anvin" , Hugh Dickins , Ingo Molnar , Jianyu Zhan , Johannes Weiner , "Kirill A. Shutemov" , Konstantin Weitz , kvm@vger.kernel.org, linux390@de.ibm.com, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, Martin Schwidefsky , Paolo Bonzini , Peter Zijlstra , Sasha Levin , Dominik Dingel Subject: [PATCH 0/4] mm: new flag to forbid zero page mappings for a vma Date: Fri, 17 Oct 2014 16:09:46 +0200 Message-Id: <1413554990-48512-1-git-send-email-dingel@linux.vnet.ibm.com> X-Mailer: git-send-email 1.8.5.5 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14101714-0029-0000-0000-0000013DF890 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org s390 has the special notion of storage keys which are some sort of page flags associated with physical pages and live outside of direct addressable memory. These storage keys can be queried and changed with a special set of instructions. The mentioned instructions behave quite nicely under virtualization, if there is: - an invalid pte, then the instructions will work on some memory reserved in the host page table - a valid pte, then the instructions will work with the real storage key Thanks to Martin with his software reference and dirty bit tracking, the kernel does not issue any storage key instructions as now a software based approach will be taken, on the other hand distributions in the wild are currently using them. However, for virtualized guests we still have a problem with guest pages mapped to zero pages and the kernel same page merging. WIth each one multiple guest pages will point to the same physical page and share the same storage key. Let's fix this by introducing a new flag which will forbid new zero page mappings. If the guest issues a storage key related instruction we flag all vmas and drop existing zero page mappings and unmerge the guest memory. Dominik Dingel (4): s390/mm: recfactor global pgste updates mm: introduce new VM_NOZEROPAGE flag s390/mm: prevent and break zero page mappings in case of storage keys s390/mm: disable KSM for storage key enabled pages arch/s390/Kconfig | 3 + arch/s390/include/asm/pgalloc.h | 2 - arch/s390/include/asm/pgtable.h | 3 +- arch/s390/kvm/kvm-s390.c | 2 +- arch/s390/kvm/priv.c | 17 ++-- arch/s390/mm/pgtable.c | 181 ++++++++++++++++++---------------------- include/linux/mm.h | 13 ++- mm/huge_memory.c | 2 +- mm/memory.c | 2 +- 9 files changed, 112 insertions(+), 113 deletions(-) -- 1.8.5.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/