From patchwork Sat Feb 18 00:27:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Houghton X-Patchwork-Id: 13145368 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 46E96C6379F for ; Sat, 18 Feb 2023 00:28:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 596156B0073; Fri, 17 Feb 2023 19:28:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 54F716B0074; Fri, 17 Feb 2023 19:28:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 40C9D280001; Fri, 17 Feb 2023 19:28:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 2DD316B0073 for ; Fri, 17 Feb 2023 19:28:48 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 019BD1C607E for ; Sat, 18 Feb 2023 00:28:47 +0000 (UTC) X-FDA: 80478527136.16.9C2F881 Received: from mail-vs1-f73.google.com (mail-vs1-f73.google.com [209.85.217.73]) by imf17.hostedemail.com (Postfix) with ESMTP id 3D54C40002 for ; Sat, 18 Feb 2023 00:28:46 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=lQipQIAG; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf17.hostedemail.com: domain of 3vRvwYwoKCNoFPDKQCDPKJCKKCHA.8KIHEJQT-IIGR68G.KNC@flex--jthoughton.bounces.google.com designates 209.85.217.73 as permitted sender) smtp.mailfrom=3vRvwYwoKCNoFPDKQCDPKJCKKCHA.8KIHEJQT-IIGR68G.KNC@flex--jthoughton.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1676680126; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=LnKhelmr0oBezYImc/CiFkR5B91EfUKvE0Rbw9pLRe4=; b=t6uCG7dCeyaMvb8eJM1PUd2FZ/A4RT2b+zxC/v0u0sKCQC2ONueRQ02JiX2eFc4bbjvJdR 0nSCQfwtiAi0orHhGo39ZaraiSEvV8tq8zo/k1uHC07nsly+fakczkEsDWblL3tB+P6eUm 4YLfbtzn0E2/e9sRDxMuascYZoNGnJ8= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=lQipQIAG; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf17.hostedemail.com: domain of 3vRvwYwoKCNoFPDKQCDPKJCKKCHA.8KIHEJQT-IIGR68G.KNC@flex--jthoughton.bounces.google.com designates 209.85.217.73 as permitted sender) smtp.mailfrom=3vRvwYwoKCNoFPDKQCDPKJCKKCHA.8KIHEJQT-IIGR68G.KNC@flex--jthoughton.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676680126; a=rsa-sha256; cv=none; b=yg9zpS8shQbV3W7E/taGWb+NCP7SRRdg/Lay5ddoG1L4HlkjekCcGY9W0sgTCbFOu+xask T77V49KHHHn+USoRHw6FqQV3k2imL462k9PivbCpw9yezJeRXf4++vp0hD3mkkh15t3YEC 64NbuN38NHQ0sVxwrrj4DlB268TaqE8= Received: by mail-vs1-f73.google.com with SMTP id l16-20020a67ba10000000b00411d9dbb998so583201vsn.1 for ; Fri, 17 Feb 2023 16:28:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=LnKhelmr0oBezYImc/CiFkR5B91EfUKvE0Rbw9pLRe4=; b=lQipQIAGaSVcFBsRExtQaFLnPm6HAzNz2+VJbpondpycb1x3PDuXTd+i0o++TSF9er gxut9YhAnGbep2SPcG0jDIMVR2mq6NQ41EE/6bkL3ZaN7Gb6kf8EWJR5CwB22gEUYwsb dux6/8aAmRzRNX/2PmjME6f1c/ZNU7ZaQroNOMlaJyZVlnL1oAKwRpxb7/HYgt7/PydP lxdcZ2uDPD9axodhgg/osne68KRXEtgsS6fa3iXBXgLQZ3W+b4wOBh19dwO8qERvglmh y56jvQy6e2CUxUzTLyorFkYxBNBmTKZfxgrrDzoZSssQ0cO8QYft6CecYtHZ5imrv86K Ha7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LnKhelmr0oBezYImc/CiFkR5B91EfUKvE0Rbw9pLRe4=; b=J6NpTw8EExPO2ruTzkNeJG4rGAt3KsItGHgIGC9kfKlWllZIJ1DC29AfRIJrNvpBzz YTGhL39b1VkaN5k48na4O1lwsQNwOMwhSU06g49HoMzP1ilAk2JKD2gqfkDKcJSCbQj4 P3Yg++kNWgH//PC7h0ORq9FZuMy2ZeFhVXa/rkVyC3AvBy8br1qb2aWmhbRd/hjYsEMR upGxzJQUmfkKalACMdwRJxv5vbhtfFIgCcwTCdCBznAQwop7rTL/6/7qvJuAPuMjkfrc UNBh/zESbpteX1PPEch0WAPlPBwcebX9v2dCfkKYwv61vpNMRZnXfDKWoq8g8WZgpEOB 16uw== X-Gm-Message-State: AO0yUKUaBSIChZF6byR0qpK5mPMFJ1osI/M9aLOL0ayOj1Fqrv0SjzaU 5yVm/MPYnH7Lwiw81CxyD6VjnU2LQ7n1c8sf X-Google-Smtp-Source: AK7set9cfmc3rDPTjjWrEWA1g/aV5e0+YQFlWRnOBBxS/xzEKz7fRzIC1V+FfmOXZMHdILJkQVdHqDoADwXiTyis X-Received: from jthoughton.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:2a4f]) (user=jthoughton job=sendgmr) by 2002:a05:6130:a0a:b0:67a:2833:5ceb with SMTP id bx10-20020a0561300a0a00b0067a28335cebmr54247uab.0.1676680125416; Fri, 17 Feb 2023 16:28:45 -0800 (PST) Date: Sat, 18 Feb 2023 00:27:35 +0000 In-Reply-To: <20230218002819.1486479-1-jthoughton@google.com> Mime-Version: 1.0 References: <20230218002819.1486479-1-jthoughton@google.com> X-Mailer: git-send-email 2.39.2.637.g21b0678d19-goog Message-ID: <20230218002819.1486479-3-jthoughton@google.com> Subject: [PATCH v2 02/46] hugetlb: remove mk_huge_pte; it is unused From: James Houghton To: Mike Kravetz , Muchun Song , Peter Xu , Andrew Morton Cc: David Hildenbrand , David Rientjes , Axel Rasmussen , Mina Almasry , "Zach O'Keefe" , Manish Mishra , Naoya Horiguchi , "Dr . David Alan Gilbert" , "Matthew Wilcox (Oracle)" , Vlastimil Babka , Baolin Wang , Miaohe Lin , Yang Shi , Frank van der Linden , Jiaqi Yan , linux-mm@kvack.org, linux-kernel@vger.kernel.org, James Houghton X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 3D54C40002 X-Stat-Signature: 4xmcwtwxk8ddby4gzucoscdnj1ty5qxh X-HE-Tag: 1676680126-665045 X-HE-Meta: U2FsdGVkX1+3evSTViS4RlsSBwLIK8liIsyVu2NrfGS6AfolEfC2ZxZbtvvqpcje14BMDKarIiM1kqC6Vzm0DnzWswRquNMv7iNa71wPCTVjYu86YAAHSh5Je6UFV66vKR5Q8l6KtP6aErmCFLIMGb3W00HVWevTKhV7jJ5y/ZXFfw95u+1V04/EhC7w/FaHs0cdhYY9OCHkquN8gCiiQfpanuxnsEANxcHxlvjyLy23gP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JtcXiniOS2fHykR9lZWf/D3IhvQ+p2MpyzsbkuHcbLBPzCUoGOiT3+tTXutytOY8bJ6awV0sOPA3PPS3+V3nt7QOOSFJ+/Gmfq4xLAHOLm4XuRqzo/d9de+wacnGrDfraf4lIPBLhdp2P18O2QlFCvtFgm8w45nt1E23RQvRyfODMkzjavjuwYUv8vkjClsC3RGL8Q2pAa7nzhm1crJWMzo6z3dMyQBH1XTHuQ9qGY1h53bfTBo6p6cDWbHcAfxV71moDeft6aK5I3rzCkKMU9KGRa57J/jw2Zadfk/N2v+H83MeIlQI2J6dnjTSkAzllLB4S6j1pwzUu79So8o59gxdc3VwO+bb0JtylId76LX1PgR4sZ9fgDcKiceUBTTOzQqKDXdixyHZq0aTbKZb1IGjLt0u8PaeAj1yaEj6xA== 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: mk_huge_pte is unused and not necessary. pte_mkhuge is the appropriate function to call to create a HugeTLB PTE (see Documentation/mm/arch_pgtable_helpers.rst). It is being removed now to avoid complicating the implementation of HugeTLB high-granularity mapping. Acked-by: Peter Xu Acked-by: Mina Almasry Reviewed-by: Mike Kravetz Signed-off-by: James Houghton diff --git a/arch/s390/include/asm/hugetlb.h b/arch/s390/include/asm/hugetlb.h index ccdbccfde148..c34893719715 100644 --- a/arch/s390/include/asm/hugetlb.h +++ b/arch/s390/include/asm/hugetlb.h @@ -77,11 +77,6 @@ static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, set_huge_pte_at(mm, addr, ptep, pte_wrprotect(pte)); } -static inline pte_t mk_huge_pte(struct page *page, pgprot_t pgprot) -{ - return mk_pte(page, pgprot); -} - static inline int huge_pte_none(pte_t pte) { return pte_none(pte); diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h index d7f6335d3999..be2e763e956f 100644 --- a/include/asm-generic/hugetlb.h +++ b/include/asm-generic/hugetlb.h @@ -5,11 +5,6 @@ #include #include -static inline pte_t mk_huge_pte(struct page *page, pgprot_t pgprot) -{ - return mk_pte(page, pgprot); -} - static inline unsigned long huge_pte_write(pte_t pte) { return pte_write(pte); diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index af59cc7bd307..fbbc53113473 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -925,7 +925,7 @@ static void __init hugetlb_basic_tests(struct pgtable_debug_args *args) * as it was previously derived from a real kernel symbol. */ page = pfn_to_page(args->fixed_pmd_pfn); - pte = mk_huge_pte(page, args->page_prot); + pte = mk_pte(page, args->page_prot); WARN_ON(!huge_pte_dirty(huge_pte_mkdirty(pte))); WARN_ON(!huge_pte_write(huge_pte_mkwrite(huge_pte_wrprotect(pte)))); diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 792cb2e67ce5..540cdf9570d3 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -4899,11 +4899,10 @@ static pte_t make_huge_pte(struct vm_area_struct *vma, struct page *page, unsigned int shift = huge_page_shift(hstate_vma(vma)); if (writable) { - entry = huge_pte_mkwrite(huge_pte_mkdirty(mk_huge_pte(page, - vma->vm_page_prot))); + entry = huge_pte_mkwrite(huge_pte_mkdirty(mk_pte(page, + vma->vm_page_prot))); } else { - entry = huge_pte_wrprotect(mk_huge_pte(page, - vma->vm_page_prot)); + entry = huge_pte_wrprotect(mk_pte(page, vma->vm_page_prot)); } entry = pte_mkyoung(entry); entry = arch_make_huge_pte(entry, shift, vma->vm_flags);