The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@collabora.com>
To: Xiaolei Wang <xiaolei.wang@windriver.com>
Cc: maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	tzimmermann@suse.de, dmitry.baryshkov@oss.qualcomm.com,
	airlied@gmail.com, simona@ffwll.ch,
	dmitry.osipenko@collabora.com, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Use drm_gem_shmem_unpin() to unpin the backing pages for a shmem GEM
Date: Wed, 27 Aug 2025 10:07:48 +0200	[thread overview]
Message-ID: <20250827100748.0d7fb9d1@fedora> (raw)
In-Reply-To: <20250827022516.2890226-1-xiaolei.wang@windriver.com>

On Wed, 27 Aug 2025 10:25:16 +0800
Xiaolei Wang <xiaolei.wang@windriver.com> wrote:

> Although drm_gem_shmem_free() will decrease the use count
> on the backing pages and free backing pages for a GEM object,
> the pages_pin_count count is not decremented, which results
> in a warning. Therefore, use drm_gem_shmem_unpin() to unpin
> the backing pages for a shmem GEM.

With the subject prefixed with "drm/gem-shmem: " this is

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

> 
> WARNING: CPU: 2 PID: 1106 at drivers/gpu/drm/drm_gem_shmem_helper.c:180 drm_gem_shmem_free+0x4d0/0x6f0
>  Call trace:
>   drm_gem_shmem_free+0x4d0/0x6f0 (P)
>   drm_gem_shmem_free_wrapper+0x10/0x1c
>   __kunit_action_free+0x50/0x70
>   kunit_remove_resource+0x144/0x1e4
>   kunit_cleanup+0x64/0xfc
>   kunit_try_run_case_cleanup+0xa0/0xd4
>   kunit_generic_run_threadfn_adapter+0x80/0xec
>   kthread+0x3b8/0x6c0
>   ret_from_fork+0x10/0x20
> 
> Fixes: 93032ae634d4 ("drm/test: add a test suite for GEM objects backed by shmem")
> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
> ---
>  drivers/gpu/drm/tests/drm_gem_shmem_test.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/tests/drm_gem_shmem_test.c b/drivers/gpu/drm/tests/drm_gem_shmem_test.c
> index 68f2c3162354..e0a9f3a917ed 100644
> --- a/drivers/gpu/drm/tests/drm_gem_shmem_test.c
> +++ b/drivers/gpu/drm/tests/drm_gem_shmem_test.c
> @@ -227,6 +227,7 @@ static void drm_gem_shmem_test_get_pages_sgt(struct kunit *test)
>  		len += sg->length;
>  	}
>  
> +	drm_gem_shmem_unpin(shmem);
>  	KUNIT_EXPECT_GE(test, len, TEST_SIZE);
>  }
>  


      reply	other threads:[~2025-08-27  8:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-27  2:25 [PATCH] Use drm_gem_shmem_unpin() to unpin the backing pages for a shmem GEM Xiaolei Wang
2025-08-27  8:07 ` Boris Brezillon [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=20250827100748.0d7fb9d1@fedora \
    --to=boris.brezillon@collabora.com \
    --cc=airlied@gmail.com \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=dmitry.osipenko@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    --cc=xiaolei.wang@windriver.com \
    /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