From patchwork Wed Feb 17 20:46:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 12092291 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.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 68BFEC433E6 for ; Wed, 17 Feb 2021 20:46:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1119964E6C for ; Wed, 17 Feb 2021 20:46:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1119964E6C 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 40FD56B006E; Wed, 17 Feb 2021 15:46:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3C0816B0070; Wed, 17 Feb 2021 15:46:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1EF486B0071; Wed, 17 Feb 2021 15:46:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 03B6F6B006E for ; Wed, 17 Feb 2021 15:46:26 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id B89DA6D75 for ; Wed, 17 Feb 2021 20:46:26 +0000 (UTC) X-FDA: 77828942772.04.E5FA628 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by imf18.hostedemail.com (Postfix) with ESMTP id 723E82000D82 for ; Wed, 17 Feb 2021 20:46:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613594785; 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=QWpsk6WR+Bwp1z9BHMOtQqpluxvzU8iTR9I0eDmdXe0=; b=G0OUVkSZ6klEF7LfEvioWYIDACaOWqpyYJiv/mrpR+xyQWimQwkdlR8Ra1cbZ4Dp8eMrvi 3uZEm9L7HVkWSfEJ6nMLvIUD1RS+UnQwQzE5o+aIemH+hXuBUnpK5mYN9nk9Nkyr9j63D9 DaqebcMW4IyPhrMoaX7/TeuMjIrszLU= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-272-m6p2S-cPO72CDEHQJ68saw-1; Wed, 17 Feb 2021 15:46:24 -0500 X-MC-Unique: m6p2S-cPO72CDEHQJ68saw-1 Received: by mail-qv1-f69.google.com with SMTP id l13so10802739qvt.13 for ; Wed, 17 Feb 2021 12:46:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QWpsk6WR+Bwp1z9BHMOtQqpluxvzU8iTR9I0eDmdXe0=; b=fZzSc8LvtPSwEduG8JHi4UewyXIbERTq5OIZD/pTF7olLzwcF/pSUrF60dEqomnafY c5ObbdsoCkM3pyCBxCcE6z1KTpuUO1qF22ee/c+V1xBkQb1pzN4anatsGCeiizEWFnqA BVggUKu9zJpnSZUPoly8K65iLFBYVK6scT4bTUWIxkE6jaer1y5dJ72eWtGOq3pM0nvt WePphtA12F8IB8xvy7pprBooPixVFYBedoEpWSNJGZ45NL8uYIzZRbHQxbNffd/SLUai jpS0hhDGYvxdlnNRYxcldCj6yB9f90LkyNBG5/07pAnHRPSM/ahM25HxAtj1Xqzd5xvo HGTA== X-Gm-Message-State: AOAM531cGxe7bbUp2lMXXpXFIdjikIl1ZLnwvHVfVmzacz3Pa0l+DTha xwua4qvhBP36OJ/zYZk8to/WFyb1r7bxZub5a5dFrQGYBDM0ew8RMQFuOhLYmluG3t8sRtotWtY DsOfsJpbVzbmGjFPsBP6BL/+0o0nHZ+N3Gb9WGQBtoc1H5wZIhP04h+86rnRh X-Received: by 2002:a0c:8485:: with SMTP id m5mr878918qva.14.1613594783373; Wed, 17 Feb 2021 12:46:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJxzpJY/dYRuFJ0bbzo69kje8Ne04jgTMY6pdLwcYDopHHxPEES4boAYuLkYLXf2AHwHwph7Kg== X-Received: by 2002:a0c:8485:: with SMTP id m5mr878886qva.14.1613594783102; Wed, 17 Feb 2021 12:46:23 -0800 (PST) Received: from xz-x1.redhat.com (bras-vprn-toroon474qw-lp130-20-174-93-89-182.dsl.bell.ca. [174.93.89.182]) by smtp.gmail.com with ESMTPSA id p25sm2354901qkh.79.2021.02.17.12.46.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Feb 2021 12:46:22 -0800 (PST) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Mike Kravetz , peterx@redhat.com, Mike Rapoport , Andrea Arcangeli , Axel Rasmussen , Matthew Wilcox , "Kirill A . Shutemov" , Andrew Morton Subject: [PATCH v2 3/4] mm/hugetlb: Move flush_hugetlb_tlb_range() into hugetlb.h Date: Wed, 17 Feb 2021 15:46:18 -0500 Message-Id: <20210217204619.54761-2-peterx@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210217204619.54761-1-peterx@redhat.com> References: <20210217204418.54259-1-peterx@redhat.com> <20210217204619.54761-1-peterx@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Stat-Signature: 5dx4gy74mcy8kjbir5mhou1ceu3oacgo X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 723E82000D82 Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf18; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=63.128.21.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1613594786-835632 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: Prepare for it to be called outside of mm/hugetlb.c. Reviewed-by: Mike Kravetz Signed-off-by: Peter Xu --- include/linux/hugetlb.h | 8 ++++++++ mm/hugetlb.c | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index bc86f2f516e7..3b4104021dd3 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -952,4 +952,12 @@ static inline __init void hugetlb_cma_check(void) bool want_pmd_share(struct vm_area_struct *vma, unsigned long addr); +#ifndef __HAVE_ARCH_FLUSH_HUGETLB_TLB_RANGE +/* + * ARCHes with special requirements for evicting HUGETLB backing TLB entries can + * implement this. + */ +#define flush_hugetlb_tlb_range(vma, addr, end) flush_tlb_range(vma, addr, end) +#endif + #endif /* _LINUX_HUGETLB_H */ diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 8e8e2f3dfe06..f53a0b852ed8 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -4965,14 +4965,6 @@ long follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma, return i ? i : err; } -#ifndef __HAVE_ARCH_FLUSH_HUGETLB_TLB_RANGE -/* - * ARCHes with special requirements for evicting HUGETLB backing TLB entries can - * implement this. - */ -#define flush_hugetlb_tlb_range(vma, addr, end) flush_tlb_range(vma, addr, end) -#endif - unsigned long hugetlb_change_protection(struct vm_area_struct *vma, unsigned long address, unsigned long end, pgprot_t newprot) {