From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 84F2E232785 for ; Mon, 2 Feb 2026 04:00:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770004826; cv=none; b=g4S3veJUq4l/c54Nm0a8jxVbVPnsqp1B+GAELdw6JrCvmY/Qkx6FNvpgPm0op4PACx+fStLufOkgJFmlZqOUKGu7l0iKEG5f5WORl0p1oHkrTRFBuuF/nF8BOP+ahJl4NS6XzyBM6dfoTs0E/Hw3wrb63o81psI2wRiJy87QosU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770004826; c=relaxed/simple; bh=D2NZLWtw4e84J/jBZ2Nq9CdJ4zQWHdl5LzBzzTAVlSY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FQWY4PL5Eeqm3qAOoj1KTuPGcVONAoE7b3PDnWOJJFfXTIdrD2waZ3lbNvvWuY5khxGnNNY6J5VkUXK1LqgaOFcx+c4dqMsIbRcg0HE1hjLxRugymClLGNCeSPLzRViboOdJubTJxDm1Z4IQ7t+S+PrBxmM8xHNyxt0VgeG3ENs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=BLEOsNzJ; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="BLEOsNzJ" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=JeLi+++sNjhzFxRCz6+mszRfMSyeWN8oOxvNTn+LIXo=; b=BLEOsNzJcFx+z+XmosJ7jyuHyA g7OH8XGXY5FvmWZIdyIQfqeFPzML95Q4iRmYRHbrjj4JCq/t13U7NunG4oeVgoOqPAOMGe/yTT7Qk gmGAkc+swShdpxD5FOpHTXwkDBt3UONFMneslGhkw7ScI7dwVcxvFADQMLPj1rDKGaFQ7Usrj48cD zE5NWyNZqpEaGjmBJ8KRQJIUjMS0fp/yl/Ie9wx+61NpxF/G8bUSjzVnbC9dUWSJl0yEDgqvAaNRV 178WQFBC9GUJsHT1Ul0CBmoGZzdgx/3qr3+5cL3aWQw+7QwqzC58sYLjVII5iuwI/WM5OZUMkhziS JFp9fQHw==; Received: from willy by casper.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1vml6c-0000000Fvwl-43vx; Mon, 02 Feb 2026 04:00:07 +0000 Date: Mon, 2 Feb 2026 04:00:06 +0000 From: Matthew Wilcox To: Usama Arif Cc: ziy@nvidia.com, Andrew Morton , David Hildenbrand , 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 Subject: Re: [RFC 00/12] mm: PUD (1GB) THP implementation Message-ID: References: <20260202005451.774496-1-usamaarif642@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260202005451.774496-1-usamaarif642@gmail.com> 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. zap_pmd_range() for example. Or finish_fault(): page = vmf->page; (can be any page within the folio) folio = page_folio(page); if (pmd_none(*vmf->pmd)) { if (!needs_fallback && folio_test_pmd_mappable(folio)) { ret = do_set_pmd(vmf, folio, page); then do_set_pmd() does: if (folio_order(folio) != HPAGE_PMD_ORDER) return ret; page = &folio->page; so that check needs to be changed, and then we need to select the appropriate page within the folio rather than just the first page of the folio. And then after the call: entry = folio_mk_pmd(folio, vma->vm_page_prot); we need to adjust entry to point to the appropriate PMD-sized range within the folio.