Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6775007rwr; Tue, 9 May 2023 22:06:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4z+V4ciEcGJlkWzQvDuv7PKFNHuVVA+p69PB/Kb/4CkOQHqZudQ4CVD/oEq226iaZg/Xbs X-Received: by 2002:a17:903:244c:b0:1a9:9d00:8c92 with SMTP id l12-20020a170903244c00b001a99d008c92mr20991368pls.42.1683695181395; Tue, 09 May 2023 22:06:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683695181; cv=none; d=google.com; s=arc-20160816; b=PWT70gPmnmzWC927ffSsgMMw4tGZ4GprS8r4J86qq0TimZwOl91Q/Iq+IKNN6zufDH /wsbu3f0lSdLK9SWWdgPEbj7nYJ91DTvdPzHSlMS8u8Ux1u32+UYDtyMPrM46dnc091g 0VLZPQSuXhYMdACzJ2eCcQWUm0O6OSo2Je45vuSHd5SO8qHnjelxmSut2EHnUckyLwte zxtf3+nX7/DjYLCn/8r7HESzWnZUECfy3y1Tsw+LxM3ZUTL1mCHvc4eiTfhrqC/WXClW XvO6O8P/Z0PrvqAcGPJKuOZ+B4eJnO5Sia0UUGe11TlcT/lWK5knb5YrEDmcMoKABz/9 h5pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=ZMaWjOOzBzTq25y2V3ItGl/gYmS8RRtg1cvEbj+mQng=; b=lPT/CDLHgBL/YV9jWKCz16W7Gl0rugc3vsLHbhCzx67CtGSftLcOFsFMlikzAUKHOD jXFkJgLlni5CvyT7AlpClSPnyvPqFaQ6uOfw3fD/1T0Oy3ZFvH0K5uAeXIP7ujzjUgXV Mq9RgVmMGpB5ekp1AU2SpQcYQ8TtHfXZMr9FZd7dXkPce8JlpvZ5G2KZAJQA+NCcE93Q gNa/a/V97nWuGTJQxoTqHlmsX9rirEAooVzka8VOdEmJhPdTLe5KehZY6NjSZqKhsBGD kHHoIfG9m+o3I5ICC7o+ZA1JC62Jf/YC2t1dkeCBVUAf2C2HuTF6xCjnsBR+ArPkrVue YsSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b="v/0fedI9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t12-20020a170902e84c00b001a97bf417cdsi3585650plg.571.2023.05.09.22.06.07; Tue, 09 May 2023 22:06:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b="v/0fedI9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235547AbjEJFAF (ORCPT + 99 others); Wed, 10 May 2023 01:00:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235642AbjEJFAE (ORCPT ); Wed, 10 May 2023 01:00:04 -0400 Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com [IPv6:2607:f8b0:4864:20::b34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6118D1FE1 for ; Tue, 9 May 2023 22:00:02 -0700 (PDT) Received: by mail-yb1-xb34.google.com with SMTP id 3f1490d57ef6-b9246a5f3feso10165144276.1 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=OtblqB7DhEVaX4lUXMpDcPoxeikvZTvfO/wCPTsNTuQ4njwciIaZRrOUhzgGZiO5bK jKgv/iDlZBLQiSB1WdvB7WqTtpJD5XaBPN1BrgD4C33FWIf3xmDCFgG9/1KBWB2k4nZ1 IWudz1ZPcE9hqnCeT46H9e/Hpuf412Kit8ke+EOa84vg4LYM8fKewDP5Kr+jhmjmReP5 TMKWcQkdmeOME2i9w+CJt8iQGXuyDSvd+QlvEE3WKtvR3MFy/IkPGuzQriCIMaxGZXmt BCAhttgmnas9IvbdCLb1hioexyHtn0hyCcJ0TQS8rPdA3GCD9WSVkzbZtql8env+gEtC ipZw== X-Gm-Message-State: AC+VfDzFnmJRDBm2IcUr4vBXHuv2+LK0WtgnekwnmPatgo/7VbfNnAvm kK9XrO8XWbIs/0tZfgnb/XJ8gw== 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 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/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; } } -- 2.35.3