Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Koenig, Christian" <Christian.Koenig@amd.com>
To: "Chris Wilson" <chris@chris-wilson.co.uk>,
	"Christian König" <ckoenig.leichtzumerken@gmail.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"linaro-mm-sig@lists.linaro.org" <linaro-mm-sig@lists.linaro.org>
Subject: Re: [PATCH 8/8] dma-buf: nuke reservation_object seq number
Date: Wed, 7 Aug 2019 13:05:08 +0000	[thread overview]
Message-ID: <be4c4454-4672-65d5-073b-b399aa43338c@amd.com> (raw)
In-Reply-To: <156518035127.6198.2346142882693144294@skylake-alporthouse-com>

Am 07.08.19 um 14:19 schrieb Chris Wilson:
> Quoting Christian König (2019-08-07 13:08:38)
>> Am 06.08.19 um 21:57 schrieb Chris Wilson:
>>> If we add to shared-list during the read, ... Hmm, actually we should
>>> return num_list, i.e.
>>>
>>> do {
>>>        *list = rcu_dereference(obj->fence);
>>>        num_list = *list ? (*list)->count : 0;
>>>        smp_rmb();
>>> } while (...)
>>>
>>> return num_list.
>>>
>>> as the relationship between the count and the fence entries is also
>>> determined by the mb in add_shared_fence.
>> I've read that multiple times now, but can't follow. Why should we do this?
>>
>> The only important thing is that the readers see the new fence before
>> the increment of the number of fences.
> Exactly. We order the store so that the fence is in the list before we
> update the count (so that we don't read garbage because the fence isn't
> there yet).
>
> But we don't have the equivalent here for the read once the rmb is
> removed from the seqcount_read_begin/end looping. We need to see the
> update in the same order as was stored, and only use the coherent
> portion of the list.

Ok that makes sense. Going to fix up the code regarding to that.

Christian.

> -Chris

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-08-07 13:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-06 15:01 [PATCH 1/8] dma-buf: fix busy wait for new shared fences Christian König
2019-08-06 15:01 ` [PATCH 2/8] dma-buf: fix shared fence list handling in reservation_object_copy_fences Christian König
2019-08-06 19:06   ` Chris Wilson
2019-08-07 10:43     ` Christian König
2019-08-06 15:01 ` [PATCH 3/8] drm/i915: stop using seqcount for fenc pruning Christian König
2019-08-06 19:07   ` Chris Wilson
2019-08-06 15:01 ` [PATCH 4/8] drm/i915: use new reservation_object_fences helper Christian König
2019-08-06 19:09   ` Chris Wilson
2019-08-06 15:01 ` [PATCH 5/8] dma-buf: further relax reservation_object_add_shared_fence Christian König
2019-08-06 19:25   ` Chris Wilson
2019-08-06 15:01 ` [PATCH 6/8] dma-buf: simplify reservation_object_get_fences_rcu a bit Christian König
2019-08-06 19:11   ` Chris Wilson
2019-08-06 15:01 ` [PATCH 7/8] dma-buf: add reservation_object_fences helper Christian König
2019-08-06 19:24   ` Chris Wilson
2019-08-07  9:06     ` Christian König
2019-08-06 15:01 ` [PATCH 8/8] dma-buf: nuke reservation_object seq number Christian König
2019-08-06 19:57   ` Chris Wilson
2019-08-07 12:08     ` Christian König
2019-08-07 12:19       ` Chris Wilson
2019-08-07 13:05         ` Koenig, Christian [this message]
2019-08-06 18:57 ` [PATCH 1/8] dma-buf: fix busy wait for new shared fences Chris Wilson
2019-08-09 13:27 ` ✗ Fi.CI.BAT: failure for series starting with [1/8] " Patchwork

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=be4c4454-4672-65d5-073b-b399aa43338c@amd.com \
    --to=christian.koenig@amd.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=ckoenig.leichtzumerken@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linaro-mm-sig@lists.linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox