Message ID | d1e54510-9ea2-edf-3851-fa7635ce1e5e@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3370225vqo; Tue, 9 May 2023 22:07:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7EP/LQynBQgz4GQitBWwSBRSVkUH30pxarWm7mLbqfndg79+dj+uTa8oXG940YulkQeOSk X-Received: by 2002:a05:6a21:3a92:b0:fd:afba:9728 with SMTP id zv18-20020a056a213a9200b000fdafba9728mr16182000pzb.45.1683695255302; Tue, 09 May 2023 22:07:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683695255; cv=none; d=google.com; s=arc-20160816; b=IinT1blB0oKNF9s+3XeQN5qyVkwiNqIdOB2dIeH7F1BYtq8u2ZmlzLFiB0Rmx/PCyi aGDT2Nyi3sWBSUxM5lYcCT+8xb36JNr4oWVjA2zfRqWwjLQCipH/GuNEjqUxGjf3VbHN 9sIB4BXGfV4p/4TJZaWv+ue6ul8W4wASeaMsRY5cMnA7KTz4ui+ZyXV4Du3TaT7OmlXI 0Q//cj48lGW0nHsUwnWGG48Gx3t3Z1ujUBtp5V1njSq401GPo6AIf83b76oLqv5z26zn LTeguA0/axTgMHQqEgwfbUnDka5um1DbOcqvRVAMGqXuCWz5jpvAZw4Jl9JBm1CxT74u xQwQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q17-20020a63bc11000000b00519d69a233csi3314148pge.626.2023.05.09.22.07.23; Tue, 09 May 2023 22:07:35 -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 S235687AbjEJFAF (ORCPT <rfc822;baris.duru.linux@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; Tue, 9 May 2023 22:00:02 -0700 (PDT) Received: by mail-yb1-xb34.google.com with SMTP id 3f1490d57ef6-b9246a5f3feso10165144276.1 for <linux-kernel@vger.kernel.org>; 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 <hughd@google.com> X-X-Sender: hugh@ripple.attlocal.net To: Andrew Morton <akpm@linux-foundation.org> cc: Mike Kravetz <mike.kravetz@oracle.com>, Mike Rapoport <rppt@kernel.org>, "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>, Matthew Wilcox <willy@infradead.org>, David Hildenbrand <david@redhat.com>, Suren Baghdasaryan <surenb@google.com>, Qi Zheng <zhengqi.arch@bytedance.com>, Russell King <linux@armlinux.org.uk>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Geert Uytterhoeven <geert@linux-m68k.org>, Greg Ungerer <gerg@linux-m68k.org>, Michal Simek <monstr@monstr.eu>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>, Helge Deller <deller@gmx.de>, John David Anglin <dave.anglin@bell.net>, "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>, Michael Ellerman <mpe@ellerman.id.au>, Alexandre Ghiti <alexghiti@rivosinc.com>, Palmer Dabbelt <palmer@dabbelt.com>, Heiko Carstens <hca@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Claudio Imbrenda <imbrenda@linux.ibm.com>, John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>, "David S. Miller" <davem@davemloft.net>, Chris Zankel <chris@zankel.net>, Max Filippov <jcmvbkbc@gmail.com>, 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: <d1e54510-9ea2-edf-3851-fa7635ce1e5e@google.com> 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765482436126199408?= X-GMAIL-MSGID: =?utf-8?q?1765482436126199408?= |
Series |
arch: allow pte_offset_map[_lock]() to fail
|
|
Commit Message
Hugh Dickins
May 10, 2023, 4:59 a.m. UTC
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 <hughd@google.com>
---
arch/riscv/mm/hugetlbpage.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
Hi Hugh, On 5/10/23 06:59, Hugh Dickins wrote: > 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 <hughd@google.com> > --- > 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; > } > } Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com> Thanks, Alex
On Tue, 09 May 2023 21:59:57 PDT (-0700), hughd@google.com wrote: > 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 <hughd@google.com> > --- > 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; > } > } Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
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; } }