From: Karolina Drobnik <karolina.drobnik@intel.com> To: "Christian König" <christian.koenig@amd.com>, "Christian König" <ckoenig.leichtzumerken@gmail.com> Cc: linaro-mm-sig@lists.linaro.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org Subject: Re: [PATCH 3/5] dma-buf: return only unsignaled fences in dma_fence_unwrap_for_each v3 Date: Mon, 11 Jul 2022 14:41:11 +0200 [thread overview] Message-ID: <e1604e52-42e0-f98e-3f0d-72a2b00943ca@intel.com> (raw) In-Reply-To: <b28cca8f-ea2c-bab9-0de7-b469df121e09@amd.com> Hi Christian, On 11.07.2022 14:25, Christian König wrote: > Hi Karolina, > > Am 11.07.22 um 14:17 schrieb Karolina Drobnik: >> Hi Christian, >> >> On 11.07.2022 11:57, Christian König wrote: >>> Hi Karolina, >>> >>> Am 11.07.22 um 11:44 schrieb Karolina Drobnik: >>>> Hi Christian, >>>> >>>> I'm sorry for digging this one out so late. >>>> >>>> On 06.05.2022 16:10, Christian König wrote: >>>>> dma_fence_chain containers cleanup signaled fences automatically, so >>>>> filter those out from arrays as well. >>>>> >>>>> v2: fix missing walk over the array >>>>> v3: massively simplify the patch and actually update the description. >>>>> >>>>> Signed-off-by: Christian König <christian.koenig@amd.com> >>>>> --- >>>>> include/linux/dma-fence-unwrap.h | 6 +++++- >>>>> 1 file changed, 5 insertions(+), 1 deletion(-) >>>>> >>>>> diff --git a/include/linux/dma-fence-unwrap.h >>>>> b/include/linux/dma-fence-unwrap.h >>>>> index e7c219da4ed7..a4d342fef8e0 100644 >>>>> --- a/include/linux/dma-fence-unwrap.h >>>>> +++ b/include/linux/dma-fence-unwrap.h >>>>> @@ -43,9 +43,13 @@ struct dma_fence *dma_fence_unwrap_next(struct >>>>> dma_fence_unwrap *cursor); >>>>> * Unwrap dma_fence_chain and dma_fence_array containers and deep >>>>> dive into all >>>>> * potential fences in them. If @head is just a normal fence only >>>>> that one is >>>>> * returned. >>>>> + * >>>>> + * Note that signalled fences are opportunistically filtered out, >>>>> which >>>>> + * means the iteration is potentially over no fence at all. >>>>> */ >>>>> #define dma_fence_unwrap_for_each(fence, cursor, head) \ >>>>> for (fence = dma_fence_unwrap_first(head, cursor); fence; \ >>>>> - fence = dma_fence_unwrap_next(cursor)) >>>>> + fence = dma_fence_unwrap_next(cursor)) \ >>>>> + if (!dma_fence_is_signaled(fence)) >>>>> #endif >>>> >>>> It looks like this particular patch affects merging Sync Fences, >>>> which is reflected by failing IGT test (igt@sw_sync)[1]. The failing >>>> subtests are: >>>> - sync_merge - merging different fences on the same timeline, neither >>>> single nor merged fences are signaled >>>> >>>> - sync_merge_same - merging the fence with itself on the same >>>> timeline, the fence didn't signal at all >>>> >>>> - sync_multi_timeline_wait - merging different fences on different >>>> timelines; the subtest checks if counting fences of >>>> various states works. Currently, it can only see 2 >>>> active fences, 0 signaling (should be 2 active, >>>> 1 signaling) >>>> >>>> Reverting this commit on the top of drm-tip fixes the issue, but I'm >>>> not sure if it wouldn't impact other places in the code. Please let >>>> me know if I can be of any help. >>> >>> >>> Thanks for letting me know. Not sure what's going on here, but I can >>> take a look today if time permits. >> >> The reproduction with IGTs should be quite easy. You'll need to >> clone/download the IGT code and follow instructions for Building[1] >> the project (make sure you have meson and ninja installed): >> >> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdrm%2Figt-gpu-tools&data=05%7C01%7Cchristian.koenig%40amd.com%7C9a9587aefd2d4ac2d86208da63375cb6%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637931386683611766%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=4WsMutcFJ2HwBqld%2BTv9N1Tx6cbFMwJJZ6kjm5rbfoI%3D&reserved=0 >> >> >> Once you have it up and running, go to <igt path>/build/tests, and run >> the subtests: >> >> ./sw_sync --run sync_merge >> ./sw_sync --run sync_merge_same >> ./sw_sync --run sync_multi_timeline_wait >> >> You can run all the subtests with ./sw_sync, but I think these are the >> most relevant to you. > > Thanks, I've already managed to reproduce it. > > Not sure what's going on here, but could be that the test case was never > correct in the first place. Need to double check. That's also a possibility, but I couldn't verify it before writing to you, as it's not my area of expertise. Thanks for taking a look at this. All the best, Karolina > Thanks, > Christian. > >> >> Many thanks, >> Karolina >> >> ------------------ >> [1] - >> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdrm%2Figt-gpu-tools%23building&data=05%7C01%7Cchristian.koenig%40amd.com%7C9a9587aefd2d4ac2d86208da63375cb6%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637931386683611766%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=FV0Ao6ra8EOyr4cOs4N7mCmpOEUUObTrgyOrd0tvEV8%3D&reserved=0 >> >> >>> Do you have a description how to easy reproduce this? E.g. how to run >>> just those specific igts? >>> >>> Thanks, >>> Christian. >>> >>>> >>>> All the best, >>>> Karolina >>>> >
WARNING: multiple messages have this Message-ID (diff)
From: Karolina Drobnik <karolina.drobnik@intel.com> To: "Christian König" <christian.koenig@amd.com>, "Christian König" <ckoenig.leichtzumerken@gmail.com> Cc: <linaro-mm-sig@lists.linaro.org>, <dri-devel@lists.freedesktop.org>, <linux-media@vger.kernel.org> Subject: Re: [PATCH 3/5] dma-buf: return only unsignaled fences in dma_fence_unwrap_for_each v3 Date: Mon, 11 Jul 2022 14:41:11 +0200 [thread overview] Message-ID: <e1604e52-42e0-f98e-3f0d-72a2b00943ca@intel.com> (raw) In-Reply-To: <b28cca8f-ea2c-bab9-0de7-b469df121e09@amd.com> Hi Christian, On 11.07.2022 14:25, Christian König wrote: > Hi Karolina, > > Am 11.07.22 um 14:17 schrieb Karolina Drobnik: >> Hi Christian, >> >> On 11.07.2022 11:57, Christian König wrote: >>> Hi Karolina, >>> >>> Am 11.07.22 um 11:44 schrieb Karolina Drobnik: >>>> Hi Christian, >>>> >>>> I'm sorry for digging this one out so late. >>>> >>>> On 06.05.2022 16:10, Christian König wrote: >>>>> dma_fence_chain containers cleanup signaled fences automatically, so >>>>> filter those out from arrays as well. >>>>> >>>>> v2: fix missing walk over the array >>>>> v3: massively simplify the patch and actually update the description. >>>>> >>>>> Signed-off-by: Christian König <christian.koenig@amd.com> >>>>> --- >>>>> include/linux/dma-fence-unwrap.h | 6 +++++- >>>>> 1 file changed, 5 insertions(+), 1 deletion(-) >>>>> >>>>> diff --git a/include/linux/dma-fence-unwrap.h >>>>> b/include/linux/dma-fence-unwrap.h >>>>> index e7c219da4ed7..a4d342fef8e0 100644 >>>>> --- a/include/linux/dma-fence-unwrap.h >>>>> +++ b/include/linux/dma-fence-unwrap.h >>>>> @@ -43,9 +43,13 @@ struct dma_fence *dma_fence_unwrap_next(struct >>>>> dma_fence_unwrap *cursor); >>>>> * Unwrap dma_fence_chain and dma_fence_array containers and deep >>>>> dive into all >>>>> * potential fences in them. If @head is just a normal fence only >>>>> that one is >>>>> * returned. >>>>> + * >>>>> + * Note that signalled fences are opportunistically filtered out, >>>>> which >>>>> + * means the iteration is potentially over no fence at all. >>>>> */ >>>>> #define dma_fence_unwrap_for_each(fence, cursor, head) \ >>>>> for (fence = dma_fence_unwrap_first(head, cursor); fence; \ >>>>> - fence = dma_fence_unwrap_next(cursor)) >>>>> + fence = dma_fence_unwrap_next(cursor)) \ >>>>> + if (!dma_fence_is_signaled(fence)) >>>>> #endif >>>> >>>> It looks like this particular patch affects merging Sync Fences, >>>> which is reflected by failing IGT test (igt@sw_sync)[1]. The failing >>>> subtests are: >>>> - sync_merge - merging different fences on the same timeline, neither >>>> single nor merged fences are signaled >>>> >>>> - sync_merge_same - merging the fence with itself on the same >>>> timeline, the fence didn't signal at all >>>> >>>> - sync_multi_timeline_wait - merging different fences on different >>>> timelines; the subtest checks if counting fences of >>>> various states works. Currently, it can only see 2 >>>> active fences, 0 signaling (should be 2 active, >>>> 1 signaling) >>>> >>>> Reverting this commit on the top of drm-tip fixes the issue, but I'm >>>> not sure if it wouldn't impact other places in the code. Please let >>>> me know if I can be of any help. >>> >>> >>> Thanks for letting me know. Not sure what's going on here, but I can >>> take a look today if time permits. >> >> The reproduction with IGTs should be quite easy. You'll need to >> clone/download the IGT code and follow instructions for Building[1] >> the project (make sure you have meson and ninja installed): >> >> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdrm%2Figt-gpu-tools&data=05%7C01%7Cchristian.koenig%40amd.com%7C9a9587aefd2d4ac2d86208da63375cb6%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637931386683611766%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=4WsMutcFJ2HwBqld%2BTv9N1Tx6cbFMwJJZ6kjm5rbfoI%3D&reserved=0 >> >> >> Once you have it up and running, go to <igt path>/build/tests, and run >> the subtests: >> >> ./sw_sync --run sync_merge >> ./sw_sync --run sync_merge_same >> ./sw_sync --run sync_multi_timeline_wait >> >> You can run all the subtests with ./sw_sync, but I think these are the >> most relevant to you. > > Thanks, I've already managed to reproduce it. > > Not sure what's going on here, but could be that the test case was never > correct in the first place. Need to double check. That's also a possibility, but I couldn't verify it before writing to you, as it's not my area of expertise. Thanks for taking a look at this. All the best, Karolina > Thanks, > Christian. > >> >> Many thanks, >> Karolina >> >> ------------------ >> [1] - >> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdrm%2Figt-gpu-tools%23building&data=05%7C01%7Cchristian.koenig%40amd.com%7C9a9587aefd2d4ac2d86208da63375cb6%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637931386683611766%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=FV0Ao6ra8EOyr4cOs4N7mCmpOEUUObTrgyOrd0tvEV8%3D&reserved=0 >> >> >>> Do you have a description how to easy reproduce this? E.g. how to run >>> just those specific igts? >>> >>> Thanks, >>> Christian. >>> >>>> >>>> All the best, >>>> Karolina >>>> >
next prev parent reply other threads:[~2022-07-11 12:41 UTC|newest] Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-05-06 14:10 [PATCH 1/5] dma-buf: cleanup dma_fence_unwrap selftest v2 Christian König 2022-05-06 14:10 ` [PATCH 2/5] dma-buf: cleanup dma_fence_unwrap implementation Christian König 2022-05-06 14:10 ` Christian König 2022-05-06 14:10 ` [PATCH 3/5] dma-buf: return only unsignaled fences in dma_fence_unwrap_for_each v3 Christian König 2022-05-25 13:13 ` Daniel Vetter 2022-05-25 13:13 ` Daniel Vetter 2022-07-11 9:44 ` Karolina Drobnik 2022-07-11 9:44 ` Karolina Drobnik 2022-07-11 9:57 ` Christian König 2022-07-11 9:57 ` Christian König 2022-07-11 12:17 ` Karolina Drobnik 2022-07-11 12:17 ` Karolina Drobnik 2022-07-11 12:25 ` Christian König 2022-07-11 12:25 ` Christian König 2022-07-11 12:41 ` Karolina Drobnik [this message] 2022-07-11 12:41 ` Karolina Drobnik 2022-05-06 14:10 ` [PATCH 4/5] dma-buf: generalize dma_fence unwrap & merging v2 Christian König 2022-05-06 14:10 ` Christian König 2022-05-12 14:56 ` [dma] a9290ca07a: BUG:KASAN:slab-out-of-bounds_in__dma_fence_unwrap_merge kernel test robot 2022-05-12 14:56 ` kernel test robot 2022-05-12 14:56 ` kernel test robot 2022-05-06 14:10 ` [PATCH 5/5] drm: use dma_fence_unwrap_merge() in drm_syncobj Christian König 2022-05-06 14:10 ` Christian König 2022-05-06 14:11 ` [PATCH 1/5] dma-buf: cleanup dma_fence_unwrap selftest v2 Christian König 2022-05-12 11:34 ` Christian König 2022-05-25 13:16 ` Daniel Vetter 2022-05-25 13:16 ` Daniel Vetter [not found] <20220518135844.3338-1-christian.koenig@amd.com> 2022-05-18 13:58 ` [PATCH 3/5] dma-buf: return only unsignaled fences in dma_fence_unwrap_for_each v3 Christian König
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=e1604e52-42e0-f98e-3f0d-72a2b00943ca@intel.com \ --to=karolina.drobnik@intel.com \ --cc=christian.koenig@amd.com \ --cc=ckoenig.leichtzumerken@gmail.com \ --cc=dri-devel@lists.freedesktop.org \ --cc=linaro-mm-sig@lists.linaro.org \ --cc=linux-media@vger.kernel.org \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.