Message ID | dda2885-929b-c278-14e-5f447e9eec52@google.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 0F689C7EE22 for <linux-mm@archiver.kernel.org>; Wed, 10 May 2023 04:46:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9B4D96B0072; Wed, 10 May 2023 00:46:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 916786B0074; Wed, 10 May 2023 00:46:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 76A566B0075; Wed, 10 May 2023 00:46: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 5A8DF6B0072 for <linux-mm@kvack.org>; Wed, 10 May 2023 00:46:04 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 1D1D340275 for <linux-mm@kvack.org>; Wed, 10 May 2023 04:46:04 +0000 (UTC) X-FDA: 80773108248.07.12BCBAD Received: from mail-yw1-f180.google.com (mail-yw1-f180.google.com [209.85.128.180]) by imf28.hostedemail.com (Postfix) with ESMTP id 42EA3C0002 for <linux-mm@kvack.org>; Wed, 10 May 2023 04:46:02 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=X3r36dHH; spf=pass (imf28.hostedemail.com: domain of hughd@google.com designates 209.85.128.180 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=1683693962; 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=2Y3cIigX+Nl9tLTZ0FqCTIXHUTdUKJPmRsHmBn2kODQ=; b=ZwtutPdcDmHwDks163owCPWh6C22XSjTIB3FjzzE+sFoylLTJkbMiLsuNJPrKN1CjzUTO3 /HNph7Lbs2qOaB0k7VuMn9lbNc1JS47FlYn37D3M1v09YYvl6Upq5AAgnEM68CsXyF0q5a bwW9LrhQfdHczRa0j1ns7V544Ok0b7U= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1683693962; a=rsa-sha256; cv=none; b=ErBhNOk4Avzsk0nK1Mv+amVVgoNsbRGyDfO6m7L+SeHrUHlx4SVQacCyJ4RTJdUGaKUYFI FHNyiNJB0Aie63lrbTOlFDZpkNEYR0TBxGlx63ozXT32gq9mVSs66u3AJvK05EoKagRH6G tMWHJ15If2qxTc/lbbeRvGH+QtO5r7o= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=X3r36dHH; spf=pass (imf28.hostedemail.com: domain of hughd@google.com designates 209.85.128.180 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-55c939fb24dso62446537b3.2 for <linux-mm@kvack.org>; Tue, 09 May 2023 21:46:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1683693961; x=1686285961; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=2Y3cIigX+Nl9tLTZ0FqCTIXHUTdUKJPmRsHmBn2kODQ=; b=X3r36dHHiJLgvp7jU0d4K3JzjfQ3mFZ409XlDfQRUNXPcZqJbsAuZzM3s3dqfqjzC7 8KZfl7/K1d5O90p8GZrKYknrba26nw1LDXST+K7c2aBIUL4D4zJxqgAKfbG2qxu2Yo5u /0/dJOnRitUjxODeANtGQgBQxAoaXYK9cmTYbd/KEH4Bma0mqugbvo9G65UfkX3CZvm4 /qVdLnQuXbtkydB1O0CAPyBH6Uxg3CoJyNGPZLXWNXdI0kdPUkxDZks6+sU3ASKIjHEF kaGykgOemp+4zkq4W/ysBBuFcBH4LTuAgjoNUoWbJlUwxz7uYcWBFSnWP85ZFQDgSIRR fYQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683693961; x=1686285961; 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=2Y3cIigX+Nl9tLTZ0FqCTIXHUTdUKJPmRsHmBn2kODQ=; b=JVHR6K13DRQ8lFKpF8yZO+ihibmmev2xp6eH0AneiYQhOOM3sUdYZJfU8H2GUnNp9Y xAmHQRn/VR0gO1KxUUmxt6ahXiMPf47t4YlL3lM2WvFCocthJFDCGl2Jmql4oL5MyngR U8+El6rv4bu1dSqUjTMkAlAQ4GbI4Zjn/gW42oEm07QczKopAj1j34C8iAXODIlIntjq VZIn7SuivcNqwJ1Lb5lHb88Snpolk6Ge0yYSeTbKXOUnFGen88BcJMwmQDe3XkkFgd37 QxVsdiK2/aL5jh67NThltafAFW9DgkH05mukMu7RWRemNEge+knpQCde9C0j8ilCb6IQ SwvA== X-Gm-Message-State: AC+VfDx3IcuUzeKjDi3/1cLJHOHxFGoXPWDe4Vrc8GBLcLq3d1z+5+u2 quoEADqkPGYlQRgRAB/VzPmHVQ== X-Google-Smtp-Source: ACHHUZ7XGWNGIkPY+5hFXQ4Kt5/NxLbXPMIaWsRvM1j0AuAelIXLbwAPwZwsOjvzazAJBFrFLzpKOA== X-Received: by 2002:a0d:e242:0:b0:52e:f109:ba7a with SMTP id l63-20020a0de242000000b0052ef109ba7amr17438159ywe.51.1683693961209; Tue, 09 May 2023 21:46: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 s126-20020a815e84000000b0054c0c9e4043sm3833116ywb.95.2023.05.09.21.45.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 May 2023 21:46:00 -0700 (PDT) Date: Tue, 9 May 2023 21:45: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 03/23] arm64/hugetlb: pte_alloc_huge() pte_offset_huge() In-Reply-To: <77a5d8c-406b-7068-4f17-23b7ac53bc83@google.com> Message-ID: <dda2885-929b-c278-14e-5f447e9eec52@google.com> References: <77a5d8c-406b-7068-4f17-23b7ac53bc83@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 42EA3C0002 X-Stat-Signature: 75781txic16nafaqemmy1jw9k86codfa X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1683693962-877094 X-HE-Meta: U2FsdGVkX18R+m84CkPhcS9HHPEU+zaCsnHwPWOzft6cY8JPOIA/57t1JqPJNyoc3UaE33SwJvWM03uaaBbHAa2ntHnQhZnRr+LlOfqmt34zu8Rvy+DOK3djYtSN34OSPrVSz8JZ9+oLnIvEz49ce7ubNBbzApjMGkyZJUBs2opLGUUwfe361jF6fAtxm53Kudy+/ILhfF4ibIXnjGPLbBEW/ndBTwI7m989vZBf2nbq0NNNqsD/AhnmFNlo2CTR35iyWCaU5TMDE+/Rd1jMZSBzwrY2IySpMpEKfVxaXEKLJcE8sVjoShzMnNyuLwOKebCCAsia5N9YU7KhdDHDe9/yYZIEihIlpJxWxXz2pZWXekGgJ9r2Sxz7Ob4LqJ6+U0ZNz7RDYrIUt/4pDs99p5ktSZueyxc8fA1m0mauMtTFy4/V6v5oFIbLlVIlTgU1YCLUDdj0K73RecYwoLmMP3VPqb+PEqJCerHkDvNukgd/puHu+9gDHt2oSNHz26EobA7VGDmyOMd4udHa5P6ttRcjgLrsyY2ZzfjaNMD7iWvrOl9PAoEaqDxeiqlchtoTd1WVdeuwykpL4v61znFjr6e3oToW0vYB6i9g5pKUe+h7yuRMjXOmYRRTmB3krmW/ZHkbVPZiDglIlD/xls2ibAY0cO4bpNE7ZSNNPLEkMYBGMQRqBfteED8Y5TqcrSZ70vx1ZUv8rvw8w+EfJXNYp8r6Cg9nZYoDHmM9Ot6u0fhYWv0mZDcrC1xFmI4Ryfr8UB6rnBAaxeFYCcs9aB/oY7AI75GE+OH7CiPtU8wFgQ1csfXpRMjOk35/JJmJJ9AjlPjpN1FsgmWnBzeNZAVDSySDqkachJh8i4DWGWEkJs30cvCWiTCXCAKjV7McwqKjqR75RW8Us0GLcdl6xeu9LjGq6NddJr6S1wbS+KPH3sdsJTJJzkkzBJkBG30wMRH2GHK8HBePiVwTdAvrMdH u/9ieSgu Tt/cfKCgA/A7l0aIyUKLAuiaJaYtXjTl4mr1o1+9SGgRNZKMj/2ot9jvaaY5ROh3XKRhyojn5Ctbaol3yeLsbH3fKGxNPGSZnZDCjDeBHDIEbFSZkztJQL52PFm+9X8n2pKDH5zEeHMQlJDzAc6EoG38CpNZM1EPCP8DFiROnYVoljsGdk5SvtciSg1nfRck2/bayz3+eGPMfdogFH98EmKIS51J82C0401yLa3WC38ThrQpxdDhNQM0sVvMxNDRx//uhIh2eTVyA9AMVOFeIxOKYkvah9fYPWWrnhL9+RXZ2WVZLhyyhxktchNyRkUAdCfL+mXjyRJ8mYc0pNT6pCXcatxmdYGdXI4PqN4W/bVJa8+cCAgYZZkEAoklJSu303xh0vqtnVoRqq1gJYTW5GBQtvxfHHl2v9N9DyVz3A4Gd6u7h7TrUxzfSdA== 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: <linux-mm.kvack.org> |
Series |
arch: allow pte_offset_map[_lock]() to fail
|
expand
|
On Tue, May 09, 2023 at 09:45:57PM -0700, 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> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c index 95364e8bdc19..21716c940682 100644 --- a/arch/arm64/mm/hugetlbpage.c +++ b/arch/arm64/mm/hugetlbpage.c @@ -307,14 +307,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma, return NULL; WARN_ON(addr & (sz - 1)); - /* - * Note that if this code were ever ported to the - * 32-bit arm platform then it will cause trouble in - * the case where CONFIG_HIGHPTE is set, since there - * will be no pte_unmap() to correspond with this - * pte_alloc_map(). - */ - ptep = pte_alloc_map(mm, pmdp, addr); + ptep = pte_alloc_huge(mm, pmdp, addr); } else if (sz == PMD_SIZE) { if (want_pmd_share(vma, addr) && pud_none(READ_ONCE(*pudp))) ptep = huge_pmd_share(mm, vma, addr, pudp); @@ -366,7 +359,7 @@ pte_t *huge_pte_offset(struct mm_struct *mm, return (pte_t *)pmdp; if (sz == CONT_PTE_SIZE) - return pte_offset_kernel(pmdp, (addr & CONT_PTE_MASK)); + return pte_offset_huge(pmdp, (addr & CONT_PTE_MASK)); return NULL; }
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/arm64/mm/hugetlbpage.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)