Message ID | 20220506141009.18047-3-christian.koenig@amd.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers |
Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from <linux-media-owner@vger.kernel.org>) id 1nmyfH-00HYp5-LV; Fri, 06 May 2022 14:10:39 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442046AbiEFOOS (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Fri, 6 May 2022 10:14:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442117AbiEFOOJ (ORCPT <rfc822;linux-media@vger.kernel.org>); Fri, 6 May 2022 10:14:09 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0F9A6928D for <linux-media@vger.kernel.org>; Fri, 6 May 2022 07:10:14 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id p18so8854328edr.7 for <linux-media@vger.kernel.org>; Fri, 06 May 2022 07:10:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QNt760DjFBo7HAT2HJsEWq9kQPdH1wnsqRHak7OGdbE=; b=C2w/6N6kbyW7wVnzjHEOL+TPmgmnkRUjE4m7nOD0xETPp8focvjo6CypBlsChAFjdH rIYi5xu4cR7HFotKDwR/oi2wvpCLJyQ/Iqq07iNVjrJbN8ISFmXogi0dAO3Jxx7SkmU4 MOyoIiT75Gh7/1zH//eMuwRZ5WI7NtDLtFwZ9R5qgDyQk9k2x27IR79vVvc7qetLDs9F mB4d0A7Of9GBAJR7GLYDVjHG6ftXGFXhlUKgr1JuV7gaCebYbNBSBkXunxic38FXLmrh TTkQjQOmES6doapjyvA0yToi+JAZXUG1ezejkLs28vHTZy8sX7P3ZtU32v9yjGenzF9V wWWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QNt760DjFBo7HAT2HJsEWq9kQPdH1wnsqRHak7OGdbE=; b=aDZKs+IAjtG7G1xIvcW1jdJKfldsSO/Gdn3YDIVVRDLGIYGgst9t+MwuGiFyDftcKQ m/j3+7KJ4CgWs9M5MQLt1QM9bZG458WMy2AWho24krF4Q+HycMEoVA+DlV2Uoiri/5l5 RGiX/groGqMhjKr/F9dgoCKJbnm7OoDRnVWNxVB9fxPK1vYuBX1J7mP3gummAcZpDBNm xqDaMfuOhab393cXJrIHrwpn+J01/vkjKqKEJLmz8KFpznd4Y+l9jzT1gBl6YklIzeDw Rw9eZUcbVLxriRNPsj317HtRj5Me9is6WwgfRLZdOizDoi9SImHIH+CLQju9mCwA56Q/ wP0Q== X-Gm-Message-State: AOAM5301VEEGaYvKqXk0uRvlPI+x8MraWkop+Yvk+14gqIS9nb7RAmF8 bTUbi83nVJsfbbMDYBlLQnNB98Sthfs= X-Google-Smtp-Source: ABdhPJxuGXiCo/++b2braxDlEZUUiIW9zHboM3NzkydRtAsGo5ltD8AOTRLv4lnCa/0vWeRSaQqT8w== X-Received: by 2002:a05:6402:3490:b0:427:b471:9e1e with SMTP id v16-20020a056402349000b00427b4719e1emr3624011edc.36.1651846213529; Fri, 06 May 2022 07:10:13 -0700 (PDT) Received: from able.fritz.box (p57b0b3fd.dip0.t-ipconnect.de. [87.176.179.253]) by smtp.gmail.com with ESMTPSA id jx3-20020a170907760300b006f3ef214e22sm1915415ejc.136.2022.05.06.07.10.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 May 2022 07:10:13 -0700 (PDT) From: " =?utf-8?q?Christian_K=C3=B6nig?= " <ckoenig.leichtzumerken@gmail.com> X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= <christian.koenig@amd.com> To: daniel@ffwll.ch, linaro-mm-sig@lists.linaro.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org Cc: =?utf-8?q?Christian_K=C3=B6nig?= <christian.koenig@amd.com> Subject: [PATCH 3/5] dma-buf: return only unsignaled fences in dma_fence_unwrap_for_each v3 Date: Fri, 6 May 2022 16:10:07 +0200 Message-Id: <20220506141009.18047-3-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220506141009.18047-1-christian.koenig@amd.com> References: <20220506141009.18047-1-christian.koenig@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,FREEMAIL_FORGED_FROMDOMAIN=0.001,FREEMAIL_FROM=0.001,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no |
Series |
[1/5] dma-buf: cleanup dma_fence_unwrap selftest v2
|
|
Commit Message
Christian König
May 6, 2022, 2:10 p.m. UTC
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(-)
Comments
On Fri, May 06, 2022 at 04:10:07PM +0200, 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> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> > --- > 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 > -- > 2.25.1 >
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. All the best, Karolina --------------------- [1] - reproducible locally, but can be also seen in the CI: https://intel-gfx-ci.01.org/tree/drm-tip/index.html?testfilter=igt@sw_sync
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. 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 > > --------------------- > [1] - reproducible locally, but can be also seen in the CI: > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fintel-gfx-ci.01.org%2Ftree%2Fdrm-tip%2Findex.html%3Ftestfilter%3Digt%40sw_sync&data=05%7C01%7Cchristian.koenig%40amd.com%7C2af59c808f664f0cf04908da6321e708%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637931294507736831%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=NTI04OpP7kMsCu%2BDWsJ0%2FRIVJGJbxy36tJBImD2MQDU%3D&reserved=0 >
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://gitlab.freedesktop.org/drm/igt-gpu-tools 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. Many thanks, Karolina ------------------ [1] - https://gitlab.freedesktop.org/drm/igt-gpu-tools#building > 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 >>
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. 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 >>>
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 >>>> >
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