From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH 2/4] mm: introduce new VM_NOZEROPAGE flag Date: Tue, 21 Oct 2014 10:11:43 +0200 Message-ID: <5446153F.6030407@redhat.com> References: <1413554990-48512-1-git-send-email-dingel@linux.vnet.ibm.com> <1413554990-48512-3-git-send-email-dingel@linux.vnet.ibm.com> <54419265.9000000@intel.com> <20141018164928.2341415f@BR9TG4T3.de.ibm.com> <54429521.80402@intel.com> <5445511D.1090603@redhat.com> <20141021081131.641c6104@mschwide> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: Dave Hansen , Dominik Dingel , Andrew Morton , linux-mm@kvack.org, Mel Gorman , Michal Hocko , Rik van Riel , 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" Return-path: In-Reply-To: <20141021081131.641c6104@mschwide> Sender: owner-linux-mm@kvack.org List-Id: kvm.vger.kernel.org On 10/21/2014 08:11 AM, Martin Schwidefsky wrote: >> I agree with Dave (I thought I disagreed, but I changed my mind while >> writing down my thoughts). Just define mm_forbids_zeropage in >> arch/s390/include/asm, and make it return mm->context.use_skey---with a >> comment explaining how this is only for processes that use KVM, and then >> only for guests that use storage keys. > > The mm_forbids_zeropage() sure will work for now, but I think a vma flag > is the better solution. This is analog to VM_MERGEABLE or VM_NOHUGEPAGE, > the best solution would be to only mark those vmas that are mapped to > the guest. That we have not found a way to do that yet in a sensible way > does not change the fact that "no-zero-page" is a per-vma property, no? I agree it should be per-VMA. However, right now the code is complicated unnecessarily by making it a per-VMA flag. Also, setting the flag per VMA should probably be done in kvm_arch_prepare_memory_region together with some kind of storage key notifier. This is not very much like Dominik's patch. All in all, mm_forbids_zeropage() provides a non-intrusive and non-controversial way to fix the bug. Later on, switching to vma_forbids_zeropage() will be trivial as far as mm/ code is concerned. > But if you insist we go with the mm_forbids_zeropage() until we find a > clever way to distinguish the guest vmas from the qemu ones. Yeah, I think it is simpler for now. Paolo -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org