All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chunming Zhou <zhoucm1@amd.com>
To: "Koenig, Christian" <Christian.Koenig@amd.com>,
	"Zhou, David(ChunMing)" <David1.Zhou@amd.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Cc: "daniel.vetter@ffwll.ch" <daniel.vetter@ffwll.ch>
Subject: Re: [PATCH 7/7] drm/syncobj: use the timeline point in drm_syncobj_find_fence
Date: Sat, 24 Nov 2018 08:28:59 +0000	[thread overview]
Message-ID: <c602becd-8c65-bdff-119b-41bce93964e3@amd.com> (raw)
In-Reply-To: <ec405d48-cde7-907c-1eec-df4ac4e3a1e5@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 4385 bytes --]



在 2018/11/24 2:16, Christian König 写道:
Am 23.11.18 um 14:42 schrieb Chunming Zhou:


But I've came up with something which should work. Assume the original
chain is:

1----3----6----9----12---18

And we garbage collect everything but 6 and 18 then all we need to know
to return the correct node is what the original previous sequence number
was.

6 (3)----18 (12)

When then somebody asks for 17 we can still return 18 and if somebody
asks for 9 we would return 6.

then what point we return when somebody asks for 11?

In this case 6. If 9 or 12 wouldn't be signaled yet than those.



Another use case, I'm not sure if you considered:
if chain is  1----3----6----9----12---18, a wait operation is on point
17, then we return 18, another signal point 17 comes, then we still wait
on 18(assume 18 takes very long time), that looks not reseonable, but
this is just performance problem potientially. Seems the way of timeline
sw_sync.c with comparing point for signal status can sovle it.


Well I thought that we declared that signaling lower numbers is illegal?

Sorry, I forgot it, quote from spec: "
*RESOLVED*: A 64-bit unsigned integer that can only be set to monotonically
increasing values by signal operations and is not changed by wait operations."

Can we think signaling lower numbers is forbidden?

If that's true, we can directly ignore lower number and return without error, keep the larger signal point.

I've considered this as well, but came to the conclusion that we then would lose some sync fence.

Starting a new sequence when userspace does that is the better alternative, cause then we again always sync to much but never to less.
But that will lead timeline not monotonically increasing, won't it? Seems it's not good.
Which could result in some problems, e.g. if timeline is already up to 18, then userA think he can wait on 18, another signal point17 comes, the new sequence is changed to 17, but userA still send its command by appending wait on point18, which would never be signaled if no more signal comes, right?

-David

Christian.


Thanks,
David

My current solution to that is when userspace messes up the sequence
numbers and submit 1-3-6-9-12-18-17 we start a new chain with 17 and
never look back.

E.g. when somebody then asks for anything below 17 we always return 17
and if somebody asks for 18 we return an error because that is handled
as not signaled yet.

Regards,
Christian.



-David



Thanks,
Christian.



Regards,
Christian.



You can also check sw_sync.c for timeline meaning.

-David


Christian.



-David


b. garbage collection happens on point6, chain would be updated to
1---3---9---12---18---20, if user wants to get point5, then we
should return node 3, but if user wants to get point 7, then we
should return node 9.


Why? That doesn't seem to make any sense to me.



I still have no idea how to satisfy all these requirements with your
current chain-fence. All these logic just are same we encountered
before, we're walking them again. After solving these problems, I
guess all design is similar as before.

In fact, I don't know what problem previous design has, maybe there
are some bugs, can't we fix these bugs by time going? Who can make
sure his implementation never have bugs?


Well there where numerous problems with the original design. For
example we need to reject the requirement that timeline fences are in
order because that doesn't make sense in the kernel.

When userspace does something like submitting fences in the order 1,
5, 3 then it is broken and can keep the pieces. In other words the
kernel should not care about that, but rather make sure that it never
looses any synchronization no matter what.

Regards,
Christian.



-David


+        }
         }
+
         drm_syncobj_put(syncobj);
         return ret;
     }


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org<mailto:dri-devel@lists.freedesktop.org>
https://lists.freedesktop.org/mailman/listinfo/dri-devel





_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org<mailto:dri-devel@lists.freedesktop.org>
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[-- Attachment #1.2: Type: text/html, Size: 6998 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2018-11-24  8:29 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-15 11:12 restart syncobj timeline changes Christian König
2018-11-15 11:12 ` [PATCH 1/7] dma-buf: make fence sequence numbers 64 bit Christian König
2018-11-16  5:26   ` Zhou, David(ChunMing)
2018-11-15 11:12 ` [PATCH 2/7] dma-buf: add new dma_fence_chain container Christian König
2018-11-16  5:51   ` Zhou, David(ChunMing)
2018-11-15 11:12 ` [PATCH 3/7] drm: revert "expand replace_fence to support timeline point v2" Christian König
2018-11-15 11:12 ` [PATCH 4/7] drm/syncobj: use only a single stub fence Christian König
2018-11-16  5:54   ` Zhou, David(ChunMing)
2018-11-15 11:12 ` [PATCH 5/7] drm/syncobj: move drm_syncobj_cb into drm_syncobj.c Christian König
2018-11-16  5:55   ` Zhou, David(ChunMing)
2018-11-15 11:12 ` [PATCH 6/7] drm/syncobj: add new drm_syncobj_add_point interface Christian König
2018-11-16  6:20   ` Zhou, David(ChunMing)
2018-11-15 11:12 ` [PATCH 7/7] drm/syncobj: use the timeline point in drm_syncobj_find_fence Christian König
2018-11-22  6:52   ` zhoucm1
2018-11-22 11:30     ` Christian König
2018-11-23  2:36       ` zhoucm1
2018-11-23 10:10         ` Koenig, Christian
2018-11-23 10:56           ` zhoucm1
2018-11-23 11:03             ` Christian König
2018-11-23 12:02               ` Koenig, Christian
2018-11-23 12:26                 ` Daniel Vetter
2018-11-23 12:40                   ` Christian König
2018-11-27  7:53                     ` Daniel Vetter
2018-11-23 13:15                 ` Chunming Zhou
2018-11-23 13:27                   ` Koenig, Christian
2018-11-23 13:42                     ` Chunming Zhou
2018-11-23 18:16                       ` Christian König
2018-11-24  8:28                         ` Chunming Zhou [this message]

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=c602becd-8c65-bdff-119b-41bce93964e3@amd.com \
    --to=zhoucm1@amd.com \
    --cc=Christian.Koenig@amd.com \
    --cc=David1.Zhou@amd.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.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: link
Be 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.