From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f172.google.com (mail-dy1-f172.google.com [74.125.82.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0BB91267714 for ; Tue, 3 Feb 2026 21:11:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770153117; cv=none; b=D7dAcwKa/kCxy91hpLEawzpJhhXHNjTy3r54IfCPqU1V0LMq0qry1HhPeT4Wu80Ols3wcvWCwgHhaVqbGdVfSWpF1ocp0LDNqX7V8Cm+EkBuogktxohd5H7Z5YXx2zjeETz4SMWoaKtxAk7YnxFNgYm+Ysm3rIfijArhU5S1RMc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770153117; c=relaxed/simple; bh=8Baemb+2qw1TrhNsWEcVXl6KKdyCeHYKPBJQi+wn53s=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=eDEKf9s7sFbQJA0fTv7poIuShM8gRkGSR/A0KG0e/VVToQY6CvDiZDz3Ro64IVFNFiqvvLDW6e1q7b+VrHD31YsTqnwmZssPA5spIygoQf2nrXP2F3zHsItMMKiRHUM3mi+yXNqdCUafRp0wKU1qca9H1CpOOe5uDz+obrkihps= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TXCvhRWL; arc=none smtp.client-ip=74.125.82.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TXCvhRWL" Received: by mail-dy1-f172.google.com with SMTP id 5a478bee46e88-2b751c8b6beso149613eec.0 for ; Tue, 03 Feb 2026 13:11:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770153115; x=1770757915; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=GjouYKeFgulSy3uVZCrduhB9hUSwqp8VNZQ44L/rPlc=; b=TXCvhRWLBN5AClexd4N6wiDAPvxbcEt/l0AsDy+zXSsr4Q+C/V30J08h+aF2fnCLIA qf1gFl9dpcjcdo4wjwcJ0UI58ahphBbPhKqMcsC7t6b58i0R0HHiZEabFW27ydWj0JGX WP0G50Zvd+rTN+ARFTQsZI/cJ5LAij7EIyaGmZyzi02r4Jl1FyG1Vfx/uifDVWoy/TKP XEd9eEd0wUK/m2MjGjDQLDbr3HS1/PaM6r6XUkd7TutQutEAJ55kPqTizjAiFow45tC+ ttRVPWkuBc6YitoXqdhhhHYFVTjhR0eWA2OOZFKzajSG/H8obN52Q/JIuB/vHOIqido5 rvMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770153115; x=1770757915; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GjouYKeFgulSy3uVZCrduhB9hUSwqp8VNZQ44L/rPlc=; b=GaUdO6gwzmENiXjq2IHug57a2OiyRv0zfNFi8Biq3iAJC4EyzBitMxuSqejd2tC+i/ 9QKfCBIDDJJAc2KDn54bEqF0UyepkIurFuGfekHOP1tHQp/gC9CVR0rWv0lAamyT5Bau hFoxsPpMokLgITNz4myez8q4ix/DErxzkNV1p7dORm6vVg6/YZLyjrQPlMWpD7jMWgWf DHcBnnJaXmtlCWfqOQvVkA6hWrCR3hkMHTitfExtKh7Og+4ZiH0jBwkhqRGuS5LDUuxG e7st51ALJoDLjZiaJ02ILvQGDxuHk4NW+6LTIMu8uXJi1kZm/T6slvT+uXip2wMX7OU6 /yEg== X-Forwarded-Encrypted: i=1; AJvYcCVlpUHQHhipjGCuw30K4VFMw25PCCoPlQsZiIdVQPLks8mIiy5VEqYwxGpm9BAIpV/oWEAn19/GTPw2q5w=@vger.kernel.org X-Gm-Message-State: AOJu0Yyzv68WPW3BVudetDd6w3srntQ9TFybHgwaL+EO/Hxl0qltbRHk 08id2DD0kx7Wn5n1ZHFIgFC10mxOgF4TnG3o+cDOVk+UnrrFaSk0Wwq4 X-Gm-Gg: AZuq6aIX+SYn+rOy3iUQZcB2rsct6OF9HYqzAj5L3I8qLa1ywpftLvkM850btKUvoNm CeQC6Oprq0rkYKhFU/pdCPe7IxFx4ttmH5ux/RVVVMKQPqKRqjChnlgG8zifc2eR0AalL+ZBe1h yqp+kCXp1cmOikF0JiFlp/9rXTr8Uu4yZU1tn4JRRiYVve/rpD2SA1ra1UJ5vZLlSvBDirSOlmo u53OMpquvPgsSLOomf1QRRsJ50G0UzOsh8q27jjd+OsPap/dEpmtYnRTMCYbFRHBYR9ZpxuYRa0 DJkSRI89CNDhcd+fzjXj3R4L6O7eZCgbp1hLCAZxq16m0/jTOz+fi0j27hLZpsDNb+SQdww2Ya4 kzb/9dowflua1Hqod4fvq3aIRlFJCvkM9xiX3Dlc94Z7gFfeZ1Aq8FoLH40DsFZ+7zc4e3+VUuV zG1yfTnnxYk3LQqCnXov0o596l+rzaTuBaEIOUacNhvqtoN5FrCSGbX9SPVDxWP8A= X-Received: by 2002:a05:7301:e8e:b0:2af:f2c2:3bdb with SMTP id 5a478bee46e88-2b820dd8980mr1904350eec.2.1770153114986; Tue, 03 Feb 2026 13:11:54 -0800 (PST) Received: from ?IPV6:2a03:83e0:1151:15:1cc5:26fe:6b00:bcef? ([2620:10d:c090:500::21b0]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2b832fafc2fsm379363eec.24.2026.02.03.13.11.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Feb 2026 13:11:54 -0800 (PST) Message-ID: Date: Tue, 3 Feb 2026 13:11:53 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC 00/12] mm: PUD (1GB) THP implementation To: "David Hildenbrand (arm)" , Matthew Wilcox Cc: ziy@nvidia.com, Andrew Morton , lorenzo.stoakes@oracle.com, linux-mm@kvack.org, hannes@cmpxchg.org, riel@surriel.com, shakeel.butt@linux.dev, kas@kernel.org, baohua@kernel.org, dev.jain@arm.com, baolin.wang@linux.alibaba.com, npache@redhat.com, Liam.Howlett@oracle.com, ryan.roberts@arm.com, vbabka@suse.cz, lance.yang@linux.dev, linux-kernel@vger.kernel.org, kernel-team@meta.com References: <20260202005451.774496-1-usamaarif642@gmail.com> <7d6f5fd3-9652-4e9d-89af-e81ce20df8ba@kernel.org> Content-Language: en-GB From: Usama Arif In-Reply-To: <7d6f5fd3-9652-4e9d-89af-e81ce20df8ba@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 02/02/2026 01:06, David Hildenbrand (arm) wrote: > On 2/2/26 05:00, Matthew Wilcox wrote: >> On Sun, Feb 01, 2026 at 04:50:17PM -0800, Usama Arif wrote: >>> This is an RFC series to implement 1GB PUD-level THPs, allowing >>> applications to benefit from reduced TLB pressure without requiring >>> hugetlbfs. The patches are based on top of >>> f9b74c13b773b7c7e4920d7bc214ea3d5f37b422 from mm-stable (6.19-rc6). >> >> I suggest this has not had enough testing.  There are dozens of places >> in the MM which assume that if a folio is at leaast PMD size then it is >> exactly PMD size.  Everywhere that calls folio_test_pmd_mappable() needs >> to be audited to make sure that it will work properly if the folio is >> larger than PMD size. > > I think the hack (ehm trick) in this patch set is to do it just like dax PUDs: only map through a PUD or through PTEs, not through PMDs. > > That also avoids dealing with mapcounts until I sorted that out. > Hello! Thanks for the review! So its as David said, currently for PUD THP case, we won't run into those paths. PUD is split via TTU_SPLIT_HUGE_PUD which calls __split_huge_pud_locked(). This splits PUD to PTE directly (not PMD), so we never have a PUD folio going through do_set_pmd(). The anonymous fault path uses do_huge_pud_anonymous_page() so we won't go to finish_fault() When I started working on this, I was really hoping that we could split PUDs to PMDs, but very quickly realised thats a separate and much more complicated mapcount problem (which is probably why David is dealing with it as he mentioned in the reply :P) and should not be dealt with in this series. In terms of more testing, I would definitely like to add more. I have added selftests for allocation, memory integrity, fork, partial munmap, mprotect, reclaim and migration, and am running them with DEBUG_VM to make sure we dont get the VM bugs/warnings, but I am sure I am missing paths. I will try to think of more but please let me know if there are more cases we can come up with.