[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <974cf95e-38fe-4949-ba63-b1513ce8abb5@arm.com>
Date: Wed, 2 Oct 2024 09:54:12 +0100
From: Steven Price <steven.price@....com>
To: Boris Brezillon <boris.brezillon@...labora.com>,
Adrián Larumbe <adrian.larumbe@...labora.com>
Cc: Liviu Dudau <liviu.dudau@....com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Sumit Semwal <sumit.semwal@...aro.org>,
Christian König <christian.koenig@....com>,
kernel@...labora.com, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org, linux-media@...r.kernel.org,
linaro-mm-sig@...ts.linaro.org
Subject: Re: [PATCH v8 1/5] drm/panthor: introduce job cycle and timestamp
accounting
On 02/10/2024 09:38, Boris Brezillon wrote:
> On Tue, 24 Sep 2024 00:06:21 +0100
> Adrián Larumbe <adrian.larumbe@...labora.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?
Yes, please do.
Thanks,
Steve
> 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));
>> +}
Powered by blists - more mailing lists