All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lis, Tomasz" <tomasz.lis@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: bartosz.dunajski@intel.com
Subject: Re: [PATCH v4] drm/i915: Add IOCTL Param to control data port coherency.
Date: Tue, 10 Jul 2018 19:32:57 +0200	[thread overview]
Message-ID: <d340a03e-306a-4025-4801-ebdd1d06b7a4@intel.com> (raw)
In-Reply-To: <153115427821.18500.7997035424553017609@cwilso3-mobl.ger.corp.intel.com>


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



On 2018-07-09 18:37, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2018-07-09 17:28:02)
>> On 09/07/2018 14:20, Tomasz Lis wrote:
>>> +static int i915_gem_context_clear_data_port_coherent(struct i915_gem_context *ctx)
>>> +{
>>> +     int ret;
>>> +
>>> +     ret = intel_lr_context_modify_data_port_coherency(ctx, false);
>>> +     if (!ret)
>>> +             __clear_bit(CONTEXT_DATA_PORT_COHERENT, &ctx->flags);
>>> +     return ret;
>> Is there a good reason you allow userspace to keep emitting unlimited
>> number of commands which actually do not change the status? If not
>> please consider gating the command emission with
>> test_and_set_bit/test_and_clear_bit. Hm.. apart even with that they
>> could keep toggling ad infinitum with no real work in between. Has it
>> been considered to only save the desired state in set param and then
>> emit it, if needed, before next execbuf? Minor thing in any case, just
>> curious since I wasn't following the threads.
> The first patch tried to add a bit to execbuf, and having been
> mistakenly down that road before, we asked if there was any alternative.
> (Now if you've also been following execbuf3 conversations, having a
> packet for privileged LRI is definitely something we want.)
>
> Setting the value in the context register is precisely what we want to
> do, and trivially serialised with execbuf since we have to serialise
> reservation of ring space, i.e. the normal rules of request generation.
> (execbuf is just a client and nothing special). From that point of view,
> we only care about frequency, if it is very frequent it should be
> controlled by userspace inside the batch (but it can't due to there
> being dangerous bits inside the reg aiui). At the other end of the
> scale, is context_setparam for set-once. And there should be no
> inbetween as that requires costly batch flushes.
> -Chris
Joonas did brought that concern in his review; here it is, with my response:

On 2018-06-21 15:47, Lis, Tomasz wrote:
> On 2018-06-21 08:39, Joonas Lahtinen wrote:
>> I'm thinking we should set this value when it has changed, when we 
>> insert the
>> requests into the command stream. So if you change back and forth, while
>> not emitting any requests, nothing really happens. If you change the 
>> value and
>> emit a request, we should emit a LRI before the jump to the commands.
>> Similary if you keep setting the value to the value it already was in,
>> nothing will happen, again.
> When I considered that, my way of reasoning was:
> If we execute the flag changing buffer right away, it may be sent to 
> hardware faster if there is no job in progress.
> If we use the lazy way, and trigger the change just before submission 
> -  there will be additional conditions in submission code, plus the 
> change will be made when there is another job pending (though it's not 
> a considerable payload to just switch a flag).
> If user space switches the flag back and forth without much sense, 
> then there is something wrong with the user space driver, and it 
> shouldn't be up to kernel to fix that.
>
> This is why I chosen the current approach. But I can change it if you 
> wish.

So while I think the current solution is better from performance 
standpoint, but I will change it if you request that.
-Tomasz


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

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

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

  reply	other threads:[~2018-07-10 17:36 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-19 12:37 [RFC v1] Data port coherency control for UMDs Tomasz Lis
2018-03-19 12:37 ` [RFC v1] drm/i915: Add Exec param to control data port coherency Tomasz Lis
2018-03-19 12:43   ` Chris Wilson
2018-03-19 14:14     ` Lis, Tomasz
2018-03-19 14:26       ` Chris Wilson
2018-03-20 17:23         ` Lis, Tomasz
2018-05-04  9:24           ` Joonas Lahtinen
2018-03-20 18:43       ` Oscar Mateo
2018-03-21 10:16         ` Chris Wilson
2018-03-21 19:42           ` Oscar Mateo
2018-03-27 17:41             ` Lis, Tomasz
2018-03-30 17:29   ` [PATCH " Tomasz Lis
2018-03-31 19:07     ` kbuild test robot
2018-04-11 15:46   ` [PATCH v2] " Tomasz Lis
2018-06-20 15:03   ` [PATCH v1] Second implementation of Data Port Coherency Tomasz Lis
2018-06-20 15:03     ` [PATCH v1] drm/i915: Add IOCTL Param to control data port coherency Tomasz Lis
2018-06-21  6:39       ` Joonas Lahtinen
2018-06-21 13:47         ` Lis, Tomasz
2018-07-18 13:03           ` Joonas Lahtinen
2018-06-21  7:05       ` Chris Wilson
2018-06-21 13:47         ` Lis, Tomasz
2018-06-21  7:31       ` Dunajski, Bartosz
2018-06-21  8:48         ` Joonas Lahtinen
2018-06-22 16:40           ` Dunajski, Bartosz
2018-07-18 13:12             ` Joonas Lahtinen
2018-07-18 13:27               ` Dunajski, Bartosz
2018-07-09 13:20   ` [PATCH v4] " Tomasz Lis
2018-07-09 13:48     ` Lionel Landwerlin
2018-07-09 14:03       ` Lis, Tomasz
2018-07-09 14:24         ` Lionel Landwerlin
2018-07-09 15:21           ` Lis, Tomasz
2018-07-09 16:28     ` Tvrtko Ursulin
2018-07-09 16:37       ` Chris Wilson
2018-07-10 17:32         ` Lis, Tomasz [this message]
2018-07-11  9:28           ` Tvrtko Ursulin
2018-07-10 18:03       ` Lis, Tomasz
2018-07-11 11:20         ` Lis, Tomasz
2018-07-12 15:10   ` [PATCH v5] " Tomasz Lis
2018-07-13 10:40     ` Tvrtko Ursulin
2018-07-13 17:44       ` Lis, Tomasz
2018-10-09 18:06   ` [PATCH v6] " Tomasz Lis
2018-10-10  7:29     ` Tvrtko Ursulin
2018-10-12 15:02   ` [PATCH v8] " Tomasz Lis
2018-10-15 12:52     ` Tvrtko Ursulin
2018-10-16 13:59     ` Joonas Lahtinen
2018-03-19 13:53 ` [RFC v1] Data port coherency control for UMDs Joonas Lahtinen
2018-03-19 16:09   ` Lis, Tomasz
2018-03-20 15:15   ` Dunajski, Bartosz
2018-03-21 10:02     ` Joonas Lahtinen
2018-03-26  9:46       ` Dunajski, Bartosz
2018-03-29  7:42         ` Joonas Lahtinen
2018-03-30  9:00           ` Dunajski, Bartosz
2018-04-04  9:18             ` Joonas Lahtinen
2018-04-11  9:15               ` Dunajski, Bartosz
2018-03-19 14:18 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Add Exec param to control data port coherency Patchwork
2018-03-19 14:34 ` ✓ Fi.CI.BAT: success " Patchwork
2018-03-19 16:48 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-03-30 18:14 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Add Exec param to control data port coherency. (rev2) Patchwork
2018-03-30 18:30 ` ✓ Fi.CI.BAT: success " Patchwork
2018-03-30 19:59 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-04-11 16:12 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Add Exec param to control data port coherency. (rev3) Patchwork
2018-04-11 16:29 ` ✓ Fi.CI.BAT: success " Patchwork
2018-04-11 20:02 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-06-20 15:45 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Add Exec param to control data port coherency. (rev4) Patchwork
2018-06-20 16:00 ` ✓ Fi.CI.BAT: success " Patchwork
2018-06-20 21:01 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-07-09 13:57 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Add Exec param to control data port coherency. (rev5) Patchwork
2018-07-09 13:58 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-07-09 14:14 ` ✓ Fi.CI.BAT: success " Patchwork
2018-07-09 20:04 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-07-12 15:18 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Add Exec param to control data port coherency. (rev6) Patchwork
2018-07-12 15:19 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-07-12 15:34 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-09 18:27 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Add Exec param to control data port coherency. (rev7) Patchwork
2018-10-09 18:28 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-10-09 18:52 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-09 21:44 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-10-12 15:14 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Add Exec param to control data port coherency. (rev8) Patchwork
2018-10-12 15:15 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-10-12 15:34 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-12 18:27 ` ✗ Fi.CI.IGT: failure " 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=d340a03e-306a-4025-4801-ebdd1d06b7a4@intel.com \
    --to=tomasz.lis@intel.com \
    --cc=bartosz.dunajski@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tvrtko.ursulin@linux.intel.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.