From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f42.google.com (mail-dl1-f42.google.com [74.125.82.42]) (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 4736C288C27 for ; Thu, 5 Feb 2026 01:35:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770255348; cv=none; b=B5j0/ACMJGijvPVjSo8btPyPwruQg9DwCt+h4wc5o6eDwTRvoeIp0ARmjd1jTVsBadK6mt5IijI5VKdRQ7+y8VHt6YXp2LZvoMacvg6faZmGLnwxPM9cjcihpy4jTnjjO0vC5GD4FCyPz/HxvWFhPC9tpgY3S+4h2PD3av17kVs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770255348; c=relaxed/simple; bh=Q0yfB0Akpzu/FZjkPmSc1UrPsahJyVTWBOfQQZmgxBg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=eCbEuYVjIy0A3KsNIUe53pCi4QpR0UfiDPXk5+E1IN1KYAEfPZ+QDvm4PyuLIA8BoOD4tXkN5+sH6WkD3FqAjyO6cj8mvNZYG1RQcN+9Kdn+dIfXkbuMtRHqsrBf/hDy4q5XovuTufp54VxdJRg1u+Q54r9yjucJp8yE3ThcxVc= 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=e6HQIS/G; arc=none smtp.client-ip=74.125.82.42 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="e6HQIS/G" Received: by mail-dl1-f42.google.com with SMTP id a92af1059eb24-124899ee9d3so363162c88.0 for ; Wed, 04 Feb 2026 17:35:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770255347; x=1770860147; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=xsXjcal71V7M30wDGHtcG6yU9RvQM39U1r88HTUzJhY=; b=e6HQIS/GXAjzIPs3VoUOnYvYyHKV9iI/LzuDojY6gbThAcNwHQfSh+4xV6J/ilZZdt Tp4vo/8D5XbGFYq4pVsR+IW+jM8CWgzXAr3RcuXz5knj4W2TeN3a8UnNIehLN39PmT2I CXSj7SOtb0ACrRVXzG5kT4nrSi2AD8R2A5Fm0Lv9Huxh/4zneTRe7+w2+BisJVHNkpEc Ia118l0ogSinK6syp3UX/zmAoAzvS/YhWQ7cv/V3dGA1GODTRLlvIdjMAwuz4+rLRVuw 0dds26gWA1um0Ituc04s4znmjJyY6s3WmryvyW6/3tguG5HpIZNO6rd1GbGKOGemSyzo dEgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770255347; x=1770860147; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=xsXjcal71V7M30wDGHtcG6yU9RvQM39U1r88HTUzJhY=; b=U5ECr2v4B3EyUH1Q1b+oKDjnb5f5QgituUCldhBnh7hjtMhktM3zHGwpOhZTP35I6c EPj66TBTebiB1huptaVSh88n/sUeQ0UUl8yPUjy4jq6KG0FX9psRB1UeDEx2/BCiCTMH 0Gf48TVJm00mhxwV4gwYE1JvAVzarlVLEEwmOpeGSapJihSxLeVilS70aTgW3l7UNnr+ K9+FHbfSpM5IoujOaqTvoSuYUquVDZKy3UCy8n8cnAJQb4OniaFW7HvFGLkoBynyWlIp POubgrtHMilaoOsdMCJDN7otu4obi/tEE8FKHGurwL1TlrbVKPgJgKvNcyRS2DpxacQw zjuA== X-Gm-Message-State: AOJu0YzgdIGDTxp2cW54x9Jm42vJ9g+JzaijYHmvt4pE05gyubco+9o1 HCbjwCoMal7CNw8solyNBYeXyM/H/3azOl60iUESxjimrgNm4IOIvQtPLV5jHQ== X-Gm-Gg: AZuq6aKYvSDnZQzxLV4bGmILZd2OqPLvrQcALzBGm28dSLVua+0HpkQaIqhMqt/30HU TtK5OfTUx4ivQjMBN7Hxf60TCeqhbrJKNYe/YsY8pem8PelNZGulNuaMv+9J/rgxs57k8wKVWoY 4S78ISCQpYkRnZY9KH1bO4r5VbiUc/cEK15/bP4tkaes3xhIdJwj4FgLcPZeuMyTGnOx7QLnsTL cz2jarlxNQJuqfRt22hP5fh97Yj5vusnvUM4Z3Kp+RsGGC01cUDJKvTVZ+hj31TxeviMTgkDYII isUxyl2NWvsZ7nLFvIGPu/9DqtDWgsluEqIeNZla4nqocf/OHCWQ9k5y44EOu5ajmpJvoWSTdcL op1yrysEkzbETccAbTbJOnbBf+4S+JgZ3V92fWfV0ADjRaBMR/r5oNruIPlShTgKGDMIYm0+Mqk JcKh3gfcElkEw7pnzpvZ/ql9mhcQ8jHlKq4G2OetmAAlw= X-Received: by 2002:a05:7022:404:b0:11f:1e5b:2dd6 with SMTP id a92af1059eb24-126fc1cf977mr673452c88.17.1770255346736; Wed, 04 Feb 2026 17:35:46 -0800 (PST) Received: from fedora (c-67-164-59-41.hsd1.ca.comcast.net. [67.164.59.41]) by smtp.googlemail.com with ESMTPSA id a92af1059eb24-126f4e0f98asm3424982c88.5.2026.02.04.17.35.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Feb 2026 17:35:46 -0800 (PST) From: "Vishal Moola (Oracle)" To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, "Mike Rapoport (Microsoft)" , Dave Hansen Cc: akpm@linux-foundation.org, "Matthew Wilcox (Oracle)" , Andy Lutomirski , Peter Zijlstra , "Vishal Moola (Oracle)" Subject: [PATCH v4 0/4] Convert 64-bit x86/mm/pat to ptdescs Date: Wed, 4 Feb 2026 17:35:23 -0800 Message-ID: <20260205013527.322157-1-vishal.moola@gmail.com> X-Mailer: git-send-email 2.52.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit x86/mm/pat should be using ptdescs. One line has already been converted to pagetable_free(), while the allocation sites use get_free_pages(). This causes issues separately allocating ptdescs from struct page. The first patch introduces new ptdesc apis that operate on addresses. These are like get_free_pages() and free_pages() helper functions. The remaining patches convert the allocation/free sites to use ptdescs. In the short term, this helps enable Matthew's work to allocate frozen pagetables[1]. And in the long term, this will help us cleanly split ptdesc allocations from struct page[2]. The pgd_list should also be using ptdescs (for 32bit in this file). This can be done in a different patchset since there's other users of pgd_list that still need to be converted. [1] https://lore.kernel.org/linux-mm/20251113140448.1814860-1-willy@infradead.org/ [2] https://lore.kernel.org/linux-mm/20251020001652.2116669-1-willy@infradead.org/ ------ I've also tested this on a tree that separately allocates ptdescs. That didn't find any lingering alloc/free issues. Based on current mm-new. v4: - Added new ptdesc apis - Also renamed the pte/pmd free functions as well - Explained reasoning for renaming functions in the commit logs - Updated the cover-letter v3 link: https://lore.kernel.org/linux-mm/20260202172005.683870-1-vishal.moola@gmail.com/ Vishal Moola (Oracle) (4): mm: Add address apis for ptdescs x86/mm/pat: Convert pte code to use ptdescs x86/mm/pat: Convert pmd code to use ptdescs x86/mm/pat: Convert split_large_page() to use ptdescs arch/x86/mm/pat/set_memory.c | 49 ++++++++++++++++++------------------ include/linux/mm.h | 4 +++ mm/memory.c | 34 +++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 24 deletions(-) -- 2.52.0