From: Patryk Kowalczyk <patryk@kowalczyk.ws>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>,
hughd@google.com, ville.syrjala@linux.intel.com,
david@redhat.com, willy@infradead.org,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch,
jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com,
rodrigo.vivi@intel.com, tursulin@ursulin.net,
christian.koenig@amd.com, ray.huang@amd.com,
matthew.auld@intel.com, matthew.brost@intel.com,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Subject: Re: [PATCH] mm: shmem: fix the shmem large folio allocation for the i915 driver
Date: Mon, 28 Jul 2025 23:59:22 +0200 [thread overview]
Message-ID: <CAJCW39+AS5poKu3A4Y88pH2y6CWbE0WnGZfe3kL99W3sJZjreA@mail.gmail.com> (raw)
In-Reply-To: <20250728144424.208d58d5a95057ee7081ccd8@linux-foundation.org>
[-- Attachment #1: Type: text/plain, Size: 2182 bytes --]
Hi,
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.
best regards,
Patryk
pon., 28 lip 2025 o 23:44 Andrew Morton <akpm@linux-foundation.org>
napisał(a):
> On Mon, 28 Jul 2025 16:03:53 +0800 Baolin Wang <
> baolin.wang@linux.alibaba.com> wrote:
>
> > 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.
> >
> > To fix this issue, add the 'end' information for shmem_read_folio_gfp()
> to help
> > allocate PMD-sized large folios. Additionally, use the maximum
> allocation chunk
> > (via mapping_max_folio_size()) to determine the size of the large folios
> to
> > allocate in the i915 driver.
>
> What is the magnitude of the performance change?
>
> > Fixes: acd7ccb284b8 ("mm: shmem: add large folio support for tmpfs")
> > Reported-by: Patryk Kowalczyk <patryk@kowalczyk.ws>
> > Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Tested-by: Patryk Kowalczyk <patryk@kowalczyk.ws>
>
> This isn't a regression fix, is it? acd7ccb284b8 adds a new feature
> and we have now found a flaw in it.
>
> Still, we could bend the rules a little bit and backport this, depends
> on how significant the runtime effect is.
>
[-- Attachment #2: Type: text/html, Size: 3163 bytes --]
next prev parent reply other threads:[~2025-07-28 21:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-28 8:03 Baolin Wang
2025-07-28 21:44 ` Andrew Morton
2025-07-28 21:59 ` Patryk Kowalczyk [this message]
2025-07-28 22:16 ` Andrew Morton
2025-07-28 22:08 ` Patryk Kowalczyk
2025-07-30 6:54 ` Hugh Dickins
2025-07-30 7:46 ` Baolin Wang
2025-07-30 16:11 ` Patryk Kowalczyk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJCW39+AS5poKu3A4Y88pH2y6CWbE0WnGZfe3kL99W3sJZjreA@mail.gmail.com \
--to=patryk@kowalczyk.ws \
--cc=airlied@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=christian.koenig@amd.com \
--cc=david@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=hughd@google.com \
--cc=jani.nikula@linux.intel.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=matthew.auld@intel.com \
--cc=matthew.brost@intel.com \
--cc=mripard@kernel.org \
--cc=ray.huang@amd.com \
--cc=rodrigo.vivi@intel.com \
--cc=simona@ffwll.ch \
--cc=tursulin@ursulin.net \
--cc=tzimmermann@suse.de \
--cc=ville.syrjala@linux.intel.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox