From: "Lazar, Lijo" <lijo.lazar@amd.com>
To: "Marek Olšák" <maraeo@gmail.com>,
"Christian König" <christian.koenig@amd.com>
Cc: "Khatri, Sunil" <sukhatri@amd.com>,
"Sunil Khatri" <sunil.khatri@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"amd-gfx mailing list" <amd-gfx@lists.freedesktop.org>,
"Pierre-Eric Pelloux-Prayer" <pierre-eric.pelloux-prayer@amd.com>,
"Tvrtko Ursulin" <tursulin@igalia.com>,
"Marek Olšák" <marek.olsak@amd.com>
Subject: Re: [PATCH] drm/amdgpu: optimize the padding with hw optimization
Date: Fri, 2 Aug 2024 15:40:05 +0530 [thread overview]
Message-ID: <e9dac87c-5df7-47ec-8f95-a10792252385@amd.com> (raw)
In-Reply-To: <CAAxE2A7XBQfUnYhSg2RS7TP_i6cv775RW0ocdgAyc-F0dsSqmQ@mail.gmail.com>
On 8/2/2024 12:25 AM, Marek Olšák wrote:
> On Thu, Aug 1, 2024, 03:37 Christian König <christian.koenig@amd.com
> <mailto:christian.koenig@amd.com>> wrote:
>
> __
> Am 01.08.24 um 08:53 schrieb Marek Olšák:
>> On Thu, Aug 1, 2024, 00:28 Khatri, Sunil <sukhatri@amd.com
>> <mailto:sukhatri@amd.com>> wrote:
>>
>>
>> On 8/1/2024 8:49 AM, Marek Olšák wrote:
>> >> + /* Header is at index 0, followed by num_nops - 1
>> NOP packet's */
>> >> + for (i = 1; i < num_nop; i++)
>> >> + amdgpu_ring_write(ring, ring->funcs->nop);
>> > This loop should be removed. It's unnecessary CPU overhead
>> and we
>> > should never get more than 0x3fff NOPs (maybe use BUG_ON).
>> Leaving the
>> > whole packet body uninitialized is the fastest option.
>> That was the original intent to just move the WPTR for the no
>> of nops
>> and tried too. Based on Christian inputs we should not let the
>> nops packet
>>
>> as garbage or whatever was there originally as a threat/safety
>> measure.
>>
>>
>> It doesn't help safety. It can only be read by the GPU with
>> kernel-level permissions.
>>
>> Initializing the packet body is useless and adds CPU overhead,
>> especially with the 256 NOPs or so that we use for no reason.
>
> Not filling the remaining ring buffers with NOPs is a pretty clear
> NAK from my side. Leaving garbage in the ring buffer is not even
> remotely defensive.
>
>
> What are you defending against? You know the ring is kernel-owned
> memory, right?
>
Aside from that, the true hardware behavior is that CP still fetches the
words and discards them. It's not the same mentioned in the description.
So the only optimization it allows is to move the pointer without
filling/caring about the contents as hardware also doesn't care about
them. The notion of filling those unused region is exactly opposite of
the intention. If that's the case, nothing is gained and just drop these
patches.
Thanks,
Lijo
> Marek
>
>
> What we can do is to optimize filling N DWs into the ring buffer
> without updating the WPTR each time.
>
> Regards,
> Christian.
>
>>
>> Marek
>>
next prev parent reply other threads:[~2024-08-02 10:10 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-30 12:43 [PATCH] drm/amdgpu: optimize the padding with hw optimization Sunil Khatri
2024-07-30 13:17 ` Christian König
2024-08-01 3:19 ` Marek Olšák
2024-08-01 3:22 ` Marek Olšák
2024-08-01 4:32 ` Khatri, Sunil
2024-08-01 4:27 ` Khatri, Sunil
2024-08-01 6:53 ` Marek Olšák
2024-08-01 7:37 ` Christian König
2024-08-01 18:55 ` Marek Olšák
2024-08-02 10:10 ` Lazar, Lijo [this message]
2024-08-04 5:28 ` Marek Olšák
2024-08-04 18:11 ` Marek Olšák
2024-08-07 8:21 ` Tvrtko Ursulin
2024-08-07 16:42 ` Marek Olšák
2024-08-01 3:24 ` Marek Olšák
2024-08-01 4:34 ` Khatri, Sunil
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=e9dac87c-5df7-47ec-8f95-a10792252385@amd.com \
--to=lijo.lazar@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=maraeo@gmail.com \
--cc=marek.olsak@amd.com \
--cc=pierre-eric.pelloux-prayer@amd.com \
--cc=sukhatri@amd.com \
--cc=sunil.khatri@amd.com \
--cc=tursulin@igalia.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