From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FA9FC12002 for ; Mon, 19 Jul 2021 06:32:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0249660BD3 for ; Mon, 19 Jul 2021 06:32:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0249660BD3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 821A88D0107; Mon, 19 Jul 2021 02:32:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7F77A8D0100; Mon, 19 Jul 2021 02:32:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 671908D0107; Mon, 19 Jul 2021 02:32:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0093.hostedemail.com [216.40.44.93]) by kanga.kvack.org (Postfix) with ESMTP id 438EB8D0100 for ; Mon, 19 Jul 2021 02:32:49 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id D112C182CCFD0 for ; Mon, 19 Jul 2021 06:32:47 +0000 (UTC) X-FDA: 78378369174.15.AEFC6DE Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf16.hostedemail.com (Postfix) with ESMTP id 53858F000091 for ; Mon, 19 Jul 2021 06:31:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626676306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sDl9zJ8yJigPizUQxq5VDfedGB5Y2mU/bObQ9LMf+NY=; b=Fd3XdlE+6I3fM6xWEo2gZoyRoqBxlGcSAK75KKeqGrVszeUCLP2UeSKThyApKeckWZati6 rT7vJEwYJtjO0putOBlut4ZS4o/8Np96D/iiJUKu7fQg92hxmgGs4NfPitsu61un9MhY2q Xca/RwY682XKDHXAu1IjRm0k2P9zYTI= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-443-oeCEDdQGOCiwo2Xro4r-lw-1; Mon, 19 Jul 2021 02:31:43 -0400 X-MC-Unique: oeCEDdQGOCiwo2Xro4r-lw-1 Received: by mail-ed1-f70.google.com with SMTP id z13-20020a05640235cdb02903aa750a46efso8786067edc.8 for ; Sun, 18 Jul 2021 23:31:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=sDl9zJ8yJigPizUQxq5VDfedGB5Y2mU/bObQ9LMf+NY=; b=Y7hKy29O03ngQFcQ8stnMsJjFAcn23TRgq1Osb8x2v8IPPf/X/GBoi9x9+ev6xBD0L eMUq/B0d4FkCyVh0uMOlbNCmZKLGWM1NXt0QSXgXPaDg6Tzc3AykqPGpxJ6Qf5Baq9k8 6+ZIgKXI12Kadqrt1tsaZ2gRAYNYxANXNrPbtFbHcpzDKjO9YJJlBreZ0G1iitqgPbIV uSrO5LBgI3wb/YbrOMAB2ZpBDrsLaMUGly4ViJjWciUfcbPoDb7/yJA9kRVFPBRBW7WY ZR6+39A5H4LL/X0lDvaCKYLOMHobhD45xRNwqIPDMk1Zc1u7tunCxMYrkqvwvmHtfWTt W8nA== X-Gm-Message-State: AOAM5310Ctr2+z02lahD9bnZDBoQGVlA5Nm2l4XHkwZa+Lyo4MMMTfSz jq+33mD/lJl3AOt8qsyEAc9G/8PsM2bygtPLdJE2gXiCFJh3Ww/1ihlouVTcEZMuv4ZS6w+yt9r TSHN7tAtjcYI= X-Received: by 2002:a05:6402:692:: with SMTP id f18mr33054731edy.327.1626676302436; Sun, 18 Jul 2021 23:31:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy03G7eb3Ni5bq5T+4u9WmKa5rbbWmLEfjZhNZllL+I9GCy7NjuQxCbsv+toB/S7ycv5irrnA== X-Received: by 2002:a05:6402:692:: with SMTP id f18mr33054692edy.327.1626676302062; Sun, 18 Jul 2021 23:31:42 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:63a7:c72e:ea0e:6045? ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id i10sm7237674edf.12.2021.07.18.23.31.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Jul 2021 23:31:41 -0700 (PDT) Subject: Re: [PATCH 3/5] KVM: Remove kvm_is_transparent_hugepage() and PageTransCompoundMap() To: Marc Zyngier , linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-mm@kvack.org Cc: Sean Christopherson , Matthew Wilcox , Will Deacon , Quentin Perret , James Morse , Suzuki K Poulose , Alexandru Elisei , kernel-team@android.com References: <20210717095541.1486210-1-maz@kernel.org> <20210717095541.1486210-4-maz@kernel.org> From: Paolo Bonzini Message-ID: Date: Mon, 19 Jul 2021 08:31:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210717095541.1486210-4-maz@kernel.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Fd3XdlE+; spf=none (imf16.hostedemail.com: domain of pbonzini@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=pbonzini@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam02 X-Stat-Signature: a9oi6p8f5ecrf3fffz9x8kr1cg8qi9wg X-Rspamd-Queue-Id: 53858F000091 X-HE-Tag: 1626676307-453677 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 17/07/21 11:55, Marc Zyngier wrote: > Now that arm64 has stopped using kvm_is_transparent_hugepage(), > we can remove it, as well as PageTransCompoundMap() which was > only used by the former. > > Signed-off-by: Marc Zyngier > --- > include/linux/page-flags.h | 37 ------------------------------------- > virt/kvm/kvm_main.c | 10 ---------- > 2 files changed, 47 deletions(-) > > diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h > index 5922031ffab6..1ace27c4a8e0 100644 > --- a/include/linux/page-flags.h > +++ b/include/linux/page-flags.h > @@ -632,43 +632,6 @@ static inline int PageTransCompound(struct page *page) > return PageCompound(page); > } > > -/* > - * PageTransCompoundMap is the same as PageTransCompound, but it also > - * guarantees the primary MMU has the entire compound page mapped > - * through pmd_trans_huge, which in turn guarantees the secondary MMUs > - * can also map the entire compound page. This allows the secondary > - * MMUs to call get_user_pages() only once for each compound page and > - * to immediately map the entire compound page with a single secondary > - * MMU fault. If there will be a pmd split later, the secondary MMUs > - * will get an update through the MMU notifier invalidation through > - * split_huge_pmd(). > - * > - * Unlike PageTransCompound, this is safe to be called only while > - * split_huge_pmd() cannot run from under us, like if protected by the > - * MMU notifier, otherwise it may result in page->_mapcount check false > - * positives. > - * > - * We have to treat page cache THP differently since every subpage of it > - * would get _mapcount inc'ed once it is PMD mapped. But, it may be PTE > - * mapped in the current process so comparing subpage's _mapcount to > - * compound_mapcount to filter out PTE mapped case. > - */ > -static inline int PageTransCompoundMap(struct page *page) > -{ > - struct page *head; > - > - if (!PageTransCompound(page)) > - return 0; > - > - if (PageAnon(page)) > - return atomic_read(&page->_mapcount) < 0; > - > - head = compound_head(page); > - /* File THP is PMD mapped and not PTE mapped */ > - return atomic_read(&page->_mapcount) == > - atomic_read(compound_mapcount_ptr(head)); > -} > - > /* > * PageTransTail returns true for both transparent huge pages > * and hugetlbfs pages, so it should only be called when it's known > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index 7d95126cda9e..2e410a8a6a67 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c > @@ -189,16 +189,6 @@ bool kvm_is_reserved_pfn(kvm_pfn_t pfn) > return true; > } > > -bool kvm_is_transparent_hugepage(kvm_pfn_t pfn) > -{ > - struct page *page = pfn_to_page(pfn); > - > - if (!PageTransCompoundMap(page)) > - return false; > - > - return is_transparent_hugepage(compound_head(page)); > -} > - > /* > * Switches to specified vcpu, until a matching vcpu_put() > */ > Acked-by: Paolo Bonzini