From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 6D7981E9B3D; Tue, 2 Dec 2025 10:26:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764671178; cv=none; b=JD6yKfNGdE16PXMWGcNlpnH63ljV2QmLjwafqs2EP1U/ma3TtuCXyhtxzlOHAkcuZxn1q4vKzzUAbocJiYeq5DlHOiG5BqLW2TbjcLDyPzrA5j7GA/RffV3bV9V4svk3wGwWuB5jaFn5X7od6kOftGfASf0khpjwDZ4mH9RTKGs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764671178; c=relaxed/simple; bh=e7TL2i9NphOc/kce1J1qGMHgFQPOLfYmW0DnWE9bCNo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=GGZnfJpQst328kUzykat1OcKTo7G0RVEhR8RzNNDwfSu7aNRHrquXA1JIFloDdiWPvYvbVLvPBO/RjbkVOme19iLz5Ja7pYhyy8ADoTOoDmhmQYbwb8Hc6i6RsgYgGy/MO3T2yED5PNyLVZldp4QWTlHlYtHfk8bib5aiYnSS94= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=bFOm8/v6; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="bFOm8/v6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1764671174; bh=e7TL2i9NphOc/kce1J1qGMHgFQPOLfYmW0DnWE9bCNo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=bFOm8/v6aGx1M8z9Zpyb9UCv3oCX5iuw35PHBfvlLzi1JdAc/hfcxthIarnTbNCmy 2I0VCRherX6/R1pZ7//qNSValT98ap82x/aN8rBQadvr/Sqp/fCX03wW2OP0k00VlR BNYWfg0jR7SWsb5PuFzr2aPjdx25oUmHUZCb9wL3kl6gaWVsd3sl9q22u8MS9gbY1m biItp7+M0CcXY89Skv35SgVG3yNdN3Twq6IUnzBBPyLTnrsqNNs/tC8WG0dtzdLHmY zQlHEjlBD/b2u6jACtPmAUphkSD0T77qcK4KuQxC8PeqtJQrzbo8d+J2XIwpuAkP8C N60bj6/UJdbjQ== Received: from [IPV6:2a01:e0a:5e3:6100:7aed:fe0e:8590:cbaa] (unknown [IPv6:2a01:e0a:5e3:6100:7aed:fe0e:8590:cbaa]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: loicmolinari) by bali.collaboradmins.com (Postfix) with ESMTPSA id 91D2717E114C; Tue, 2 Dec 2025 11:26:13 +0100 (CET) Message-ID: <5554e135-8184-4aab-9b25-19f9e8cf1d7c@collabora.com> Date: Tue, 2 Dec 2025 11:26:12 +0100 Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v10 10/10] Documentation/gpu/drm-mm: Add THP paragraph to GEM mapping section To: =?UTF-8?Q?Ma=C3=ADra_Canal?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Boris Brezillon , Rob Herring , Steven Price , Liviu Dudau , Melissa Wen , Hugh Dickins , Baolin Wang , Andrew Morton , Al Viro , =?UTF-8?Q?Miko=C5=82aj_Wasiak?= , Christian Brauner , Nitin Gote , Andi Shyti , Jonathan Corbet , Christopher Healy , Matthew Wilcox , Bagas Sanjaya Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-mm@kvack.org, linux-doc@vger.kernel.org, kernel@collabora.com References: <20251128185252.3092-1-loic.molinari@collabora.com> <20251128185252.3092-11-loic.molinari@collabora.com> Content-Language: fr From: =?UTF-8?Q?Lo=C3=AFc_Molinari?= Organization: Collabora Ltd In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Maíra, On 01/12/2025 14:27, Maíra Canal wrote: > Hi Loïc, > > On 28/11/25 15:52, Loïc Molinari wrote: >> Add a paragraph to the GEM objects mapping section explaining how >> transparent huge pages are handled by GEM. >> >> v4: >> - fix wording after huge_pages handler removal >> >> v6: >> - fix wording after map_pages handler removal >> >> Signed-off-by: Loïc Molinari >> Reviewed-by: Bagas Sanjaya >> --- >>   Documentation/gpu/drm-mm.rst | 22 +++++++++++++++++----- >>   1 file changed, 17 insertions(+), 5 deletions(-) >> >> diff --git a/Documentation/gpu/drm-mm.rst b/Documentation/gpu/drm-mm.rst >> index d55751cad67c..d69eab0b4093 100644 >> --- a/Documentation/gpu/drm-mm.rst >> +++ b/Documentation/gpu/drm-mm.rst >> @@ -290,15 +290,27 @@ The open and close operations must update the >> GEM object reference >>   count. Drivers can use the drm_gem_vm_open() and drm_gem_vm_close() >> helper >>   functions directly as open and close handlers. >> -The fault operation handler is responsible for mapping individual pages >> -to userspace when a page fault occurs. Depending on the memory >> -allocation scheme, drivers can allocate pages at fault time, or can >> -decide to allocate memory for the GEM object at the time the object is >> -created. >> +The fault operation handler is responsible for mapping pages to >> +userspace when a page fault occurs. Depending on the memory allocation >> +scheme, drivers can allocate pages at fault time, or can decide to >> +allocate memory for the GEM object at the time the object is created. >>   Drivers that want to map the GEM object upfront instead of handling >> page >>   faults can implement their own mmap file operation handler. >> +In order to reduce page table overhead, if the internal shmem mountpoint >> +"shm_mnt" is configured to use transparent huge pages (for builds with >> +CONFIG_TRANSPARENT_HUGEPAGE enabled) and if the shmem backing store >> +managed to allocate a huge page for a faulty address, the fault handler >> +will first attempt to insert that huge page into the VMA before falling >> +back to individual page insertion. mmap() user address alignment for GEM >> +objects is handled by providing a custom get_unmapped_area file >> +operation which forwards to the shmem backing store. For most drivers, >> +which don't create a huge mountpoint by default or through a module >> +parameter, transparent huge pages can be enabled by either setting the >> +"transparent_hugepage_shmem" kernel parameter or the >> +"/sys/kernel/mm/transparent_hugepage/shmem_enabled" sysfs knob. > > It would be nice to have a paragraph about the use of the huge tmpfs > mountpoint helpers (maybe in the "GEM Objects Creation" section?). Thanks for the review. I've added a few words about the drm_gem_huge_huge_mnt() helper into the "GEM Objects Creation" section in patch series v11. I've also just realized that I added your R-b to that commit without you asking for it... sorry for that. I'll remove it in v12 unless you explicitly ask to let it there. Regards, Loïc > Best Regards, > - Maíra > >> + >>   For platforms without MMU the GEM core provides a helper method >>   drm_gem_dma_get_unmapped_area(). The mmap() routines will call this >> to get a >>   proposed address for the mapping. >