mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx@gmail.com>
To: Mikko Perttunen <cyndis@kapsi.fi>,
	Mikko Perttunen <mperttunen@nvidia.com>,
	thierry.reding@gmail.com, jonathanh@nvidia.com
Cc: dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 10/10] gpu: host1x: Optionally block when acquiring channel
Date: Wed, 29 Nov 2017 15:37:51 +0300	[thread overview]
Message-ID: <b561b86b-fbf5-8ea1-0145-a027fc284363@gmail.com> (raw)
In-Reply-To: <a4adb6ac-b72e-3f9b-fc6c-2a56bc6537ce@kapsi.fi>

On 29.11.2017 15:25, Mikko Perttunen wrote:
> On 29.11.2017 14:18, Dmitry Osipenko wrote:
>> On 29.11.2017 12:10, Mikko Perttunen wrote:
>>> On 12.11.2017 13:23, Dmitry Osipenko wrote:
>>>> On 11.11.2017 00:15, Dmitry Osipenko wrote:
>>>>> On 07.11.2017 18:29, Dmitry Osipenko wrote:
>>>>>> On 07.11.2017 16:11, Mikko Perttunen wrote:
>>>>>>> On 05.11.2017 19:14, Dmitry Osipenko wrote:
>>>>>>>> On 05.11.2017 14:01, Mikko Perttunen wrote:
>>>>>>>>> Add an option to host1x_channel_request to interruptibly wait for a
>>>>>>>>> free channel. This allows IOCTLs that acquire a channel to block
>>>>>>>>> the userspace.
>>>>>>>>>
>>>>>>>>
>>>>>>>> Wouldn't it be more optimal to request channel and block after job's
>>>>>>>> pining,
>>>>>>>> when all patching and checks are completed? Note that right now we have
>>>>>>>> locking
>>>>>>>> around submission in DRM, which I suppose should go away by making locking
>>>>>>>> fine
>>>>>>>> grained.
>>>>>>>
>>>>>>> That would be possible, but I don't think it should matter much since
>>>>>>> contention
>>>>>>> here should not be the common case.
>>>>>>>
>>>>>>>>
>>>>>>>> Or maybe it would be more optimal to just iterate over channels, like I
>>>>>>>> suggested before [0]?
>>>>>>>
>>>>>>> Somehow I hadn't noticed this before, but this would break the invariant of
>>>>>>> having one client/class per channel.
>>>>>>>
>>>>>>
>>>>>> Yes, currently there is a weak relation of channel and clients device, but
>>>>>> seems
>>>>>> channels device is only used for printing dev_* messages and device could be
>>>>>> borrowed from the channels job. I don't see any real point of hardwiring
>>>>>> channel
>>>>>> to a specific device or client.
>>>>>
>>>>> Although, it won't work with syncpoint assignment to channel.
>>>>
>>>> On the other hand.. it should work if one syncpoint could be assigned to
>>>> multiple channels, couldn't it?
>>>
>>> A syncpoint can only be mapped to a single channel, so unfortunately this won't
>>> work.
>> Okay, in DRM we are requesting syncpoint on channels 'open' and syncpoint
>> assignment happens on jobs submission. So firstly submitted job will assign
>> syncpoint to the first channel and second job would re-assign syncpoint to a
>> second channel while first job is still in-progress, how is it going to work?
>>
> 
> When a context is created, it's assigned both a syncpoint and channel and this
> pair stays for as long as the context is alive (i.e. as long as there are jobs),
> so even if the syncpoint is reassigned to a channel at every submit, it is
> always assigned to the same channel, so nothing breaks. Multiple contexts cannot
> share syncpoints so things work out.
> 
> Obviously this is not ideal as we currently never unassign syncpoints but at
> least it is not broken.

Right, I forgot that you made tegra_drm_context_get_channel() to re-use
requested channel if there are pending jobs.

  reply	other threads:[~2017-11-29 12:37 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-05 11:01 [PATCH 00/10] Dynamic Host1x channel allocation Mikko Perttunen
2017-11-05 11:01 ` [PATCH 01/10] gpu: host1x: Parameterize channel aperture size Mikko Perttunen
2017-11-05 11:01 ` [PATCH 02/10] gpu: host1x: Print MLOCK state in debug dumps on T186 Mikko Perttunen
2017-11-05 11:01 ` [PATCH 03/10] gpu: host1x: Add lock around channel allocation Mikko Perttunen
2017-11-05 11:01 ` [PATCH 04/10] gpu: host1x: Lock classes during job submission Mikko Perttunen
2017-11-05 16:46   ` Dmitry Osipenko
2017-11-07 12:28     ` Mikko Perttunen
2017-11-07 21:23       ` Dmitry Osipenko
2017-12-05 13:21         ` Mikko Perttunen
2017-12-05 13:43           ` Dmitry Osipenko
2017-11-05 11:01 ` [PATCH 05/10] gpu: host1x: Add job done callback Mikko Perttunen
2017-11-05 11:01 ` [PATCH 06/10] drm/tegra: Deliver job completion callback to client Mikko Perttunen
2017-11-16 16:33   ` Dmitry Osipenko
2017-11-16 16:40   ` Dmitry Osipenko
2017-11-29  9:09     ` Mikko Perttunen
2017-11-05 11:01 ` [PATCH 07/10] drm/tegra: Make syncpoints be per-context Mikko Perttunen
2017-11-05 11:01 ` [PATCH 08/10] drm/tegra: Implement dynamic channel allocation model Mikko Perttunen
2017-11-05 17:43   ` Dmitry Osipenko
2017-11-07 12:29     ` Mikko Perttunen
2017-11-13 11:49       ` Dmitry Osipenko
2017-11-05 11:01 ` [PATCH 09/10] drm/tegra: Boot VIC in runtime resume Mikko Perttunen
2017-11-05 11:01 ` [PATCH 10/10] gpu: host1x: Optionally block when acquiring channel Mikko Perttunen
2017-11-05 17:14   ` Dmitry Osipenko
2017-11-07 13:11     ` Mikko Perttunen
2017-11-07 15:29       ` Dmitry Osipenko
2017-11-10 21:15         ` Dmitry Osipenko
2017-11-12 11:23           ` Dmitry Osipenko
2017-11-29  9:10             ` Mikko Perttunen
2017-11-29 12:18               ` Dmitry Osipenko
2017-11-29 12:25                 ` Mikko Perttunen
2017-11-29 12:37                   ` Dmitry Osipenko [this message]
2017-11-07 15:34 ` [PATCH 00/10] Dynamic Host1x channel allocation Dmitry Osipenko

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=b561b86b-fbf5-8ea1-0145-a027fc284363@gmail.com \
    --to=digetx@gmail.com \
    --cc=cyndis@kapsi.fi \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mperttunen@nvidia.com \
    --cc=thierry.reding@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®