All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged mm-stable] mm-shmem-fix-the-shmem-large-folio-allocation-for-the-i915-driver.patch removed from -mm tree
@ 2025-08-02 18:53 Andrew Morton
  2025-08-02 18:58 ` Hugh Dickins
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2025-08-02 18:53 UTC (permalink / raw)
  To: mm-commits, ville.syrjala, patryk, hughd, baolin.wang, akpm

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2933 bytes --]


The quilt patch titled
     Subject: mm: shmem: fix the shmem large folio allocation for the i915 driver
has been removed from the -mm tree.  Its filename was
     mm-shmem-fix-the-shmem-large-folio-allocation-for-the-i915-driver.patch

This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Baolin Wang <baolin.wang@linux.alibaba.com>
Subject: mm: shmem: fix the shmem large folio allocation for the i915 driver
Date: Thu, 31 Jul 2025 09:53:43 +0800

After commit acd7ccb284b8 ("mm: shmem: add large folio support for
tmpfs"), we extend the 'huge=' option to allow any sized large folios for
tmpfs, which means tmpfs will allow getting a highest order hint based on
the size of write() and fallocate() paths, and then will try each
allowable large order.

However, when the i915 driver allocates shmem memory, it doesn't provide
hint information about the size of the large folio to be allocated,
resulting in the inability to allocate PMD-sized shmem, which in turn
affects GPU performance.

Patryk added:

: In my tests, the performance drop ranges from a few percent up to 13%
: in Unigine Superposition under heavy memory usage on the CPU Core Ultra
: 155H with the Xe 128 EU GPU.  Other users have reported performance
: impact up to 30% on certain workloads.  Please find more in the
: regressions reports:
: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/14645
: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13845
:
: I believe the change should be backported to all active kernel branches
: after version 6.12.

To fix this issue, we can use the inode's size as a write size hint in
shmem_read_folio_gfp() to help allocate PMD-sized large folios.

Link: https://lkml.kernel.org/r/f7e64e99a3a87a8144cc6b2f1dddf7a89c12ce44.1753926601.git.baolin.wang@linux.alibaba.com
Fixes: acd7ccb284b8 ("mm: shmem: add large folio support for tmpfs")
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Reported-by: Patryk Kowalczyk <patryk@kowalczyk.ws>
Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Tested-by: Patryk Kowalczyk <patryk@kowalczyk.ws>
Suggested-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/shmem.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/mm/shmem.c~mm-shmem-fix-the-shmem-large-folio-allocation-for-the-i915-driver
+++ a/mm/shmem.c
@@ -5981,8 +5981,8 @@ struct folio *shmem_read_folio_gfp(struc
 	struct folio *folio;
 	int error;
 
-	error = shmem_get_folio_gfp(inode, index, 0, &folio, SGP_CACHE,
-				    gfp, NULL, NULL);
+	error = shmem_get_folio_gfp(inode, index, i_size_read(inode),
+				    &folio, SGP_CACHE, gfp, NULL, NULL);
 	if (error)
 		return ERR_PTR(error);
 
_

Patches currently in -mm which might be from baolin.wang@linux.alibaba.com are



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [merged mm-stable] mm-shmem-fix-the-shmem-large-folio-allocation-for-the-i915-driver.patch removed from -mm tree
  2025-08-02 18:53 [merged mm-stable] mm-shmem-fix-the-shmem-large-folio-allocation-for-the-i915-driver.patch removed from -mm tree Andrew Morton
@ 2025-08-02 18:58 ` Hugh Dickins
  2025-08-02 19:06   ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Hugh Dickins @ 2025-08-02 18:58 UTC (permalink / raw)
  To: Andrew Morton; +Cc: mm-commits, ville.syrjala, patryk, hughd, baolin.wang

On Sat, 2 Aug 2025, Andrew Morton wrote:

> 
> The quilt patch titled
>      Subject: mm: shmem: fix the shmem large folio allocation for the i915 driver
> has been removed from the -mm tree.  Its filename was
>      mm-shmem-fix-the-shmem-large-folio-allocation-for-the-i915-driver.patch
> 
> This patch was dropped because it was merged into the mm-stable branch
> of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
> 
> ------------------------------------------------------
> From: Baolin Wang <baolin.wang@linux.alibaba.com>
> Subject: mm: shmem: fix the shmem large folio allocation for the i915 driver
> Date: Thu, 31 Jul 2025 09:53:43 +0800
> 
> After commit acd7ccb284b8 ("mm: shmem: add large folio support for
> tmpfs"), we extend the 'huge=' option to allow any sized large folios for
> tmpfs, which means tmpfs will allow getting a highest order hint based on
> the size of write() and fallocate() paths, and then will try each
> allowable large order.
> 
> However, when the i915 driver allocates shmem memory, it doesn't provide
> hint information about the size of the large folio to be allocated,
> resulting in the inability to allocate PMD-sized shmem, which in turn
> affects GPU performance.
> 
> Patryk added:
> 
> : In my tests, the performance drop ranges from a few percent up to 13%
> : in Unigine Superposition under heavy memory usage on the CPU Core Ultra
> : 155H with the Xe 128 EU GPU.  Other users have reported performance
> : impact up to 30% on certain workloads.  Please find more in the
> : regressions reports:
> : https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/14645
> : https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13845
> :
> : I believe the change should be backported to all active kernel branches
> : after version 6.12.
> 
> To fix this issue, we can use the inode's size as a write size hint in
> shmem_read_folio_gfp() to help allocate PMD-sized large folios.
> 
> Link: https://lkml.kernel.org/r/f7e64e99a3a87a8144cc6b2f1dddf7a89c12ce44.1753926601.git.baolin.wang@linux.alibaba.com
> Fixes: acd7ccb284b8 ("mm: shmem: add large folio support for tmpfs")
> Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
> Reported-by: Patryk Kowalczyk <patryk@kowalczyk.ws>
> Reported-by: Ville Syrj??l?? <ville.syrjala@linux.intel.com>
> Tested-by: Patryk Kowalczyk <patryk@kowalczyk.ws>
> Suggested-by: Hugh Dickins <hughd@google.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Thank you Andrew: but please add in the
Cc: <stable@vger.kernel.org>
which you corrrectly gave the v1 patch it replaces.

Thanks,
Hugh

> ---
> 
>  mm/shmem.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- a/mm/shmem.c~mm-shmem-fix-the-shmem-large-folio-allocation-for-the-i915-driver
> +++ a/mm/shmem.c
> @@ -5981,8 +5981,8 @@ struct folio *shmem_read_folio_gfp(struc
>  	struct folio *folio;
>  	int error;
>  
> -	error = shmem_get_folio_gfp(inode, index, 0, &folio, SGP_CACHE,
> -				    gfp, NULL, NULL);
> +	error = shmem_get_folio_gfp(inode, index, i_size_read(inode),
> +				    &folio, SGP_CACHE, gfp, NULL, NULL);
>  	if (error)
>  		return ERR_PTR(error);
>  
> _
> 
> Patches currently in -mm which might be from baolin.wang@linux.alibaba.com are
> 
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [merged mm-stable] mm-shmem-fix-the-shmem-large-folio-allocation-for-the-i915-driver.patch removed from -mm tree
  2025-08-02 18:58 ` Hugh Dickins
@ 2025-08-02 19:06   ` Andrew Morton
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2025-08-02 19:06 UTC (permalink / raw)
  To: Hugh Dickins; +Cc: mm-commits, ville.syrjala, patryk, baolin.wang

On Sat, 2 Aug 2025 11:58:58 -0700 (PDT) Hugh Dickins <hughd@google.com> wrote:

> > Link: https://lkml.kernel.org/r/f7e64e99a3a87a8144cc6b2f1dddf7a89c12ce44.1753926601.git.baolin.wang@linux.alibaba.com
> > Fixes: acd7ccb284b8 ("mm: shmem: add large folio support for tmpfs")
> > Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
> > Reported-by: Patryk Kowalczyk <patryk@kowalczyk.ws>
> > Reported-by: Ville Syrj??l?? <ville.syrjala@linux.intel.com>
> > Tested-by: Patryk Kowalczyk <patryk@kowalczyk.ws>
> > Suggested-by: Hugh Dickins <hughd@google.com>
> > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> 
> Thank you Andrew: but please add in the
> Cc: <stable@vger.kernel.org>
> which you corrrectly gave the v1 patch it replaces.

Done, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-02 19:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-02 18:53 [merged mm-stable] mm-shmem-fix-the-shmem-large-folio-allocation-for-the-i915-driver.patch removed from -mm tree Andrew Morton
2025-08-02 18:58 ` Hugh Dickins
2025-08-02 19:06   ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.