Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760314AbcDEXhi (ORCPT ); Tue, 5 Apr 2016 19:37:38 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36650 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753497AbcDEXhg (ORCPT ); Tue, 5 Apr 2016 19:37:36 -0400 Subject: Re: [PATCH 17/31] kvm: teach kvm to map page teams as huge pages. To: Hugh Dickins , Andrew Morton References: Cc: "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 From: Paolo Bonzini Message-ID: <57044C3A.7060109@redhat.com> Date: Wed, 6 Apr 2016 01:37:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 563 Lines: 18 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 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. Apart from this, both patches look good. Paolo