From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f52.google.com (mail-dl1-f52.google.com [74.125.82.52]) (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 BDA99281356 for ; Wed, 4 Feb 2026 01:00:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770166815; cv=none; b=LsMC274gLannCtwEeMSUIzsTEEzR72mQyRMu2EY+jLG31j/uuBtsTT3TQYFnyDnn07m8iYUOd9nDOh4G4fNRsYWkEOw8hJFDbqAw/btRMV8lhmvnSXamb4RWi39DgtAxN+LrPp7AzYxjG/OGCet/t/ZT8a+lQC8vniExOwVMDK8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770166815; c=relaxed/simple; bh=jqfMNa7MppLUgX4w0EGa7Z49GK23nbr2bWGimlUjZOE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=OR8yClLEh99E9wuyxFp/5LDcrL43QGz5TAR8t81ASmHeZzxRDHv7ZuKSXkyNHHI0rlVSKPYiW1ldAub6lw3EghR5pKAp56v0+gJ1/MDbh9yNkDSUekyzOuaaGaZNNieaNdYV7HFCL/R/83rfScw4ZsCRXoft4W3WDJLRQEMwAao= 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=lZFpq6Vo; arc=none smtp.client-ip=74.125.82.52 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="lZFpq6Vo" Received: by mail-dl1-f52.google.com with SMTP id a92af1059eb24-11f1fb91996so4017318c88.1 for ; Tue, 03 Feb 2026 17:00:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770166813; x=1770771613; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ETtAgu9zn2DbdID69yeQZoqXuJNNuYg+Fj5vMI3aElk=; b=lZFpq6VoV+71k4VAfZWhJXkx1NZC8LJvuffVp4wEN9nsv+ot5BhqGcxrNCxDPt7nvb 2PQbS/oG4mj9amjV/XCZvB23L3v7KIgV3pTqoj66+hibIhsRxzuZjAwOeVOXGNhGErt6 E3HOJSMw+2mUEagxbmDl2CkgL6vmy8z/58B5Z+pMMrEsUHwisa61sUj7EkTt/ndgKTNF hm1GC+RBOOwmx5wP6V9tTc/rsdtPVwqkgKYGZQ3/IXlPNLRatximY9uJ4/zd7ayP0v8W jiygEbs+55asiTCSwwLKqGmtsPIkCqPdcK6Rv3mRT+Y6/5NxGFOvIkMk5k0LpuBZoCAY 9GwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770166813; x=1770771613; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language: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=ETtAgu9zn2DbdID69yeQZoqXuJNNuYg+Fj5vMI3aElk=; b=RbBNX+R3wQWlexvEb/QW++CEUm2SnS8tF0DmsnqP1QoASP7NmzKg8H3FuhlvMOK/rM BwbZWDc3wg7u2LXEb0Xl3S5OAfygEPsWY2vljdwipmrvL4vytTLTFW8iKJEkSDuUonBQ 1dEk9SpBq7do2BGhGlFGmXp6qDQvPghV699ctXRQeLjNyYZbevsOS85sRQewKNOHBZnO mlClEmS/QRvytNKGvpHkKXuUKrKTl8+TC3T2U05tmZ2wgLjSGCXDl/OrGpwpvV75KhJU sH1mmuK62U3vrb5jHc89Kky7f8OhBjsXWMoGhPd4xdLVF01Ke1JDvkFQiNw3EdMM+JAu evBg== X-Forwarded-Encrypted: i=1; AJvYcCXOwgRrDOTpKxX14K+Xh5X7TLtyR00TxkuFeMr+Xlyp3mAAorHKP6qbjZdR88+HoNeP6e3WeBRey70zITc=@vger.kernel.org X-Gm-Message-State: AOJu0YzPp9ZbCEjrotWgqfg/n8Uogr8/lJFoiBZMrP/dhMQwvh8Y+LLT Ms0XYXLQEJe21GobxLYMoSdDlzvOGDV3hO5KpWx2Y6d2KMrb93Bjx/ef X-Gm-Gg: AZuq6aLwH4RbJi/ARg/uOH2wSZl7NtwIu5rFm7rDSIOVAzXsWDX84g9yfILhYzfXQ5k UF0pUqY4etXGef5c27Qn4n9aHvv3x+L8DdN7Kqhed+Ay4cWzFfNo3xVuKb0wKScdinKOdDq4qEF wWNlpgicvcCPu1ITKkLSGcZyMHnl6aIbhwuSoCB43CW7q3hDnFOuL8kkcTKVwWNxtWKCMu1iaVx SEwrh3H1VCEIIYiQ8LcPUXmh/mh91A27QiD61xsPTkrx0P2M/xGdVQWZr3ERmXENf3Ve7zNlbjd 75ilReq6vQlaHzQteA2dizhejzhzqHYb77vgc5Z2h+rJLS5Xq3IAVziuONsv5RNIuqoOWPjQZa+ jiLntdvGSifNUNxLnJFu0OOo3anDtst3x2sEKFKxpMSe52y5415HqLi4+BboYgnhM9vt2Kcu/ru I7YFCQ9MDOXjqrkx2g3dNbGH/Y2Kfc7xvWKAHzbcbAYWNGw2S7udqo0oPbiiUUxWc= X-Received: by 2002:a05:7022:418f:b0:123:31dc:e8b5 with SMTP id a92af1059eb24-126f470cbaemr700307c88.0.1770166812500; Tue, 03 Feb 2026 17:00:12 -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 a92af1059eb24-126f4e04467sm654039c88.2.2026.02.03.17.00.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Feb 2026 17:00:12 -0800 (PST) Message-ID: <2efaa5ed-bd09-41f0-9c07-5cd6cccc4595@gmail.com> Date: Tue, 3 Feb 2026 17:00:10 -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 Content-Language: en-GB To: Lorenzo Stoakes Cc: ziy@nvidia.com, Andrew Morton , David Hildenbrand , 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> From: Usama Arif In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 02/02/2026 03:20, Lorenzo Stoakes wrote: > OK so this is somewhat unexpected :) > > It would have been nice to discuss it in the THP cabal or at a conference > etc. so we could discuss approaches ahead of time. Communication is important, > especially with major changes like this. Makes sense! > > And PUD THP is especially problematic in that it requires pages that the page > allocator can't give us, presumably you're doing something with CMA and... it's > a whole kettle of fish. So we dont need CMA. It helps ofcourse, but we don't *need* it. Its summarized in the first reply I gave to Zi in [1]: > > It's also complicated by the fact we _already_ support it in the DAX, VFIO cases > but it's kinda a weird sorta special case that we need to keep supporting. > > There's questions about how this will interact with khugepaged, MADV_COLLAPSE, > mTHP (and really I want to see Nico's series land before we really consider > this). So I have numbers and experiments for page faults which are in the cover letter, but not for khugepaged. I would be very surprised (although pleasently :)) if khugepaged by some magic finds 262144 pages that meets all the khugepaged requirements to collapse the page. In the basic infrastructure support which this series is adding, I want to keep khugepaged collapse disabled for 1G pages. This is also the initial approach that was taken in other mTHP sizes. We should go slow with 1G THPs. > > So overall, I want to be very cautious and SLOW here. So let's please not drop > the RFC tag until David and I are ok with that? > > Also the THP code base is in _dire_ need of rework, and I don't really want to > add major new features without us paying down some technical debt, to be honest. > > So let's proceed with caution, and treat this as a very early bit of > experimental code. > > Thanks, Lorenzo Ack, yeah so this is mainly an RFC to discuss what the major design choices will be. I got a kernel with selftests for allocation, memory integrity, fork, partial munmap, mprotect, reclaim and migration passing and am running them with DEBUG_VM to make sure we dont get the VM bugs/warnings and the numbers are good, so just wanted to share it upstream and get your opinions! Basically try and trigger a discussion similar to what Zi asked in [2]! And also if someone could point out if there is something fundamental we are missing in this series. Thanks for the reviews! Really do apprecaite it! [1] https://lore.kernel.org/all/20f92576-e932-435f-bb7b-de49eb84b012@gmail.com/#t [2] https://lore.kernel.org/all/3561FD10-664D-42AA-8351-DE7D8D49D42E@nvidia.com/