From patchwork Wed May 10 04:59:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 13236400 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 5F8D5C7EE22 for ; Wed, 10 May 2023 05:00:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DA6D96B0071; Wed, 10 May 2023 01:00:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D56D26B0072; Wed, 10 May 2023 01:00:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C1EA96B0074; Wed, 10 May 2023 01:00:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id AF4D76B0071 for ; Wed, 10 May 2023 01:00:04 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 69C9EC04F0 for ; Wed, 10 May 2023 05:00:04 +0000 (UTC) X-FDA: 80773143528.28.B755B2F Received: from mail-yb1-f172.google.com (mail-yb1-f172.google.com [209.85.219.172]) by imf11.hostedemail.com (Postfix) with ESMTP id 9292E4000D for ; Wed, 10 May 2023 05:00:02 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b="v/0fedI9"; spf=pass (imf11.hostedemail.com: domain of hughd@google.com designates 209.85.219.172 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=1683694802; 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=ZMaWjOOzBzTq25y2V3ItGl/gYmS8RRtg1cvEbj+mQng=; b=eb/1TR0abg0n2iiRCKyT3Wq+IaoCzLRpRcYDIaAiOK+A1BnPMhkIwkEEnreH9muqSUdVB7 pm0paw01zptzK9Qq915VWrTycJWjKgEqAb1epuBZIYYk1YzRKimaLlxCMaYezzOxQJYjeE RZWFSV77sdRbi1Hu+Sao6S3g9b9cOl8= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b="v/0fedI9"; spf=pass (imf11.hostedemail.com: domain of hughd@google.com designates 209.85.219.172 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=1683694802; a=rsa-sha256; cv=none; b=pp1OEhLwrnWlxtfU96LYY5h0XcFZcO9XXKA6ri4fb46laynTsDI6mxzEkYEIsTHSgCwFOM IRjNsfVgNjtApAYR6ijjsK4VClhEyktoDzUxIdF7WKUsM99dpH1hT+zeJAmsyrBUngnxle 12crToDt1WN9DfBhHEywDh+vj2cHos8= Received: by mail-yb1-f172.google.com with SMTP id 3f1490d57ef6-b9a7e639656so10177365276.0 for ; Tue, 09 May 2023 22:00:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1683694801; x=1686286801; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=ZMaWjOOzBzTq25y2V3ItGl/gYmS8RRtg1cvEbj+mQng=; b=v/0fedI97pPSEeG4JjmhWFM2zERS146SPiMJXKFktyRt8gcu3XnU9flpdOBzk+uwM5 s0LxqY4B95aIsZsh2mJFZGGaGczJQ5vlt2ZTVgohuP0YCEpkq6BqvaluTpoYqvCHZPxl zKN6HOjwjx0yrNqF5dlqaMyYDGE2Vrd5Uv3cHsjFUAt+EAmeWDDRNYI0YlpbNo86b8bG Aipz8AqM9zEa9JBFP7+dKHJaNOyMjOSxB2cpapkuH6PjkheDE/u4eOtK4ivf5fV5d230 xxAVZ1lBfR2A1vI9J151/+XOuCwLBzeq8s5a10eXtHtu5Hbfr7aLXi+072D/bPReNYVX IS4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683694801; x=1686286801; 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=ZMaWjOOzBzTq25y2V3ItGl/gYmS8RRtg1cvEbj+mQng=; b=HdRvF1Xu5RZjrvB9lv/eIYcN2UgP/0ks2cL3vcuSSgHraJB2XMjD/PMv/xPPf6hw27 HA0rWvN18pI+rrKoGc3icNYg5JkRApzW9UuIjDbDHozmXAZhp/WerAAcnbuu6NZV/ghs NXpkrulDU/uPhiBMPds84OTx5lyBmqc8r0TtjUk36wDxWha7lJ/FWEMam9XivNFiGlhj 1TlT850MXZrucxsb0v45NF889uMhNh1yYn7igGAlRr5tO5TRncg0JanP5dFh+6up/4hZ 2Nx3HayEr1c/c2vJey6SHbTtwqMVXA9zH7Fo2pYuYgecuxldOF0FDKBk5W/UjDBsW9eH 72fQ== X-Gm-Message-State: AC+VfDyKHEDZn/qb9Gs8eIsiMtK2Vbb5eiTaksGj8xSNuaANlvf8IOBV e3aJ26Ux9FVPxr1P4+9AZIQ7Fg== X-Google-Smtp-Source: ACHHUZ52JqpHXNjwopV1qONCz4ZhxlIYDhhrgvgpvQjGO/cy7NhTIg/35E50jddhJVH/CVSemNKwJA== X-Received: by 2002:a25:a1c8:0:b0:b9d:9500:9d29 with SMTP id a66-20020a25a1c8000000b00b9d95009d29mr17308461ybi.45.1683694801383; Tue, 09 May 2023 22:00:01 -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 b4-20020a256704000000b00ba2da98431fsm1603597ybc.56.2023.05.09.21.59.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 May 2023 22:00:01 -0700 (PDT) Date: Tue, 9 May 2023 21:59:57 -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 14/23] riscv/hugetlb: pte_alloc_huge() pte_offset_huge() In-Reply-To: <77a5d8c-406b-7068-4f17-23b7ac53bc83@google.com> Message-ID: References: <77a5d8c-406b-7068-4f17-23b7ac53bc83@google.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 9292E4000D X-Stat-Signature: yyzet87cqfy91n7gtec9nic9suew9rqh X-HE-Tag: 1683694802-604239 X-HE-Meta: U2FsdGVkX1+i0yPpo0X8Vplme0eJloyODHynsunnWHvl4Al7zLarnKb0m9TtP0b2uDdCAXgR+tp7T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Fe6U7gjM/2mZPcTYDNSYpIFOYiCoQ2DsephmstKaLwON3WnQvR71B0lNFV+xu1uttVtmxHM1x+5eMs0BcAcwy2mGO/q7DPEWhC/BJzPI8pDA5KebgKY2hPMeu1wEB/IOnuVTBodR3PwoO4V4KECxHZhZGpD8TLMCdtzdU3/v43M+WVK02k3ewp8zNolkqNb3Dv5x8iRWbNCb3LtYTlKdZPR44HZcGganaS8ClvhTCfNPrmkytk8Sy/bMs4jNsEGgFE2NLDNzHynsWN4Q6w== 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 Reviewed-by: Alexandre Ghiti Acked-by: Palmer Dabbelt --- arch/riscv/mm/hugetlbpage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/riscv/mm/hugetlbpage.c b/arch/riscv/mm/hugetlbpage.c index a163a3e0f0d4..80926946759f 100644 --- a/arch/riscv/mm/hugetlbpage.c +++ b/arch/riscv/mm/hugetlbpage.c @@ -43,7 +43,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, for_each_napot_order(order) { if (napot_cont_size(order) == sz) { - pte = pte_alloc_map(mm, pmd, addr & napot_cont_mask(order)); + pte = pte_alloc_huge(mm, pmd, addr & napot_cont_mask(order)); break; } } @@ -90,7 +90,7 @@ pte_t *huge_pte_offset(struct mm_struct *mm, for_each_napot_order(order) { if (napot_cont_size(order) == sz) { - pte = pte_offset_kernel(pmd, addr & napot_cont_mask(order)); + pte = pte_offset_huge(pmd, addr & napot_cont_mask(order)); break; } }