All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Hellstrom <thellstrom@vmware.com>
To: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org,
	ccross@google.com, linux-media@vger.kernel.org
Subject: Re: [PATCH 2/2] [RFC] reservation: add suppport for read-only access using rcu
Date: Thu, 10 Apr 2014 13:25:23 +0200	[thread overview]
Message-ID: <53467FA3.5040805@vmware.com> (raw)
In-Reply-To: <53467B93.3000402@vmware.com>

On 04/10/2014 01:08 PM, Thomas Hellstrom wrote:
> On 04/10/2014 12:07 PM, Maarten Lankhorst wrote:
>> Hey,
>>
>> op 10-04-14 10:46, Thomas Hellstrom schreef:
>>> Hi!
>>>
>>> Ugh. This became more complicated than I thought, but I'm OK with moving
>>> TTM over to fence while we sort out
>>> how / if we're going to use this.
>>>
>>> While reviewing, it struck me that this is kind of error-prone, and hard
>>> to follow since we're operating on a structure that may be
>>> continually updated under us, needing a lot of RCU-specific macros and
>>> barriers.
>> Yeah, but with the exception of dma_buf_poll I don't think there is
>> anything else
>> outside drivers/base/reservation.c has to deal with rcu.
>>
>>> Also the rcu wait appears to not complete until there are no busy fences
>>> left (new ones can be added while we wait) rather than
>>> waiting on a snapshot of busy fences.
>> This has been by design, because 'wait for bo idle' type of functions
>> only care
>> if the bo is completely idle or not.
> No, not when using RCU, because the bo may be busy again before the
> function returns :)
> Complete idleness can only be guaranteed if holding the reservation, or
> otherwise making sure
> that no new rendering is submitted to the buffer, so it's an overkill to
> wait for complete idleness here.
>
Although, if we fail to get a refcount for a fence, and it's still busy
we need to do  a seq retry,
because the fence might have been replaced by another fence from the
same context, without being idle. That check is not present in the
snapshot code I sent.

/Thomas

WARNING: multiple messages have this Message-ID (diff)
From: Thomas Hellstrom <thellstrom@vmware.com>
To: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org,
	ccross@google.com, linux-media@vger.kernel.org
Subject: Re: [PATCH 2/2] [RFC] reservation: add suppport for read-only access using rcu
Date: Thu, 10 Apr 2014 13:25:23 +0200	[thread overview]
Message-ID: <53467FA3.5040805@vmware.com> (raw)
Message-ID: <20140410112523.6us_ibjfIt0IQ5Wx86y-N2XmDtzDmHyLkdg43VNGBUE@z> (raw)
In-Reply-To: <53467B93.3000402@vmware.com>

On 04/10/2014 01:08 PM, Thomas Hellstrom wrote:
> On 04/10/2014 12:07 PM, Maarten Lankhorst wrote:
>> Hey,
>>
>> op 10-04-14 10:46, Thomas Hellstrom schreef:
>>> Hi!
>>>
>>> Ugh. This became more complicated than I thought, but I'm OK with moving
>>> TTM over to fence while we sort out
>>> how / if we're going to use this.
>>>
>>> While reviewing, it struck me that this is kind of error-prone, and hard
>>> to follow since we're operating on a structure that may be
>>> continually updated under us, needing a lot of RCU-specific macros and
>>> barriers.
>> Yeah, but with the exception of dma_buf_poll I don't think there is
>> anything else
>> outside drivers/base/reservation.c has to deal with rcu.
>>
>>> Also the rcu wait appears to not complete until there are no busy fences
>>> left (new ones can be added while we wait) rather than
>>> waiting on a snapshot of busy fences.
>> This has been by design, because 'wait for bo idle' type of functions
>> only care
>> if the bo is completely idle or not.
> No, not when using RCU, because the bo may be busy again before the
> function returns :)
> Complete idleness can only be guaranteed if holding the reservation, or
> otherwise making sure
> that no new rendering is submitted to the buffer, so it's an overkill to
> wait for complete idleness here.
>
Although, if we fail to get a refcount for a fence, and it's still busy
we need to do  a seq retry,
because the fence might have been replaced by another fence from the
same context, without being idle. That check is not present in the
snapshot code I sent.

/Thomas

  reply	other threads:[~2014-04-10 11:25 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-09 14:48 [PATCH 0/2] Updates to fence api Maarten Lankhorst
2014-04-09 14:48 ` Maarten Lankhorst
2014-04-09 14:48 ` [PATCH 1/2] reservation: update api and add some helpers Maarten Lankhorst
2014-04-09 14:48   ` Maarten Lankhorst
2014-04-09 14:49 ` [PATCH 2/2] [RFC] reservation: add suppport for read-only access using rcu Maarten Lankhorst
2014-04-09 14:49   ` Maarten Lankhorst
2014-04-10  8:46   ` Thomas Hellstrom
2014-04-10  8:46     ` Thomas Hellstrom
2014-04-10 10:07     ` Maarten Lankhorst
2014-04-10 10:07       ` Maarten Lankhorst
2014-04-10 11:08       ` Thomas Hellstrom
2014-04-10 11:25         ` Thomas Hellstrom [this message]
2014-04-10 11:25           ` Thomas Hellstrom
2014-04-10 15:00         ` [PATCH 2/2] [RFC v2 with seqcount] " Maarten Lankhorst
2014-04-10 15:00           ` Maarten Lankhorst
2014-04-11  8:38           ` Thomas Hellstrom
2014-04-11  8:38             ` Thomas Hellstrom
2014-04-11  9:24             ` Maarten Lankhorst
2014-04-11 10:11               ` Thomas Hellstrom
2014-04-11 18:09                 ` Maarten Lankhorst
2014-04-11 19:30                   ` Thomas Hellstrom
2014-04-14  7:04                     ` Maarten Lankhorst
2014-04-11 19:35                   ` Thomas Hellstrom
2014-04-11 19:35                     ` Thomas Hellstrom
2014-04-14  7:42                     ` Maarten Lankhorst
2014-04-14  7:45                       ` Thomas Hellstrom
2014-04-23 11:15                         ` [RFC PATCH 2/2 with seqcount v3] " Maarten Lankhorst
2014-04-29 14:32                           ` Maarten Lankhorst
2014-04-29 18:55                             ` Thomas Hellstrom
2014-05-19 13:42                           ` Thomas Hellstrom
2014-05-19 14:13                             ` Maarten Lankhorst
2014-05-19 14:43                               ` Thomas Hellstrom
2014-05-20 15:13                               ` Thomas Hellstrom
2014-05-20 15:32                                 ` Maarten Lankhorst

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=53467FA3.5040805@vmware.com \
    --to=thellstrom@vmware.com \
    --cc=ccross@google.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=maarten.lankhorst@canonical.com \
    /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.