From patchwork Thu Feb 18 21:55:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 12094357 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 03A75C433E0 for ; Thu, 18 Feb 2021 21:56:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8312A64E38 for ; Thu, 18 Feb 2021 21:56:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8312A64E38 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 0A27E6B006C; Thu, 18 Feb 2021 16:56:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 02B1C6B006E; Thu, 18 Feb 2021 16:55:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E0D5A6B0070; Thu, 18 Feb 2021 16:55:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0142.hostedemail.com [216.40.44.142]) by kanga.kvack.org (Postfix) with ESMTP id C16B56B006C for ; Thu, 18 Feb 2021 16:55:59 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 8EA8E2497 for ; Thu, 18 Feb 2021 21:55:59 +0000 (UTC) X-FDA: 77832746838.06.FECC116 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf04.hostedemail.com (Postfix) with ESMTP id D2FFE138 for ; Thu, 18 Feb 2021 21:55:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613685358; 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=dE6cAOaasOy90WntQkvLo9Y3tII8NSr50Af2SEtWMdM=; b=G86AzqdVkBYPdAcgAkOHpwaiqbvLhmCQPt8hs8Zf/CPUL7mzJKCoKLDZUKJlGbimvrrT77 6zZqNaPkaO4/y7yJHfSxdbwJlrMvDW6OtGa8nwLGYptCYwim4g8oNX/vMrHfulcDotmsGf HM+h3PQzcf4aRhm3Bpo0/lGHBNgY7xk= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-589-vHHuBBodMO6j2B7hCx4HCA-1; Thu, 18 Feb 2021 16:55:55 -0500 X-MC-Unique: vHHuBBodMO6j2B7hCx4HCA-1 Received: by mail-qt1-f200.google.com with SMTP id l63so2063667qtd.12 for ; Thu, 18 Feb 2021 13:55:55 -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=dE6cAOaasOy90WntQkvLo9Y3tII8NSr50Af2SEtWMdM=; b=JPAn/bSNvrzsrP489TOUN2quWL5R/E09UXt4S+ij8JiCbdAMyU5FW3P5QlBOXMIbXX O3GmdnI51kXhhxf3QLJC9fee8qqXGD8BNwPFCENDfq332sMSfbUuz2UvSHYpktD3Ki4h K4h2H+joROXR1OAyuTZWL8sw+YbtnQ6c9fBUs2Pko5qY1GmdzhcoyuSkAiX1UIgqZjVH 1IxnpcF3Bx2u9mJmZoDPcDcDrJ33aGE/M5z9aq/ZZOcFO1RBxjuyi/y047ErYtYg7bk+ ueNLpd3rBV5+vpARpECsBXHthWxpqLbsGAq+0Ay4elf0JXxaCyI0VxmFGQAxBdLgj4TE kbGw== X-Gm-Message-State: AOAM5304KpuE7DyZzRsygBndsK2G6mtnJuLiN67e2mUfW5YrUBREz1UD V6w4SCEbTHcBYH723FJiAkyOwG7jvgDVdINaOVfa1ELoUSBpyiQVpQo6O0dhAf1ZyDuv6lsQBEI 4GIBy9mIEHUo= X-Received: by 2002:a05:620a:152f:: with SMTP id n15mr6697886qkk.268.1613685355317; Thu, 18 Feb 2021 13:55:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJxUYiPTPAG+FWyIYsYpoaJpCU9FHaZZLdQmhQYw1Jnez6gl+V7mpMBxMVwbBcm/2BMMAyhCjg== X-Received: by 2002:a05:620a:152f:: with SMTP id n15mr6697871qkk.268.1613685355126; Thu, 18 Feb 2021 13:55:55 -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 c7sm4311038qtm.60.2021.02.18.13.55.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Feb 2021 13:55:54 -0800 (PST) From: Peter Xu To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Mike Kravetz , Andrew Morton , Mike Rapoport , Andrea Arcangeli , peterx@redhat.com, Axel Rasmussen , "Kirill A . Shutemov" , Matthew Wilcox Subject: [PATCH v3 3/4] mm/hugetlb: Move flush_hugetlb_tlb_range() into hugetlb.h Date: Thu, 18 Feb 2021 16:55:53 -0500 Message-Id: <20210218215553.10661-1-peterx@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210218215434.10203-1-peterx@redhat.com> References: <20210218215434.10203-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-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: D2FFE138 X-Stat-Signature: 6szf7rb91qa6patdta5n5owthcgje6ty Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf04; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=216.205.24.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1613685357-581405 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 Reviewed-by: Axel Rasmussen 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) {