From: "Christian König" <deathsimple@vodafone.de>
To: Jerome Glisse <j.glisse@gmail.com>
Cc: Jerome Glisse <jglisse@redhat.com>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/radeon: add an exclusive lock for GPU reset
Date: Mon, 02 Jul 2012 19:05:51 +0200 [thread overview]
Message-ID: <4FF1D4EF.3040806@vodafone.de> (raw)
In-Reply-To: <CAH3drwa9f70aAhTqvo=+G0jv8tOyCuGoesoBQARi5jWAjSwJ1A@mail.gmail.com>
On 02.07.2012 18:41, Jerome Glisse wrote:
> On Mon, Jul 2, 2012 at 12:26 PM, Christian König
> <deathsimple@vodafone.de> wrote:
>> On 02.07.2012 17:39, j.glisse@gmail.com wrote:
>>> From: Jerome Glisse <jglisse@redhat.com>
>>>
>>> GPU reset need to be exclusive, one happening at a time. For this
>>> add a rw semaphore so that any path that trigger GPU activities
>>> have to take the semaphore as a reader thus allowing concurency.
>>>
>>> The GPU reset path take the semaphore as a writer ensuring that
>>> no concurrent reset take place.
>>>
>>> Signed-off-by: Jerome Glisse <jglisse@redhat.com>
>> NAK, that isn't as bad as the cs mutex was but still to complicated. It's
>> just too far up in the call stack, e.g. it tries to catch ioctl operations,
>> instead of catching the underlying hardware operation which is caused by the
>> ioctl/ttm/etc...
>>
>> Why not just take the ring look as I suggested?
>>
>>
> No we can't use ring lock, we need to protect suspend/resume path and
> we need an exclusive lock for that so we need a reset mutex at the
> very least. But instead of having a reset mutex i prefer using a rw
> lock so that we can stop ioctl until a reset goes through an let
> pending ioctl take proper action. Think about multiple context trying
> to reset GPU ...
>
> Really this is the best option, the rw locking wont induce any lock
> contention execept in gpu reset case which is anyway bad news.
Why? That makes no sense to me. Well I don't want to prevent lock
contention, but understand why we should add locking at the ioctl level.
That violates locking rule number one "lock data instead of code" (or in
our case "lock hardware access instead of code path") and it really is
the reason why we ended up with the cs_mutex protecting practically
everything.
Multiple context trying to reset the GPU should be pretty fine, current
it would just reset the GPU twice, but in the future asic_reset should
be much more fine grained and only reset the parts of the GPU which
really needs an reset.
Cheers,
Christian.
next prev parent reply other threads:[~2012-07-02 17:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-02 15:39 [PATCH] drm/radeon: add an exclusive lock for GPU reset j.glisse
2012-07-02 16:20 ` Jerome Glisse
2012-07-02 16:26 ` Christian König
2012-07-02 16:41 ` Jerome Glisse
2012-07-02 17:05 ` Christian König [this message]
2012-07-02 17:27 ` Jerome Glisse
2012-07-03 9:26 ` Christian König
2012-07-03 14:09 ` Jerome Glisse
2012-07-03 14:52 ` Christian König
2012-07-03 15:15 ` Jerome Glisse
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=4FF1D4EF.3040806@vodafone.de \
--to=deathsimple@vodafone.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=j.glisse@gmail.com \
--cc=jglisse@redhat.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.