From patchwork Thu Jun 8 19:25:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 13272759 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 EBC28C7EE23 for ; Thu, 8 Jun 2023 19:25:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8933C8E0002; Thu, 8 Jun 2023 15:25:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 81C198E0001; Thu, 8 Jun 2023 15:25:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6967C8E0002; Thu, 8 Jun 2023 15:25:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 548C58E0001 for ; Thu, 8 Jun 2023 15:25:51 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 2D92880367 for ; Thu, 8 Jun 2023 19:25:51 +0000 (UTC) X-FDA: 80880560502.21.BB2D8C3 Received: from mail-yw1-f173.google.com (mail-yw1-f173.google.com [209.85.128.173]) by imf18.hostedemail.com (Postfix) with ESMTP id 3C7061C001E for ; Thu, 8 Jun 2023 19:25:48 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=WSe0O+xW; spf=pass (imf18.hostedemail.com: domain of hughd@google.com designates 209.85.128.173 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=1686252348; 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=OY1uPF9EWokdB4SqfwvScqZ05vH5KIzX3bnt2mFlrzM=; b=zc/dxe23oliiBDjl6FA++UP8WJ2BN/yE2Vr8HRi9WRWSABMA9Y/4qtougooT1lAlyFEpH9 InNIAg1RTFn3xpCNnJS8k2GE/NOcQ2avtoAE/pswmrfdMRJienBBXoZI6H+5HgES9X61+A VGde2CPuXGMINU3YU7DwxBIXHmmbKz0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1686252348; a=rsa-sha256; cv=none; b=Vc9b6dqF9n+s/109Kp47maufMpihukhTxZW6lq7KFlAq+AS9mozB79DR4P60q4d4ZjOjHp aDbRIt7X5j5UDOQN/MEU6K2hs7eOoQM6zOjFBXIzWCaj+WtAIpVFUr00LMVu0a60IWp9/t CBWjKEDhuSHkXvG8gzb8hDiZpJ1LOl8= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=WSe0O+xW; spf=pass (imf18.hostedemail.com: domain of hughd@google.com designates 209.85.128.173 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-yw1-f173.google.com with SMTP id 00721157ae682-569fc874498so9368617b3.1 for ; Thu, 08 Jun 2023 12:25:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1686252347; x=1688844347; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=OY1uPF9EWokdB4SqfwvScqZ05vH5KIzX3bnt2mFlrzM=; b=WSe0O+xWHB2ydCbpeLzjHJf6lubD6yWbrbalQ09CW2PLGKbnuv/YCHcTjEklbftlDZ Bn+TBag489vYl0Kx/QEnd/hNvW0BHOeSak/CZxA051qj0HRROKgCePvrRb9MuwQ21RPo UFNVPP0fFgD2zP3vXEkAAHs7IbIEd7kCFa41GIq/o5fS7gcYFt1t9fsorCogUddAyQAa gvgPXc4Mu6L9KlRIpGfWDTGDmUnx/ZwV5Hsai5H4jlYjdflYF6WjfS5QYRdpLJc33lMM tuIWNkxAGrXRoIS+Re+Ik8k2cuYZR70rphrz9RjLzYXiNApKIhKEFjqSjiunuGbiEcPL 13ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686252347; x=1688844347; 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=OY1uPF9EWokdB4SqfwvScqZ05vH5KIzX3bnt2mFlrzM=; b=cCNE2zqhc/M8lselLjJkJTeExMjhOAO2xHoXd2YGRV8s/lUSC9W8y8QGPN+7Xa5+sX kQYU3/rSpfRTf87oWEzk2ejcXCkQ3YFPAOVtU2WgTdfpr80KL8uofpR3vJZXsj4cyVBn GblnJiUkIglfwzZX5DZzFnQ1cCtblFbck1QMWwzTkIhvD97IpmdZtvfEU73eCjtWgwbF skS4qscni1Fim9qOs+5Vry+rA2+mClqpsHzRL98njGMu7QevGGFYBVDUAETua8ibBuo3 kkfDzI51sW1mwAmKI0mhLKsHXplZycZzg97LEEFlOEE/3tj01PVXUKJmf/4YlFTLyM1F m8bQ== X-Gm-Message-State: AC+VfDyxUOEhULitA/K4+cMr6dayPo9p5N6FnJx1hLMQqOtGoaSRr95M pzV0MBwJUNK/U0C9MS3GvvBWTg== X-Google-Smtp-Source: ACHHUZ7VI0tdmqfD7RJHlpvasneu0EKZSOUA0Xhotxo3WPVI6HmobTXuS5JzWFFLHVldGCNyYtlCDw== X-Received: by 2002:a81:9144:0:b0:561:da0d:6488 with SMTP id i65-20020a819144000000b00561da0d6488mr460871ywg.50.1686252347196; Thu, 08 Jun 2023 12:25:47 -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 y62-20020a0dd641000000b00568938ca41bsm117859ywd.53.2023.06.08.12.25.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 12:25:46 -0700 (PDT) Date: Thu, 8 Jun 2023 12:25:42 -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 14/23] riscv/hugetlb: pte_alloc_huge() pte_offset_huge() In-Reply-To: Message-ID: <291f20-5947-9f5f-ec7f-96a18df336d9@google.com> References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 3C7061C001E X-Rspam-User: X-Stat-Signature: 11tqsodgwf9a9858c3qgsqah1gpybj7y X-Rspamd-Server: rspam03 X-HE-Tag: 1686252348-158229 X-HE-Meta: U2FsdGVkX1/zsrVbj5WvEav4/CMyOLmJgjGy03DyrwU3JvfHFxd0PRL0HK31SuYtJeOTJNddL8wuuN3LvACp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WiJFYWtZLlpKpxqilJDE+gF5vohUnwgX9U03llZQ6cYOESejLJ2TUp7AT/OUCVSTXwiylkjBiNdkxC4kHwpps+c9ftcRHKtLQz2KxNm8mdYUgP1zA+F7AELDHhbt21RP63d5tkpOHuR6jKfzpCGXTqfLLbSiRspcTfrStB1V9SjAoFGSAoT+YjG4HM2QpIloeda7+1ephTeew9DodKIiJlKB9y++l9WiHw4uZDtH1slsk1eE6V25NWVOGUzv4tgXoL1aujFUkLBNDOoeTvS4kHUGNjkbGNHMH2/u/Wgoc71K4JrI5h0F3DEcwbM5rJgevFSezIpTriEQMH10HI/cXTzTIBuKAuVnA6aFyJ6FWnoRfb4eI= 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 e0ef56dc57b9..542883b3b49b 100644 --- a/arch/riscv/mm/hugetlbpage.c +++ b/arch/riscv/mm/hugetlbpage.c @@ -67,7 +67,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; } } @@ -114,7 +114,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; } }