From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: "Adrián Larumbe" <adrian.larumbe@collabora.com>,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch,
robdclark@gmail.com, quic_abhinavk@quicinc.com,
dmitry.baryshkov@linaro.org, sean@poorly.run,
marijn.suijten@somainline.org, robh@kernel.org,
steven.price@arm.com
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
healych@amazon.com, kernel@collabora.com,
tvrtko.ursulin@linux.intel.com, boris.brezillon@collabora.com
Subject: Re: [PATCH v7 5/5] drm/panfrost: Implement generic DRM object RSS reporting function
Date: Thu, 28 Sep 2023 13:24:46 +0200 [thread overview]
Message-ID: <64367e0c-6ec9-8dfa-ab9c-51b530247f74@collabora.com> (raw)
In-Reply-To: <20230927213133.1651169-6-adrian.larumbe@collabora.com>
Il 27/09/23 23:29, Adrián Larumbe ha scritto:
> BO's RSS is updated every time new pages are allocated on demand and mapped
> for the object at GPU page fault's IRQ handler, but only for heap buffers.
> The reason this is unnecessary for non-heap buffers is that they are mapped
> onto the GPU's VA space and backed by physical memory in their entirety at
> BO creation time.
>
> This calculation is unnecessary for imported PRIME objects, since heap
> buffers cannot be exported by our driver, and the actual BO RSS size is the
> one reported in its attached dmabuf structure.
>
> Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
> Reviewed-by: Steven Price <steven.price@arm.com>
> ---
> drivers/gpu/drm/panfrost/panfrost_gem.c | 15 +++++++++++++++
> drivers/gpu/drm/panfrost/panfrost_gem.h | 5 +++++
> drivers/gpu/drm/panfrost/panfrost_mmu.c | 1 +
> 3 files changed, 21 insertions(+)
>
> diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c b/drivers/gpu/drm/panfrost/panfrost_gem.c
> index 7d8f83d20539..4365434b48db 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_gem.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_gem.c
> @@ -208,6 +208,20 @@ static enum drm_gem_object_status panfrost_gem_status(struct drm_gem_object *obj
> return res;
> }
>
> +static size_t panfrost_gem_rss(struct drm_gem_object *obj)
> +{
> + struct panfrost_gem_object *bo = to_panfrost_bo(obj);
> +
> + if (bo->is_heap) {
> + return bo->heap_rss_size;
> + } else if (bo->base.pages) {
> + WARN_ON(bo->heap_rss_size);
> + return bo->base.base.size;
> + } else {
> + return 0;
> + }
I would do, instead...
......
if (bo->is_heap) {
return bo->heap_rss_size;
} else if (bo->base.pages) {
WARN_ON(bo->heap_rss_size);
return bo->base.base.size;
}
return 0;
}
Apart from that,
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
prev parent reply other threads:[~2023-09-28 11:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-27 21:29 [PATCH v7 0/5] Add fdinfo support to Panfrost Adrián Larumbe
2023-09-27 21:29 ` [PATCH v7 1/5] drm/panfrost: Add cycle count GPU register definitions Adrián Larumbe
2023-09-28 11:24 ` AngeloGioacchino Del Regno
2023-09-27 21:29 ` [PATCH v7 2/5] drm/panfrost: Add fdinfo support GPU load metrics Adrián Larumbe
2023-09-28 11:24 ` AngeloGioacchino Del Regno
2023-09-27 21:29 ` [PATCH v7 3/5] drm/panfrost: Add fdinfo support for memory stats Adrián Larumbe
2023-09-28 11:24 ` AngeloGioacchino Del Regno
2023-09-27 21:29 ` [PATCH v7 4/5] drm/drm_file: Add DRM obj's RSS reporting function for fdinfo Adrián Larumbe
2023-09-28 11:24 ` AngeloGioacchino Del Regno
2023-09-27 21:29 ` [PATCH v7 5/5] drm/panfrost: Implement generic DRM object RSS reporting function Adrián Larumbe
2023-09-28 11:24 ` AngeloGioacchino Del Regno [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=64367e0c-6ec9-8dfa-ab9c-51b530247f74@collabora.com \
--to=angelogioacchino.delregno@collabora.com \
--cc=adrian.larumbe@collabora.com \
--cc=airlied@gmail.com \
--cc=boris.brezillon@collabora.com \
--cc=daniel@ffwll.ch \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=healych@amazon.com \
--cc=kernel@collabora.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=marijn.suijten@somainline.org \
--cc=mripard@kernel.org \
--cc=quic_abhinavk@quicinc.com \
--cc=robdclark@gmail.com \
--cc=robh@kernel.org \
--cc=sean@poorly.run \
--cc=steven.price@arm.com \
--cc=tvrtko.ursulin@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