Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759790AbcDFBMJ (ORCPT ); Tue, 5 Apr 2016 21:12:09 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:36287 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754114AbcDFBMG (ORCPT ); Tue, 5 Apr 2016 21:12:06 -0400 Date: Tue, 5 Apr 2016 18:12:02 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Paolo Bonzini cc: Hugh Dickins , Andrew Morton , "Kirill A. Shutemov" , Andrea Arcangeli , Andres Lagar-Cavilla , Yang Shi , Ning Qu , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 17/31] kvm: teach kvm to map page teams as huge pages. In-Reply-To: <57044C3A.7060109@redhat.com> Message-ID: References: <57044C3A.7060109@redhat.com> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1412 Lines: 34 On Wed, 6 Apr 2016, Paolo Bonzini wrote: > On 05/04/2016 23:41, Hugh Dickins wrote: > > +/* > > + * We are holding kvm->mmu_lock, serializing against mmu notifiers. > > + * We have a ref on page. > > ... > > +static bool is_huge_tmpfs(struct kvm_vcpu *vcpu, > > + unsigned long address, struct page *page) > > vcpu is only used to access vcpu->kvm->mm. If it's still possible to Hah, you've lighted on precisely a line of code where I changed around what Andres had - I thought it nicer to pass down vcpu, because that matched the function above, and in many cases vcpu is not dereferenced here at all. So, definitely blame me not Andres for that interface. > give a sensible rule for locking, I wouldn't mind if is_huge_tmpfs took > the mm directly and was moved out of KVM. Otherwise, it would be quite > easy for people touch mm code to miss it. Good point. On the other hand, as you acknowledge in your "If...", it might turn out to be too special-purpose in its assumptions to be a safe export from core mm: Andres and I need to give it more thought. > > Apart from this, both patches look good. Thanks so much for such a quick response; and contrary to what I'd expected in my "FYI" comment, Andrew has taken them into his tree, to give them some early exposure via mmotm and linux-next - but of course that doesn't stop us from changing it as you suggest - we'll think it over again. Hugh