From patchwork Wed May 10 05:03:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 13236403 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 EBA6DC7EE22 for ; Wed, 10 May 2023 05:03:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8C3DA6B0074; Wed, 10 May 2023 01:03:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 873FF6B0075; Wed, 10 May 2023 01:03:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 73BEE6B0078; Wed, 10 May 2023 01:03:47 -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 66A246B0074 for ; Wed, 10 May 2023 01:03:47 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id BD09FA0502 for ; Wed, 10 May 2023 05:03:46 +0000 (UTC) X-FDA: 80773152852.17.3AC0FC5 Received: from mail-yw1-f181.google.com (mail-yw1-f181.google.com [209.85.128.181]) by imf16.hostedemail.com (Postfix) with ESMTP id DFCC418000D for ; Wed, 10 May 2023 05:03:44 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=f+IDJIOx; spf=pass (imf16.hostedemail.com: domain of hughd@google.com designates 209.85.128.181 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1683695024; a=rsa-sha256; cv=none; b=Tkaos9B6HzvXueny7h/uX3bwSxfG5OO2s8WJMCxszy/MX7zRwKRuyOXUuo1pexzbe0Pd6+ GL2ILd/HCMWtp7Cj9qLcfHAuSdZlfJAlk1FkF/r7LBEthrYjBm7wp6f1xgkxZ5bQusUrN2 a68VuOrJI/tDFILzOhMQd+JrjUmuAcw= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=f+IDJIOx; spf=pass (imf16.hostedemail.com: domain of hughd@google.com designates 209.85.128.181 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1683695024; 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=mCwP+3tlZqvvMSbN25I242CI8N2o4w3/6RVIlVlj13g=; b=RgTEYGp+WXE5WG+5OTmpZCEyi4ijbJjTB2V0GHbtCBK2uHcQNzNW7b7MCSSOM4aIKi1rwB 8xzSVaCK51tpcBQ6IpkqmktstZCIh1JWhX3LKIBk9M8zFp6SCt09yRj42lw5h1zhGtDM2L dO6l3BHj+GeCVTrp4YWMCIATxaH/QuU= Received: by mail-yw1-f181.google.com with SMTP id 00721157ae682-55a010774a5so104197547b3.3 for ; Tue, 09 May 2023 22:03:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1683695024; x=1686287024; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=mCwP+3tlZqvvMSbN25I242CI8N2o4w3/6RVIlVlj13g=; b=f+IDJIOxeE7pBv/ncUF3Dg8yBdNeigyWPgONUVZVc2EQnlwiXg/VQTMZqIyi1FwbhF hB12dPYWMlW78XVP1iXq4ueyFowA50D/X9k7kSng633zgtc6Ft9O69KyiELqvbNIUVet ZV3CNBYMAMk1NaEigxnnVZgnTZDfN2Zgt7qDs5DqEMg/xKQN3cvE2DpHKAZxvYja2q57 EzxbR8ATmL4FQRq126r5Vter9+9PB+pvzYqq8Q0Kq08+IAz0Ct1bpmRKsD6HzoQSgfyW CVzetCsMpC4GogX7r4Ise+/fDJ+qVHJTfa1OEDnQ873jx9nxbHKiO6uVblFCp5x/gnEx bWfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683695024; x=1686287024; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mCwP+3tlZqvvMSbN25I242CI8N2o4w3/6RVIlVlj13g=; b=W9y5WA5RjLWAX081NCODBFR9MbnHknsAO3eY9V7jThoLhpA8CX+hQSyu3R8O6XxBUw 1nnkcyDDtYyy0MOul87p5cCMlH/LZDleDjK6Gvskxv4sY1B/0gDujoON14DbeAS7gw8y GEmAbkbFHikov8jNbCoJx7jX4hp4OMDJx6Yc2sRwEGXNrX+EkKMd0+0uwJGrNMlet+Z4 rixXUV/qiUfc/FdJe6MdSIQzrSRvYqzKca32tNF14vWu3m7MJOuhZpG+uI6GPELRdDCD c9pFaqsJWlguUUkBbskLBTseG7q60A/BB4He/tdd12/wi7KyFxuPPJdnRlpsoR/oO/we cBkA== X-Gm-Message-State: AC+VfDxKgsV+EGdEwcG3rlc/6NpEzjBtrKvCskf7nVA34NqvW8juWJ2Z fOKI1XPUATpPuMf/k5HBJTvDzQ== X-Google-Smtp-Source: ACHHUZ57BibEP8l5nJ6F5+RjmWOH1yRU/GU0ORzVTyycrrSkC73g/4H986WkI3WYpSdD5+TSi7jmbQ== X-Received: by 2002:a81:6c42:0:b0:55a:1022:7814 with SMTP id h63-20020a816c42000000b0055a10227814mr19292393ywc.28.1683695023901; Tue, 09 May 2023 22:03:43 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id i189-20020a816dc6000000b005463239c01esm3871312ywc.51.2023.05.09.22.03.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 May 2023 22:03:43 -0700 (PDT) Date: Tue, 9 May 2023 22:03:39 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.attlocal.net To: Andrew Morton cc: Mike Kravetz , Mike Rapoport , "Kirill A. Shutemov" , Matthew Wilcox , David Hildenbrand , Suren Baghdasaryan , Qi Zheng , Russell King , Catalin Marinas , Will Deacon , Geert Uytterhoeven , Greg Ungerer , Michal Simek , Thomas Bogendoerfer , Helge Deller , John David Anglin , "Aneesh Kumar K.V" , Michael Ellerman , Alexandre Ghiti , Palmer Dabbelt , Heiko Carstens , Christian Borntraeger , Claudio Imbrenda , John Paul Adrian Glaubitz , "David S. Miller" , Chris Zankel , Max Filippov , x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 17/23] sh/hugetlb: pte_alloc_huge() pte_offset_huge() In-Reply-To: <77a5d8c-406b-7068-4f17-23b7ac53bc83@google.com> Message-ID: <85eeffe5-95f2-2574-365e-c9af663c8672@google.com> References: <77a5d8c-406b-7068-4f17-23b7ac53bc83@google.com> MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: fg4nkhg98af1bg6arhrkti4nea8oe65h X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: DFCC418000D X-HE-Tag: 1683695024-556638 X-HE-Meta: U2FsdGVkX1+qHGPI1CYXOdWwSkcnlgX0mwInA3Y0tEttUOya0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pGGv9MLnRx8mYKoeHX/LHXv7Y/p3aR2P8vGqCqK8a/hGgkIOq/KHTevTOHxDtbN+Az316NvBAW7pKZ9YnozaWQYWTj2H1eYnN58XouxVAEdx2NX2T/6F1mZEIquUW4rMZxlLoLkRKrOAA0zrTp6gLksQCMleyeTVc0j+CqmiyLQ6AwTNu+NuggftHMxmO0aLpuPHEarJicXW4YRVsgYrXRrWmwq0/WL+v/mB8VHxNonbBWlqj7ObIjUxYVGn6rIpzw6SmaOaFbbvpFy9mtAd4aeOIg== 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: pte_alloc_map() expects to be followed by pte_unmap(), but hugetlb omits that: to keep balance in future, use the recently added pte_alloc_huge() instead; with pte_offset_huge() a better name for pte_offset_kernel(). Signed-off-by: Hugh Dickins --- arch/sh/mm/hugetlbpage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/sh/mm/hugetlbpage.c b/arch/sh/mm/hugetlbpage.c index 999ab5916e69..6cb0ad73dbb9 100644 --- a/arch/sh/mm/hugetlbpage.c +++ b/arch/sh/mm/hugetlbpage.c @@ -38,7 +38,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma, if (pud) { pmd = pmd_alloc(mm, pud, addr); if (pmd) - pte = pte_alloc_map(mm, pmd, addr); + pte = pte_alloc_huge(mm, pmd, addr); } } } @@ -63,7 +63,7 @@ pte_t *huge_pte_offset(struct mm_struct *mm, if (pud) { pmd = pmd_offset(pud, addr); if (pmd) - pte = pte_offset_map(pmd, addr); + pte = pte_offset_huge(pmd, addr); } } }