From patchwork Thu Jun 8 19:31:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 13272819 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 3BB98C7EE23 for ; Thu, 8 Jun 2023 19:31:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CFE4B8E0002; Thu, 8 Jun 2023 15:31:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CD59F8E0001; Thu, 8 Jun 2023 15:31:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B9DCA8E0002; Thu, 8 Jun 2023 15:31:18 -0400 (EDT) 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 AAA508E0001 for ; Thu, 8 Jun 2023 15:31:18 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 77EFBAF47D for ; Thu, 8 Jun 2023 19:31:18 +0000 (UTC) X-FDA: 80880574236.07.7F192E2 Received: from mail-yw1-f169.google.com (mail-yw1-f169.google.com [209.85.128.169]) by imf03.hostedemail.com (Postfix) with ESMTP id 760BF2001A for ; Thu, 8 Jun 2023 19:31:16 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=xraoP+ub; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf03.hostedemail.com: domain of hughd@google.com designates 209.85.128.169 as permitted sender) smtp.mailfrom=hughd@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1686252676; 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=LRrENG7fj4nSEA3qiqmp7KZ6RwcG7U0j5SldGyBNlNI=; b=5NkG2CDPHMniI1Yo6xhXgvyVOGA2WazyNoYXHly/j8Ri4SQRFve3OlhTjHl64pbpTxNBLT EZSfpCthKOIEo5wLzogAKJ4uBjf8Ro6clKUbgwggIxmGQZMLe5kIETFtfvd579pq/QMJ2F J27cQoXsLgqnZHQYu3vVS6/2obNgUIo= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=xraoP+ub; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf03.hostedemail.com: domain of hughd@google.com designates 209.85.128.169 as permitted sender) smtp.mailfrom=hughd@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1686252676; a=rsa-sha256; cv=none; b=R01ZPm9HflsX71R4LGwLnuMPGBf0nPebMw+xSbxuhFvZ0/Q8YrlVzycva+FVt8tHKWMnPw J7R7PMHqQESbCZOY1o9XaStX2ss5Fq/Ad7Pr33nKWt2Qh3hyWqAq0ZB8j03R9ScQqz1TnQ 5BQFnJorgp0Z9lx/JtX+Un9ksOX90CA= Received: by mail-yw1-f169.google.com with SMTP id 00721157ae682-565a3cdba71so8897097b3.0 for ; Thu, 08 Jun 2023 12:31:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1686252675; x=1688844675; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=LRrENG7fj4nSEA3qiqmp7KZ6RwcG7U0j5SldGyBNlNI=; b=xraoP+ub8QawPiBDd1NtmoCJ7Yde5e/+U+FNO1p7rYE1UZXZOAo1PDwcjZq5EwJthR dV+vHCNMFKAoTdxBpkTX1DtrPJTkyYQzzcTJ6+Hvz6BbVAyle5wD2VnxGl+fo8KRjuW1 6lph5KG8FATG8Els+mnLkzVfzKtCZbvKkrDIrFy8tA1swRHwRpg7mlfmIfHBFYp2tEz0 /MtFJlEM4CazKliayJD7LKXK8RlITlLW8oxbTF1Qs6fFP4vrk+enY/g6/q9Fbkg7+DmC flfsqeHeLuLJ1bEDqfGSKk77gUrt/I37di/bcF7XR9pfVd+mrCw58/52flYr3BiOm9us kFmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686252675; x=1688844675; 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=LRrENG7fj4nSEA3qiqmp7KZ6RwcG7U0j5SldGyBNlNI=; b=i2xe7wxLCPIasedrjwXVr23eF31oanwaUbaZpk1BJnh3LX9VxnYqOZckaDziVJC2aS NKoOeimmDFfRmIc8YkRwXaf93+vhnEiEqUo/eOXr5wna05aZJqIotjDJRH0nduouqG44 Wbegw8WF96nL3gWVmb5k1msScbUtZScyYM7aqk0AH9LOC2fEy7/6GkITNps98gprIO9z Va2C91lO3lkoNG9vOCXKdy2qneMZgclXoRUDlKuR+0KYs63tbi5aRYARlJGvn5YDCI24 ODnHp60Img5gF2g98ilhczGx8RMuzIpDZB4165qpqJ16xWmHnY0ZD1/f3ST87jenu9bZ Qvow== X-Gm-Message-State: AC+VfDy+xgiqZ8XEf6FubooyNBLdXUnH15w8nSO5j8FwsIvoXwJ/qK7+ Byc1zWfAb9vgDxL+8zFwkOTNUA== X-Google-Smtp-Source: ACHHUZ7QSwZkgLD2hJa5LAg1G48lqiWohJ5hVZ29HKnSz0REpapDpLCYy6czmfzJtz/zE4Z2iELuXA== X-Received: by 2002:a81:8986:0:b0:561:d1ef:3723 with SMTP id z128-20020a818986000000b00561d1ef3723mr688963ywf.38.1686252675399; Thu, 08 Jun 2023 12:31:15 -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 a6-20020a816606000000b0055aaccfa2c7sm114090ywc.91.2023.06.08.12.31.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 12:31:14 -0700 (PDT) Date: Thu, 8 Jun 2023 12:31:10 -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 , Peter Zijlstra , 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 , Alexander Gordeev , 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 v2 18/23] sparc/hugetlb: pte_alloc_huge() pte_offset_huge() In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 760BF2001A X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: bt7rrwaks9surm8b6owx1556z9jwwn4a X-HE-Tag: 1686252676-296449 X-HE-Meta: U2FsdGVkX1/C5QkRYQ7STtIU2iH8e8NlbC0QrnkDQiIrew8Z3Tmo4bP31dLlsTiuNdOjcD2W9aZOVx6iHOSABameSRtGWGsGKxm0F+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I9yFyL3Y1YrAEV0rWl3WkHDcPNPrCpuRstCoYQjSAyakIGG6k4DT8Ye0m2T0IgsV1fSvUEwsxzHGLcrAHRRtrow2qpw1u2o2kPRP4TbdAIo4Mm0MQMFStNOnib0HmBZnl0N5Emn50y6VNtjAaTSSv1EcSzw1ykcH7gBOCo8gyPkr1vqjo/+Vb+8hPbvLTCJm1zaph2wghltdIq0UQZwC5LnvUOxdYG9jgTVQ0uf1CDCreYlyYhN/8CalQ== 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/sparc/mm/hugetlbpage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/sparc/mm/hugetlbpage.c b/arch/sparc/mm/hugetlbpage.c index d8e0e3c7038d..d7018823206c 100644 --- a/arch/sparc/mm/hugetlbpage.c +++ b/arch/sparc/mm/hugetlbpage.c @@ -298,7 +298,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma, return NULL; if (sz >= PMD_SIZE) return (pte_t *)pmd; - return pte_alloc_map(mm, pmd, addr); + return pte_alloc_huge(mm, pmd, addr); } pte_t *huge_pte_offset(struct mm_struct *mm, @@ -325,7 +325,7 @@ pte_t *huge_pte_offset(struct mm_struct *mm, return NULL; if (is_hugetlb_pmd(*pmd)) return (pte_t *)pmd; - return pte_offset_map(pmd, addr); + return pte_offset_huge(pmd, addr); } void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,