From patchwork Wed Jul 17 22:02:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13735845 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 055E9C3DA5D for ; Wed, 17 Jul 2024 22:02:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 516F26B0099; Wed, 17 Jul 2024 18:02:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4C6A96B00B5; Wed, 17 Jul 2024 18:02:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3670F6B00B6; Wed, 17 Jul 2024 18:02:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 1874B6B0099 for ; Wed, 17 Jul 2024 18:02:30 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id AE17E160D08 for ; Wed, 17 Jul 2024 22:02:29 +0000 (UTC) X-FDA: 82350619218.12.3C0C585 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf02.hostedemail.com (Postfix) with ESMTP id 83A258000D for ; Wed, 17 Jul 2024 22:02:27 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=IrrrMRtQ; spf=pass (imf02.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721253707; h=from:from:sender: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:dkim-signature; bh=6jtsZY5Ha1GOE7eeXCKiwGrLCKWt0M5FAlFhM8vgy8I=; b=MuoQpEA/IWR6pxrqPrbQgZyHJ9NzS7pEXCVOA8BbebRgli/4QEGc0VqYSbT2A69QbjFbta SQxxcwMWrW2RTxzV5+9+bW0eiC8iehbrcb+4TY8DXMcfNsqRxV+IZRbnwxs4wbgrLrgYzd +WxXeNlTjSQ0V22xkek7koL2vx/n258= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721253707; a=rsa-sha256; cv=none; b=Zfu5KVlho52cVf9G7bMaifKCEyDT5qUO2mSI4yQ8e5wpEk84a56/Q7VuRf3+zyh3kejNYs Xp2CwWykUYoPhQ1C0s7o2v/mFVRiDhfii0Um+olcMD4AKFzKAyHzF5UzW2TwESXM1hmnhc o1K/yzC2eX1c1SUMjPf1Xc7o6qzU4f4= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=IrrrMRtQ; spf=pass (imf02.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721253746; 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=6jtsZY5Ha1GOE7eeXCKiwGrLCKWt0M5FAlFhM8vgy8I=; b=IrrrMRtQ5cAn/Emv/YeLLe4jl7SuzdTcQvnzgzh0C1PEXlBviGBnPjJvjHOSNqG3v539W7 Ov7Are0BuBzBOm3dWRU/hpnct7WBrl9LO1lW5CoUHHGXq80VR8KlFphJrISAMi2PNUmf3q gTNNhwuPSycPVISTXybM7qSQIRvrbKA= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-173-4qGMDbH8P6yTYAaeOK41FQ-1; Wed, 17 Jul 2024 18:02:25 -0400 X-MC-Unique: 4qGMDbH8P6yTYAaeOK41FQ-1 Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-447f9d993c2so175541cf.1 for ; Wed, 17 Jul 2024 15:02:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721253745; x=1721858545; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6jtsZY5Ha1GOE7eeXCKiwGrLCKWt0M5FAlFhM8vgy8I=; b=juz3bW7jqtQDYCKOgIz0xM1LSyvyf/1W02rcYEtxxptymzEcIN1sySLYh7zubVU2G3 /bXAdwAQx6E4IpEt/SbsiIY1TK1p0x8rNG5g6ulC8OnkRT1CID5/K3PMxPeyECd8Htlw jbeP0/SLv8wSDbLJ2SxOn5S5MGVoVpKs1LORZcNo1my/maQYeQ88qw/Vg/j9h+8G8uHX PfCezv3NGUWae/zshxzBzkx+nYwczNOqNx5sTBRVFqS4eGyeSWgb3NJUgA0orvPObtDJ RBcH63N7sRPJymJyP5jiYb5kRvEJUZE2SFo8cnYTAS4xvVlPTCE+R2X+EnNigSw1oeZD m7Sw== X-Forwarded-Encrypted: i=1; AJvYcCUuGxibhugaKUs2W7kkJ4voUGEvKQPEmnyD2sv0xNZrk6Sxnhjk5x0465mnUGwldMECUv3w8dBMJg2yhUz0h0Oku0M= X-Gm-Message-State: AOJu0Yx8M+okg+AickQiOYWezYxljI8nK2mukRtvWx65QqBwLWIg/ScM 14RgNqlivwMnP87aXRmHIBD5wxfVf1XGih8jLfIUJ3pqNxrb7fXjPHytaWS3w6wMMcfXFEtOYde KFl0ww9xQe0iXwTq7J0C7fVALbbC7T9vTN+r4qYBXXEWfHglZ X-Received: by 2002:a05:622a:19a8:b0:446:5a29:c501 with SMTP id d75a77b69052e-44f864afa6cmr22369571cf.1.1721253744693; Wed, 17 Jul 2024 15:02:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFUvRqkcMnpaLn941R1BXuIssxTrm35f8/3mo50id9Lq3VPmnZD9wDrl4u3hs2U9BoucnNtpA== X-Received: by 2002:a05:622a:19a8:b0:446:5a29:c501 with SMTP id d75a77b69052e-44f864afa6cmr22369171cf.1.1721253744329; Wed, 17 Jul 2024 15:02:24 -0700 (PDT) Received: from x1n.redhat.com (pool-99-254-121-117.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-44f5b83f632sm53071651cf.85.2024.07.17.15.02.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jul 2024 15:02:23 -0700 (PDT) From: Peter Xu To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Vlastimil Babka , peterx@redhat.com, David Hildenbrand , Oscar Salvador , linux-s390@vger.kernel.org, Andrew Morton , Matthew Wilcox , Dan Williams , Michal Hocko , linux-riscv@lists.infradead.org, sparclinux@vger.kernel.org, Alex Williamson , Jason Gunthorpe , x86@kernel.org, Alistair Popple , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Ryan Roberts , Hugh Dickins , Axel Rasmussen Subject: [PATCH RFC 1/6] mm/treewide: Remove pgd_devmap() Date: Wed, 17 Jul 2024 18:02:14 -0400 Message-ID: <20240717220219.3743374-2-peterx@redhat.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240717220219.3743374-1-peterx@redhat.com> References: <20240717220219.3743374-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Stat-Signature: dgtunoq6of9pi96gniq8xki8wr1dzbzu X-Rspamd-Queue-Id: 83A258000D X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1721253747-683117 X-HE-Meta: U2FsdGVkX1/cPR4Fvz/kPRwEEsUjdpLbcQnyOnXdJT7AojaFLguZTQAK3pOraPIS1YKFYwUkYpsWCVDNbEsyDxTOzOIoeiUna0qOUSPZxWiPbjwzx4+BSv5W8DfSYKF36k9zNqrsNh5fk0zjFIU3TnG1lFoIMg5O/SJfBBHiEI9Z91UzFkdQkUMeaXd5JMDxSuliUIV8F8gpcVAo2hzix9Kbr3/Ph56KS6K8FS7yVE/PXjgqY85wFkTbDOzjCNY0KCq43aumZCzRl8nDMebe6LgBfrQDoNZ/20KNdN+K/b1fG/ONS7aGrjttE9IfN0C3o6YDbfLsQ5jXDNl7G4MREG5dFa/93orl8pxDwq/4WOvtLFoEkxtcXaeVjPyU3xjBKMsVldUZWjdW39A/sZiWGT+KdxUixDi9Aaux5i5mFmuxMXL4rtFfliEiT5IXozj81a7TvzHMPL0wyagPEGh9zwGWuD8lt/22aymwW4SFzWWSlLBR8Gz1R351VpA6ZU0G+kQAAzGtV5GSUanltDCIE28q/d/FLiJHRvDEsGWiLXoKLPAVYClicZT6kI9+/04YuGNi3BShAe3ODl90pDr3WueptqwXNS+JWyj1+6dPgChIQ9Pvg9FfCaYpKmaiRPRzDpB/OzCrKucU/ZHFVA0fKKZ93Z7TMV4R1n55orgS+yIdmS5y1iH5E4yelbXQ5h2+OkH5W6YHz+OMpxOvxchvom6qziHUczdu28MorPHdDUllN97rvanA2YItwHB7uKXko0EY/+ZhnGjqyjcjhvb9+jJs0cYj4IuvYYa4brNCgtP9npJljO6FPDfDzwitjg6sVFekiEn4tQjSnITzGlG3X7vP6Dcm44qUbSkxoA5Xjr4VjUMLyr6mKNHnLmammMIMw6L66jQXOpNp3UEvAivBfcutTuFsh1xp7D23yokK1pH+B2GvmQcO+qy6f6Vcsug0ciWLa/1PglqcMtH+mxg 53D2U8B7 Ptmv8wNbVlZCZ6zOJjVnCttWdO//sHc2ZH63DOMDlBszpNF9qXouwEn4lcFMdihbmV0ZHuiDUnPijXySJWJObSX1FuXMyGrS4oAHFNDqVInairIEV/rf6IidVdBoHyb9tx5MuMWzjWzpopoxphz58RUeK7ahBTEkJr6OQxD9k26d+J3l2Wqnh2AxvCoAm+bzAxp8QB7dNvZ6q0OynhiCOMUs/Dzm4/3Z40WRawW23iJ0dbvywQDfY9derbE3cmuk5Jx0oVzWm9w5/M71Rv0YYRi2ZnNfzp2fM+I3VYWNyd1hVcq2TLpsCrB0Lgfzsdne/rknOlwjrnSuxjcugNiooDOWjVvT53mN7kUMP/+xI5nrn+JOdpP2sdzDC59LFx3M/Li5X 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: List-Subscribe: List-Unsubscribe: It's always 0 for all archs, and there's no sign to even support p4d entry in the near future. Remove it until it's needed for real. Signed-off-by: Peter Xu --- arch/arm64/include/asm/pgtable.h | 5 ----- arch/powerpc/include/asm/book3s/64/pgtable.h | 5 ----- arch/x86/include/asm/pgtable.h | 5 ----- include/linux/pgtable.h | 4 ---- mm/gup.c | 2 -- 5 files changed, 21 deletions(-) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index f8efbc128446..5d5d1b18b837 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -1119,11 +1119,6 @@ static inline int pud_devmap(pud_t pud) { return 0; } - -static inline int pgd_devmap(pgd_t pgd) -{ - return 0; -} #endif #ifdef CONFIG_PAGE_TABLE_CHECK diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h index 5da92ba68a45..051b1b6d729c 100644 --- a/arch/powerpc/include/asm/book3s/64/pgtable.h +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h @@ -1431,11 +1431,6 @@ static inline int pud_devmap(pud_t pud) { return pte_devmap(pud_pte(pud)); } - -static inline int pgd_devmap(pgd_t pgd) -{ - return 0; -} #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ #define __HAVE_ARCH_PTEP_MODIFY_PROT_TRANSACTION diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 701593c53f3b..0d234f48ceeb 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -311,11 +311,6 @@ static inline int pud_devmap(pud_t pud) return 0; } #endif - -static inline int pgd_devmap(pgd_t pgd) -{ - return 0; -} #endif #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index 2289e9f7aa1b..0a904300ac90 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -1626,10 +1626,6 @@ static inline int pud_devmap(pud_t pud) { return 0; } -static inline int pgd_devmap(pgd_t pgd) -{ - return 0; -} #endif #if !defined(CONFIG_TRANSPARENT_HUGEPAGE) || \ diff --git a/mm/gup.c b/mm/gup.c index 54d0dc3831fb..b023bcd38235 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -3149,8 +3149,6 @@ static int gup_fast_pgd_leaf(pgd_t orig, pgd_t *pgdp, unsigned long addr, if (!pgd_access_permitted(orig, flags & FOLL_WRITE)) return 0; - BUILD_BUG_ON(pgd_devmap(orig)); - page = pgd_page(orig); refs = record_subpages(page, PGDIR_SIZE, addr, end, pages + *nr);