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=ham 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 AE40EC12002 for ; Mon, 19 Jul 2021 06:31:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8DF6060BD3 for ; Mon, 19 Jul 2021 06:31:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234345AbhGSGep (ORCPT ); Mon, 19 Jul 2021 02:34:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:23476 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233048AbhGSGeo (ORCPT ); Mon, 19 Jul 2021 02:34:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626676304; 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=gUQKFzVvF5M3lxyEmJpdtrfsz/7OWEVfY5ZBubdeBv2QHhrlvxuZ/iM9vUZnq+10eN6jdw EMeS8lYzDn6IO+VUlY9exNZOe/+S67I2dEUMlB33nXE7lmJQFocLmLqObYCQ6y7Y+74luC fSNnYR57sQmv3L8NKEsPT5Jv9TFtD6Y= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-122-PiUcYVZINui7BSlVU_s8TA-1; Mon, 19 Jul 2021 02:31:43 -0400 X-MC-Unique: PiUcYVZINui7BSlVU_s8TA-1 Received: by mail-ed1-f71.google.com with SMTP id g23-20020aa7c8570000b02903954c05c938so3121239edt.3 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=hHxnSObWQOTsEk0bi9qJsm8mt1UFKV+wVVcEvR3/5Gf4mI4mZ5Fgp+QZi/evClwkcT nEXUU03bnKBbNNNYIQRmoXUc1GTqV4Gso2MmkcrpKY1Lkr1nKb+ftcG/NDh0erA1vkBI Sm/ujS6tIJXDaq458dwz52Wj1a0rk8JH13IRaUD7DLQsb5mqEdePK28vJGq/eAZsHzbQ RGH2O0d9Dv3Vy/V3mPPcXPOCQdc9AfcosZ+4VvqXcWtgpjQLOp5vdNM7MBu10AkTlYeU R/vwbOrWkXFBjJ31r1VEIffPP338XDUbViHVRbrI7I4qgohQPFD1Jb/a9NomjtTkQr6i 9YeA== X-Gm-Message-State: AOAM530Y1QYHo+JWjIhED3v5RMk7lVcfydIa8waHjDJE29oEg7R6u2+D 9HmW65kGy2n5s2fFFqeFFfiNLSo2NTse5Rp45x+NxbOvb23T8KQd9jmWbe1EeDM984V3HYlmzxT DWaURo37lRSU5 X-Received: by 2002:a05:6402:692:: with SMTP id f18mr33054710edy.327.1626676302243; 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> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 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=-15.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 D3BE6C12002 for ; Mon, 19 Jul 2021 06:31:51 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 662D261186 for ; Mon, 19 Jul 2021 06:31:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 662D261186 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 0CEA24A7FD; Mon, 19 Jul 2021 02:31:51 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@redhat.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id buRTVdkVtXuo; Mon, 19 Jul 2021 02:31:49 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id C8F714A4E5; Mon, 19 Jul 2021 02:31:49 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 689F84A3A3 for ; Mon, 19 Jul 2021 02:31:48 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8IsbPB-HQDm4 for ; Mon, 19 Jul 2021 02:31:47 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 2CB6740856 for ; Mon, 19 Jul 2021 02:31:47 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626676307; 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=d4WKEHwru1rQlQ2jwZbZaU9BrQptj7DI0oAswioTfmBjmR3zMmA+szCCJacdzuH3fwTsG6 TIcY1ze/sKM/7I8eYDkxpbMTGK8j+mAJGLVGqISgSWOfo09Zkea0MA7lHtDBWOO3tj6mDB AHp6SeLgudfF+l4M5jUn70pOLDppNMQ= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-374-M2nFjTiMNRuGB9JTNnfmcg-1; Mon, 19 Jul 2021 02:31:43 -0400 X-MC-Unique: M2nFjTiMNRuGB9JTNnfmcg-1 Received: by mail-ed1-f71.google.com with SMTP id eg53-20020a05640228b5b02903ad3cc35040so7339615edb.11 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=GPQfTOaTo/i3qdjaegtjf1W6KG4nbK71uCrHenbDUHu+PAzRvCj6zq+4pArMHTrrmO KVGAQAGptNN4sD+1AsOqRUv1hntQWWDy+QA7ksC2lmQ+sR80CVSHVWfpARj37zlh5ZUI EyYx0PLxznHM04BosfZGlmbucJaYDW4dJyZHMZv2ajfDkwIEdtPzKUAeKT8P+mGtw7mR 6zNXmFyGP9WHkf7udgJAEk5S7nnbeTryBKqXBKb1sJH82tZuR5qXFp8tFfwOYnfkIR7t 6A7BV2wtxbwj9eFsFSP1yzKCqSHvxPdO5OvF/kasP+R6HJpKJej3AME12sb69NYCiTnO +d0A== X-Gm-Message-State: AOAM533Fs4IxasjWRov/Y580fr2d+wiCaG+Jxy8RJEq9OwVmN2OGM9JX kombJ+evs+kQfhBZPQg0Kd+6ivKm4xJNM1/CL49zLoXlDNxwe4DDHdxMDWFL32r1G/TpDZTTcy3 WEjh1y6kvUngcE0BmwkLuq9r0 X-Received: by 2002:a05:6402:692:: with SMTP id f18mr33054717edy.327.1626676302244; 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 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> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Cc: kernel-team@android.com, Sean Christopherson , Matthew Wilcox , Will Deacon X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu 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 _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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=-16.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 BC2E1C636C9 for ; Mon, 19 Jul 2021 06:33:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 89E0960BD3 for ; Mon, 19 Jul 2021 06:33:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 89E0960BD3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GfUuv+EWLDhYbcOacn3gsUxb1JhJNbCDabNqs6j4L2I=; b=ejC+lB+XBo1aWd9ya0xSSYKjsi 0Cq23L5Fet0It2W+eGXkKCgoyEP3nyNLtY5F6W+/Xqrcq9c8DTL1X+qcuT+0HPaM/JE6EhnWwLdfN D87pfzXQv3vDg6SYgLgB+ISUJhiyhz/8EtQ2d13v1pj+cUeOp22lzUBAbJeLDJcXrN6YKpgiq6Otu jWP58GMOdQSdpYiZ6G4ZqfL+MZ9mr/h1vY6Z2Hiz9QFIp5HS16MPlmuHC1vvwQMhoOthPSNwoVS7w X/jKHOgTbTMmmkI3rWTbwdxse7T008ScEdtyZlEtI4VGXMKzZ914WItzMC7AfD0JKtrt3sa3OpqzU +0b5kaDQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m5Moj-008TxJ-Ag; Mon, 19 Jul 2021 06:31:53 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m5Mod-008Tvy-KE for linux-arm-kernel@lists.infradead.org; Mon, 19 Jul 2021 06:31:49 +0000 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-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-374-TIZfiL3kNQuxgtZhFv1fMQ-1; Mon, 19 Jul 2021 02:31:43 -0400 X-MC-Unique: TIZfiL3kNQuxgtZhFv1fMQ-1 Received: by mail-ed1-f69.google.com with SMTP id n6-20020aa7c4460000b02903a12bbba1ebso8682894edr.6 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=Fzm5N+Ujtu2A7tM9BoUyZ/CwqJApeRDtWIz9fCJTMP1qSexSpZRpBLdyn4z4/OanYL B/JZx/v3ioTvOlY/eLCqp/w6e0BFL46UTrcj1ccwElUOVjTfzt3ZXD56BSAZRF0sd0O1 63AOtfbgwAJeiIalMJOPBKzWFnjGZ3hyyNEZq+74b9ITkXncCwReIrt+YV3BCSQ8MFEz c5gie6sHS5GNkVLbLNXeVpf69aysau5SSEZjxlclJ1vmnjGNIQS9RHGXsSi1GobFeJPp nLtsiC6txQDYfsmorSiex7bX/DpnL7UpRVStvLpjJud0s1dmbiHhJjOmnBlv40JNODk1 BkqQ== X-Gm-Message-State: AOAM5322g2qb+8EwbH10f3F6+uueSOVrmHVghSeIBjPFT1n8S1LG6Wdw WW62PANAACNcoIspPV0GsNDtbWZc2oxpMPbhjxdzXBLQTXz1Q2e+ZwJhk/K0QKZbcH57QolM1hQ N1FYEMeoZEOqWaqQUr0ya+mfJTz5w1NneqSQ= X-Received: by 2002:a05:6402:692:: with SMTP id f18mr33054715edy.327.1626676302243; 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> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210718_233147_776632_F5208E89 X-CRM114-Status: GOOD ( 26.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel