lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <76b14bb5-f17d-29ec-d64e-bfb0fc6d2cf9@amd.com>
Date:   Tue, 17 Aug 2021 11:00:29 +0200
From:   Christian König <christian.koenig@....com>
To:     Rob Clark <robdclark@...il.com>
Cc:     dri-devel <dri-devel@...ts.freedesktop.org>,
        linux-arm-msm <linux-arm-msm@...r.kernel.org>,
        freedreno <freedreno@...ts.freedesktop.org>,
        Daniel Vetter <daniel@...ll.ch>,
        Christian König <ckoenig.leichtzumerken@...il.com>,
        Rob Clark <robdclark@...omium.org>,
        Alex Deucher <alexander.deucher@....com>,
        Andrey Grodzovsky <andrey.grodzovsky@....com>,
        Gustavo Padovan <gustavo@...ovan.org>,
        Jack Zhang <Jack.Zhang1@....com>,
        Lee Jones <lee.jones@...aro.org>,
        "moderated list:DMA BUFFER SHARING FRAMEWORK" 
        <linaro-mm-sig@...ts.linaro.org>,
        open list <linux-kernel@...r.kernel.org>,
        "open list:DMA BUFFER SHARING FRAMEWORK" 
        <linux-media@...r.kernel.org>, Luben Tuikov <luben.tuikov@....com>,
        Steven Price <steven.price@....com>,
        Tian Tao <tiantao6@...ilicon.com>
Subject: Re: [PATCH v2 0/5] dma-fence: Deadline awareness

Am 17.08.21 um 00:29 schrieb Rob Clark:
> dma_fence_array looks simple enough, just propagate the deadline to
> all children.
>
> I guess dma_fence_chain is similar (ie. fence is signalled when all
> children are signalled), the difference being simply that children are
> added dynamically?

No, new chain nodes are always added at the top.

So when you have a dma_fence_chain as a starting point the linked nodes 
after it will stay the same (except for garbage collection).

The tricky part is you can't use recursion, cause that would easily 
exceed the kernels stack depth. So you need something similar to 
dma_fence_chain_signaled().

Something like this should do it:

static bool dma_fence_chain_set_deadline(struct dma_fence *fence, 
ktime_t deadline)
{
         dma_fence_chain_for_each(fence, fence) {
                 struct dma_fence_chain *chain = to_dma_fence_chain(fence);
                 struct dma_fence *f = chain ? chain->fence : fence;

                 dma_fence_set_deadline(f, deadline);
         }
}

Regards,
Christian.

>
> BR,
> -R
>
> On Mon, Aug 16, 2021 at 3:17 AM Christian König
> <christian.koenig@....com> wrote:
>> The general approach seems to make sense now I think.
>>
>> One minor thing which I'm missing is adding support for this to the
>> dma_fence_array and dma_fence_chain containers.
>>
>> Regards,
>> Christian.
>>
>> Am 07.08.21 um 20:37 schrieb Rob Clark:
>>> From: Rob Clark <robdclark@...omium.org>
>>>
>>> Based on discussion from a previous series[1] to add a "boost" mechanism
>>> when, for example, vblank deadlines are missed.  Instead of a boost
>>> callback, this approach adds a way to set a deadline on the fence, by
>>> which the waiter would like to see the fence signalled.
>>>
>>> I've not yet had a chance to re-work the drm/msm part of this, but
>>> wanted to send this out as an RFC in case I don't have a chance to
>>> finish the drm/msm part this week.
>>>
>>> Original description:
>>>
>>> In some cases, like double-buffered rendering, missing vblanks can
>>> trick the GPU into running at a lower frequence, when really we
>>> want to be running at a higher frequency to not miss the vblanks
>>> in the first place.
>>>
>>> This is partially inspired by a trick i915 does, but implemented
>>> via dma-fence for a couple of reasons:
>>>
>>> 1) To continue to be able to use the atomic helpers
>>> 2) To support cases where display and gpu are different drivers
>>>
>>> [1] https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.freedesktop.org%2Fseries%2F90331%2F&amp;data=04%7C01%7Cchristian.koenig%40amd.com%7Cf34fa8c2316241f1516408d96104c2c7%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637647495930712007%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=4DoEsan2nW2cNwWrhnHsJF2h0MY1uCslRfOLmbYu6uw%3D&amp;reserved=0
>>>
>>> v1: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.freedesktop.org%2Fseries%2F93035%2F&amp;data=04%7C01%7Cchristian.koenig%40amd.com%7Cf34fa8c2316241f1516408d96104c2c7%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637647495930722002%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=3%2BRFE0nEgZXPZ50iVPila5CgzXErllBEK6YpL%2FOEGGc%3D&amp;reserved=0
>>> v2: Move filtering out of later deadlines to fence implementation
>>>       to avoid increasing the size of dma_fence
>>>
>>> Rob Clark (5):
>>>     dma-fence: Add deadline awareness
>>>     drm/vblank: Add helper to get next vblank time
>>>     drm/atomic-helper: Set fence deadline for vblank
>>>     drm/scheduler: Add fence deadline support
>>>     drm/msm: Add deadline based boost support
>>>
>>>    drivers/dma-buf/dma-fence.c             | 20 +++++++
>>>    drivers/gpu/drm/drm_atomic_helper.c     | 36 ++++++++++++
>>>    drivers/gpu/drm/drm_vblank.c            | 31 ++++++++++
>>>    drivers/gpu/drm/msm/msm_fence.c         | 76 +++++++++++++++++++++++++
>>>    drivers/gpu/drm/msm/msm_fence.h         | 20 +++++++
>>>    drivers/gpu/drm/msm/msm_gpu.h           |  1 +
>>>    drivers/gpu/drm/msm/msm_gpu_devfreq.c   | 20 +++++++
>>>    drivers/gpu/drm/scheduler/sched_fence.c | 25 ++++++++
>>>    drivers/gpu/drm/scheduler/sched_main.c  |  3 +
>>>    include/drm/drm_vblank.h                |  1 +
>>>    include/drm/gpu_scheduler.h             |  6 ++
>>>    include/linux/dma-fence.h               | 16 ++++++
>>>    12 files changed, 255 insertions(+)
>>>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ