From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 43394606A31A for ; Fri, 30 Oct 2026 00:20:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=OMv7mkSB Received: by kanga.kvack.org (Postfix) id 51FB16B05B4; Thu, 29 Oct 2026 20:20:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4D1316B05B5; Thu, 29 Oct 2026 20:20:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 399446B05B6; Thu, 29 Oct 2026 20:20:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id F29726B05B4 for ; Thu, 29 Oct 2026 20:20:16 -0400 (EDT) Received: from smtpin19.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 6F5DC1C3DF0 for ; Fri, 30 Oct 2026 00:20:16 +0000 (UTC) X-FDA: 85377385632.19.F0DFF70 Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by imf27.hostedemail.com (Postfix) with ESMTP id B1E404000B for ; Fri, 30 Oct 2026 00:20:14 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=OMv7mkSB; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf27.hostedemail.com: domain of sj@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1793319614; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=gUNDzrcBQCofjPtOZhO0zF/6BwtiodHnLN9kfJEdKls=; b=3zG9pt66doxivxfl6vglMKotz674xOxYaHrZpVj9K0n96H0V7hdlwxQzpTF5/7L3UlXbKS UTqz/uiO80SX1QGvOecGzG4GTOFR9NFHZGeAbTWIhUtqm0ZuGUUQ9nyy+vDFhM8yqoehIr VFjfjUQIYxsZfhPznkgs/2GS9dTvMHI= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=OMv7mkSB; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf27.hostedemail.com: domain of sj@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1793319614; b=oLkIknw3flmI4AAkC76dSr1xYWErZ/ZBLPIyYzX/TKl4JcdQimGGo9bYrvPLSjXfSiZ4rC NXmfUJpVHeJwKnIpMkG0AhQw4Is56n3GUMDrKHVvF3K497cTMLePf93JKUbr4NgcOSej5u pMZ/XpXrSEfOzkZ9hh/shGsNC4cyIlc= Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 7569943923; Fri, 30 Oct 2026 00:20:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E86C1F000C1; Fri, 30 Oct 2026 00:20:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793319613; bh=gUNDzrcBQCofjPtOZhO0zF/6BwtiodHnLN9kfJEdKls=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=OMv7mkSB943eqjxfOdTCTqRn8rnHCaFZTrdaPeB0aIFCob3E3fqLF62qDpAEPjHQA B3xh+10xm0pLuUYynSQpI6Nhgsdy13RCNCEvL/EsGdSb7FWvxPCUQBVJ/KVoki3Q3j A7o8d2rcIlBgQP9lheaOYTIDrvi9q3rsoE+zz/ApHV8bjiyRYYLLaUYBuhT5JdA0R1 w7mbCA1lQdx5BakPTjA+ZD87OkbCVKcnrx9v8R9+8bKdOhFqSO1ssMBMBUYRkSn/Kv BpHEmrr7LDOBQR8TBi9SkI1IJdsaRv8CC3SznbrHhfqdDWrNhiMX7QP/0o/p/4lUxU b2bHyvWufwEuQ== From: SJ Park To: "David Hildenbrand (Arm)" Cc: SJ Park , Johannes Weiner , Michal Hocko , Qi Zheng , Shakeel Butt , Lorenzo Stoakes , Kairui Song , Barry Song , Axel Rasmussen , Yuanchu Xie , Wei Xu , Baoquan He , Baolin Wang , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Kees Cook , Peter Zijlstra , Jann Horn , Pedro Falcato , Hugh Dickins , Pasha Tatashin , Pratyush Yadav , "Matthew Wilcox (Oracle)" , Jan Kara , Zi Yan , Lance Yang , Rik van Riel , Harry Yoo , Alistair Popple , Nico Pache , Ryan Roberts , Dev Jain , Usama Arif , Kiryl Shutsemau , Matthew Brost , John Hubbard , Peter Xu , Will Deacon , "Aneesh Kumar K.V" , Nick Piggin , Oscar Salvador , Minchan Kim , Muchun Song , Xu Xin , Chengming Zhou , Chris Li , Kemeng Shi , Nhat Pham , Youngjun Park , Gregory Price , Joshua Hahn , Rakie Kim , Ying Huang , Jason Gunthorpe , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kexec@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-cxl@vger.kernel.org, Josef Bacik , stable@vger.kernel.org, Muhammad Usama Anjum Subject: Re: [PATCH v2 01/47] mm/mglru: don't use stack pointers when walking PUD and PMD tables Date: Thu, 29 Oct 2026 17:20:03 -0700 Message-ID: <20261030002004.154595-1-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261029-fixes_core-v2-1-a64ce7f83abb@kernel.org> References: X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B1E404000B X-Stat-Signature: dxxwxffdz9619dnxotkj7m1oy7ushw8u X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1793319614-863317 X-HE-Meta: U2FsdGVkX197J2R6wOq/i8PAGKJohuFILH/h3KGsYAXGypWn21NRbhu2QkMGoD1LAAXRY98eiZIetN4niAFql8jagbQqO486Qw8TO0Bh4QykYPUrTC16er6ywQ+hd2RF34gK0Y4ilsgSh9EP+HQLSeq7BezwN6yu/g/yI8aq/nOvOFqj2FhXVP1PbKLZcqVUgmOB+qrJv0QV3oku9R0JkKYJ0Ha8Zv+ET+0tygjyhIkjm8XidcmDtdHPWTMldCvAJUyPxMx+oexYRlkyUUU/S9tcsOsbPB+T8HLdCnOGdFj97+WsPJlEamKLt13jpzIVFPqmCBCqKQgIJtIy/pcGYJziVbf1jAEv/H9A2p87EdLn/SBpvk/QaBANXF6HbBtlinAHa2p9MBuwr3Kew5KvrvfNxab4wDfQ3/vU+42xlLh1CDmlNEK2ArZosCnH4YvPdNisQdHRWmMdWEheIWrmUptTqvRIyQPr13YJ6MZ40BbO/iOM3Aad5UVDDaiBydfhzZwcnAtI2Ade4G1TZU20gf+SpptY26uPtQ21oP+ZTjml06EMTCLCbOJBxob2+Sk2Sr+HO8z5jAt7C/dTJ8Bt4g1iTnAgrxw2uBvd0+ZDf2m46k58fZaz0mC+QwHMppapqYDEnw+ln6F8lB3feMVmB8dZOpJ1812ltT3dn8umU9ndx4kucAOK4x6w/A7iV3QxHXoKa+rQ0d1GBmpxpF/TyL9hFDJg9SJ6F6nqQvmc3jPK4o5VmFBCT8awR8Wp9iPLBb806pY+WziP0XS/bDSoP09j9flDPmtl7/SGCESOR7QEnvfOqT9pQaHknHjXGbPI798t12Qf9JBqBauCv8trfSZOEo3fthXTEgWnUXRvukYNqFL5InMLb0qrsxNTGVrYFbhJqbGF7o00DljoseneD4xPE8bDmugRjTI2mv5MDfByPIng74BnheId4rg5SKpiQTIcj3PwpvPeNaDTJax CafQG2BV 2OMA5XwhwHvsSHIniJVJO3OPAOwWXItD6BOdl0eDCqF6yT6Q1R1Elkxgo0rpsEHfkf/40kCrjZPG+duYB/qHR7cOporZLIj4wqTqjKlhVwkJK7hnoHSwnh03BtYO+dWEWm1pIQ8ctqS0vqvRa6HyuQWay8LQdx6qQ1AUmBPei+4FqHaI8hFeps/jljqKVLtx0Gbc5WRU1wU7WxEMz5f5hs6TPwXOM6mI+9d29xvCXieVYpZZubQUqxbO1V1o8hIwuBkSomvesZ/M7MR/Skdk3qWMKitrQcFRMmSs0RJMYhjTvGpehr6NZMKpSIJbWq7zvPXWvKs4oTvDFo/s29dJysYBqm1hpHqilQ4Vz1sMW721DBe7opRyED5PW2tP+ZSPj8aCqU+Y0TXRkD5kFvgOk4WG3axmZBOg0MuDgoRaEJTsOwLBBMkpd7slYgnsb/ttv+JWoiplCntA0ZO2mE6IoaTN+8EzvVdvdE4KpAilYOCKl7mGOenClKWRhzZPZFsfzZQFXNu1NkCfT7qTFDM/Qv7P5e9Goup/o2iu6agb05H1uXfhNfrP1026Tmf4tgQU/O0eiYp3yi2mEm8ZmFtSxVv2ymSoMlkueeQPDv+pgVvYuroM= Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 'get_maintainer.pl --nogit --nogit-fallback' suggests adding below recipients. But I can show there are already quite a number of recipients, so I'm just noting here. - Brian Geffon - Oleksandr Natalenko - Steven Barrett - Yu Zhao On Thu, 29 Oct 2026 21:32:56 +0100 "David Hildenbrand (Arm)" wrote: > From: Josef Bacik > > MGLRU passes stack copies of page-table entries in walk_pud_range() and > walk_pmd_range() when walking to the next level. These copies can become > stale when khugepaged or MADV_DONTNEED (CONFIG_PT_RECLAIM) removes a PTE > table concurrently. > > This pattern dates back to commit bd74fdaea146 ("mm: multi-gen LRU: > support page table walks"). Likely, earlier locking masked the latent > bug. Later changes exposed it: commit 1d65b771bc08 ("mm/khugepaged: > retract_page_tables() without mmap or vma lock") allowed concurrent > retraction, and commit cf4a65539c13 ("memcg-v1: no need for memcg locking > for MGLRU") dropped the walker's outer RCU protection. > > The fix is simple, so just fix the original commit so we don't have to > speculate. To fix it, pass the actual PMD/PUD pointers. This restores the > RCU-protected lookup and validation against the live PMD. Note that the PUD > handling is required as well to handle folded page tables correctly in all > cases. > > Fix generated by an LLM and sent by Josef Bacik in private. > > [ david: handle walk_pud_range() as well, clarify+simplify description, > adjust Fixes: ] Looks all good to me. > > Fixes: bd74fdaea146 ("mm: multi-gen LRU: support page table walks") > Cc: stable@vger.kernel.org > Signed-off-by: Josef Bacik > Reviewed-by: Rik van Riel > Reviewed-by: Qi Zheng > Reviewed-by: Dev Jain > Reviewed-by: Lorenzo Stoakes (ARM) > Reviewed-by: Kairui Song > Tested-by: Muhammad Usama Anjum > Reviewed-by: Harry Yoo (Meta) > Reviewed-by: Barry Song > Reviewed-by: Baolin Wang > Reviewed-by: Pedro Falcato > Reviewed-by: Kiryl Shutsemau (Meta) > Signed-off-by: David Hildenbrand (Arm) Reviewed-by: SJ Park Thanks, SJ [...]