[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251004093054.21388-1-loic.molinari@collabora.com>
Date: Sat, 4 Oct 2025 11:30:43 +0200
From: Loïc Molinari <loic.molinari@...labora.com>
To: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>,
Jani Nikula <jani.nikula@...ux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
Tvrtko Ursulin <tursulin@...ulin.net>,
Boris Brezillon <boris.brezillon@...labora.com>,
Rob Herring <robh@...nel.org>,
Steven Price <steven.price@....com>,
Liviu Dudau <liviu.dudau@....com>,
Melissa Wen <mwen@...lia.com>,
Maíra Canal <mcanal@...lia.com>,
Hugh Dickins <hughd@...gle.com>,
Baolin Wang <baolin.wang@...ux.alibaba.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Loïc Molinari <loic.molinari@...labora.com>,
Al Viro <viro@...iv.linux.org.uk>,
Mikołaj Wasiak <mikolaj.wasiak@...el.com>,
Christian Brauner <brauner@...nel.org>,
Nitin Gote <nitin.r.gote@...el.com>,
Andi Shyti <andi.shyti@...ux.intel.com>,
Christopher Healy <healych@...zon.com>
Cc: linux-kernel@...r.kernel.org,
dri-devel@...ts.freedesktop.org,
intel-gfx@...ts.freedesktop.org,
linux-mm@...ck.org,
kernel@...labora.com
Subject: [PATCH v3 00/10] drm: Reduce page tables overhead with THP
This series aims to reduce the page tables overhead of DRM drivers for
builds with CONFIG_TRANSPARENT_HUGEPAGE enabled and either the sysfs
knob '/sys/kernel/mm/transparent_hugepage/shmem_enabled' appropriately
set or drivers using a dedicated huge tmpfs mount point.
It starts by adding a huge page fault handler for GEM objects to
insert PMD or PUD mappings whenever the shmem backing store manages to
create huge folios. It then introduces a dedicated get_unmapped_area
file operation on the DRM file descriptor for GEM objects to get the
best virtual address alignment for the underlying shmem buffers.
The remaining commits propose shmem helpers to create and release huge
tmpfs mount points and adapt the i915 and V3D drivers. The helpers are
then used to optionally enable Transparent Hugepage for Panfrost and
Panthor.
For Panthor on a Rock 5B, this series makes the first memcpy() to an
entire BO object mapped in userspace about twice as fast with
Transparent Hugepage enabled.
Loïc Molinari (10):
drm/shmem-helper: Add huge page fault handler
drm/gem: Introduce drm_gem_get_unmapped_area() fop
drm/gem: Add huge tmpfs mount point helper
drm/i915: Use huge tmpfs mount point helper
drm/v3d: Use huge tmpfs mount point helper
drm/gem: Get rid of *_with_mnt helpers
drm/panthor: Introduce huge tmpfs mount point option
drm/panthor: Improve IOMMU map/unmap debugging logs
drm/panfrost: Introduce huge tmpfs mount point option
Documentation/gpu/drm-mm: Add THP paragraph to GEM mapping section
Documentation/gpu/drm-mm.rst | 17 +-
drivers/gpu/drm/drm_gem.c | 208 ++++++++++++++----
drivers/gpu/drm/drm_gem_shmem_helper.c | 94 +++++---
drivers/gpu/drm/i915/Makefile | 3 +-
drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 52 +++--
drivers/gpu/drm/i915/gem/i915_gemfs.c | 74 -------
drivers/gpu/drm/i915/gem/i915_gemfs.h | 14 --
.../gpu/drm/i915/gem/selftests/huge_pages.c | 10 +-
drivers/gpu/drm/i915/i915_drv.h | 5 -
drivers/gpu/drm/panfrost/panfrost_device.c | 3 +
drivers/gpu/drm/panfrost/panfrost_drv.c | 6 +
drivers/gpu/drm/panfrost/panfrost_drv.h | 11 +
drivers/gpu/drm/panfrost/panfrost_gem.c | 19 ++
drivers/gpu/drm/panfrost/panfrost_gem.h | 2 +
drivers/gpu/drm/panthor/panthor_device.c | 3 +
drivers/gpu/drm/panthor/panthor_drv.c | 7 +
drivers/gpu/drm/panthor/panthor_drv.h | 11 +
drivers/gpu/drm/panthor/panthor_gem.c | 19 ++
drivers/gpu/drm/panthor/panthor_gem.h | 2 +
drivers/gpu/drm/panthor/panthor_mmu.c | 19 +-
drivers/gpu/drm/v3d/Makefile | 3 +-
drivers/gpu/drm/v3d/v3d_bo.c | 6 +-
drivers/gpu/drm/v3d/v3d_drv.c | 2 +-
drivers/gpu/drm/v3d/v3d_drv.h | 11 +-
drivers/gpu/drm/v3d/v3d_gem.c | 33 ++-
drivers/gpu/drm/v3d/v3d_gemfs.c | 65 ------
include/drm/drm_device.h | 11 +
include/drm/drm_gem.h | 8 +-
include/drm/drm_gem_shmem_helper.h | 3 -
mm/shmem.c | 1 +
30 files changed, 431 insertions(+), 291 deletions(-)
delete mode 100644 drivers/gpu/drm/i915/gem/i915_gemfs.c
delete mode 100644 drivers/gpu/drm/i915/gem/i915_gemfs.h
create mode 100644 drivers/gpu/drm/panfrost/panfrost_drv.h
create mode 100644 drivers/gpu/drm/panthor/panthor_drv.h
delete mode 100644 drivers/gpu/drm/v3d/v3d_gemfs.c
--
2.47.3
Powered by blists - more mailing lists