public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@collabora.com>
To: "Adrián Larumbe" <adrian.larumbe@collabora.com>
Cc: "Steven Price" <steven.price@arm.com>,
	"Liviu Dudau" <liviu.dudau@arm.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Sumit Semwal" <sumit.semwal@linaro.org>,
	"Christian König" <christian.koenig@amd.com>,
	kernel@collabora.com, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	linaro-mm-sig@lists.linaro.org
Subject: Re: [PATCH v8 1/5] drm/panthor: introduce job cycle and timestamp accounting
Date: Wed, 2 Oct 2024 10:38:09 +0200	[thread overview]
Message-ID: <20241002103809.26d34ee0@collabora.com> (raw)
In-Reply-To: <20240923230912.2207320-2-adrian.larumbe@collabora.com>

On Tue, 24 Sep 2024 00:06:21 +0100
Adrián Larumbe <adrian.larumbe@collabora.com> wrote:

> +static u32 calc_profiling_ringbuf_num_slots(struct panthor_device *ptdev,
> +				       u32 cs_ringbuf_size)
> +{
> +	u32 min_profiled_job_instrs = U32_MAX;
> +	u32 last_flag = fls(PANTHOR_DEVICE_PROFILING_ALL);
> +
> +	/*
> +	 * We want to calculate the minimum size of a profiled job's CS,
> +	 * because since they need additional instructions for the sampling
> +	 * of performance metrics, they might take up further slots in
> +	 * the queue's ringbuffer. This means we might not need as many job
> +	 * slots for keeping track of their profiling information. What we
> +	 * need is the maximum number of slots we should allocate to this end,
> +	 * which matches the maximum number of profiled jobs we can place
> +	 * simultaneously in the queue's ring buffer.
> +	 * That has to be calculated separately for every single job profiling
> +	 * flag, but not in the case job profiling is disabled, since unprofiled
> +	 * jobs don't need to keep track of this at all.
> +	 */
> +	for (u32 i = 0; i < last_flag; i++) {
> +		if (BIT(i) & PANTHOR_DEVICE_PROFILING_ALL)

I'll get rid of this check when applying, as suggested by Steve. Steve,
with this modification do you want me to add your R-b?

BTW, I've also fixed a bunch of checkpatch errors/warnings, so you
might want to run checkpatch --strict next time.

> +			min_profiled_job_instrs =
> +				min(min_profiled_job_instrs, calc_job_credits(BIT(i)));
> +	}
> +
> +	return DIV_ROUND_UP(cs_ringbuf_size, min_profiled_job_instrs * sizeof(u64));
> +}

  reply	other threads:[~2024-10-02  8:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-23 23:06 [PATCH v8 0/5] Support fdinfo runtime and memory stats on Panthor Adrián Larumbe
2024-09-23 23:06 ` [PATCH v8 1/5] drm/panthor: introduce job cycle and timestamp accounting Adrián Larumbe
2024-10-02  8:38   ` Boris Brezillon [this message]
2024-10-02  8:54     ` Steven Price
2024-09-23 23:06 ` [PATCH v8 2/5] drm/panthor: record current and maximum device clock frequencies Adrián Larumbe
2024-09-23 23:06 ` [PATCH v8 3/5] drm/panthor: add DRM fdinfo support Adrián Larumbe
2024-09-29  0:25   ` kernel test robot
2024-10-02  8:14     ` Boris Brezillon
2024-10-02  8:40   ` Boris Brezillon
2024-09-23 23:06 ` [PATCH v8 4/5] drm/panthor: enable fdinfo for memory stats Adrián Larumbe
2024-09-23 23:06 ` [PATCH v8 5/5] drm/panthor: add sysfs knob for enabling job profiling Adrián Larumbe
2024-10-02  8:57 ` [PATCH v8 0/5] Support fdinfo runtime and memory stats on Panthor Boris Brezillon
2024-10-02  9:26   ` Jani Nikula
2024-10-02  9:58     ` Boris Brezillon

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=20241002103809.26d34ee0@collabora.com \
    --to=boris.brezillon@collabora.com \
    --cc=adrian.larumbe@collabora.com \
    --cc=airlied@gmail.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel@collabora.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=liviu.dudau@arm.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=steven.price@arm.com \
    --cc=sumit.semwal@linaro.org \
    --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