From: Matthew Brost <matthew.brost@intel.com>
To: Arvind Yadav <arvind.yadav@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
<simona@ffwll.ch>, <mripard@kernel.org>, <tzimmermann@suse.de>,
<airlied@gmail.com>, <maarten.lankhorst@linux.intel.com>,
<himal.prasad.ghimiray@intel.com>,
<thomas.hellstrom@linux.intel.com>
Subject: Re: [PATCH] drm/pagemap: Reset migration page count on eviction retry
Date: Tue, 28 Jul 2026 15:05:39 -0700 [thread overview]
Message-ID: <amkns0g0yHlAKbpr@gsse-cloud1.jf.intel.com> (raw)
In-Reply-To: <20260728090304.1264759-1-arvind.yadav@intel.com>
On Tue, Jul 28, 2026 at 02:33:04PM +0530, Arvind Yadav wrote:
> drm_pagemap_evict_to_ram() may retry eviction, but mpages retains
> the count from the previous attempt. A retry can therefore continue
> to the copy path even when no RAM pages were populated.
>
> Reset mpages at the retry label so it reflects only the current
> attempt.
>
> Fixes: 99624bdff867 ("drm/gpusvm: Add support for GPU Shared Virtual Memory")
I think you also want the patch which moved drm_pagemap to its own file:
f86ad0ed620c drm/gpusvm, drm/pagemap: Move migration functionality to drm_pagemap
> Cc: Matthew Brost <matthew.brost@intel.com>
Fix itself LGTM:
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: David Airlie <airlied@gmail.com>
> Cc: Simona Vetter <simona@ffwll.ch>
> Signed-off-by: Arvind Yadav <arvind.yadav@intel.com>
> ---
> drivers/gpu/drm/drm_pagemap.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_pagemap.c b/drivers/gpu/drm/drm_pagemap.c
> index 4a794544b7dc..7faba4acd59f 100644
> --- a/drivers/gpu/drm/drm_pagemap.c
> +++ b/drivers/gpu/drm/drm_pagemap.c
> @@ -1122,7 +1122,7 @@ int drm_pagemap_evict_to_ram(struct drm_pagemap_devmem *devmem_allocation)
> {
> const struct drm_pagemap_devmem_ops *ops = devmem_allocation->ops;
> struct drm_pagemap_iova_state state = {};
> - unsigned long npages, mpages = 0;
> + unsigned long npages, mpages;
> struct page **pages;
> unsigned long *src, *dst;
> struct drm_pagemap_addr *pagemap_addr;
> @@ -1133,6 +1133,7 @@ int drm_pagemap_evict_to_ram(struct drm_pagemap_devmem *devmem_allocation)
> npages = devmem_allocation->size >> PAGE_SHIFT;
>
> retry:
> + mpages = 0;
> if (!mmget_not_zero(devmem_allocation->mm))
> return -EFAULT;
>
> --
> 2.43.0
>
prev parent reply other threads:[~2026-07-28 22:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-28 9:03 [PATCH] drm/pagemap: Reset migration page count on eviction retry Arvind Yadav
2026-07-28 9:10 ` ✓ CI.KUnit: success for " Patchwork
2026-07-28 9:45 ` ✓ Xe.CI.BAT: " Patchwork
2026-07-28 12:30 ` ✓ Xe.CI.FULL: " Patchwork
2026-07-28 22:05 ` Matthew Brost [this message]
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=amkns0g0yHlAKbpr@gsse-cloud1.jf.intel.com \
--to=matthew.brost@intel.com \
--cc=airlied@gmail.com \
--cc=arvind.yadav@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=himal.prasad.ghimiray@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=thomas.hellstrom@linux.intel.com \
--cc=tzimmermann@suse.de \
/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