AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: "Marek Olšák" <maraeo@gmail.com>, "Khatri, Sunil" <sukhatri@amd.com>
Cc: "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: Thu, 1 Aug 2024 09:37:24 +0200	[thread overview]
Message-ID: <18c7c805-d2ec-4448-bd25-cdb106aeac7e@amd.com> (raw)
In-Reply-To: <CAAxE2A7C3fuExvvjTytCR7fYNjoDTDzAqK2JroSihcz6EX7X2A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1375 bytes --]

Am 01.08.24 um 08:53 schrieb Marek Olšák:
> On Thu, Aug 1, 2024, 00:28 Khatri, Sunil <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 we can do is to optimize filling N DWs into the ring buffer without 
updating the WPTR each time.

Regards,
Christian.

>
> Marek
>

[-- Attachment #2: Type: text/html, Size: 2886 bytes --]

  reply	other threads:[~2024-08-01  7:37 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 [this message]
2024-08-01 18:55         ` Marek Olšák
2024-08-02 10:10           ` Lazar, Lijo
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=18c7c805-d2ec-4448-bd25-cdb106aeac7e@amd.com \
    --to=christian.koenig@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --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