From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Remove temporary allocation of dma addresses when rotating
Date: Wed, 15 Nov 2017 09:18:00 +0000 [thread overview]
Message-ID: <bb153292-36ae-d0ff-4647-db35f9ba018c@linux.intel.com> (raw)
In-Reply-To: <151068326504.23340.18057144852354142584@mail.alporthouse.com>
On 14/11/2017 18:14, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2017-02-27 14:31:17)
>>
>> On 27/02/2017 10:21, Chris Wilson wrote:
>>> On Mon, Feb 27, 2017 at 10:14:12AM +0000, Tvrtko Ursulin wrote:
>>>>
>>>> On 27/02/2017 10:06, Chris Wilson wrote:
>>>>> On Mon, Feb 27, 2017 at 09:55:10AM +0000, Tvrtko Ursulin wrote:
>>>>>>
>>>>>> On 22/02/2017 08:44, Chris Wilson wrote:
>>>>>>> I also think that's an argument for improving the general cache rather
>>>>>>> than arguing against using it.
>>>>>>
>>>>>> Well I wasn't concerned about the cache per se, but about whether it
>>>>>> is completely appropriate (best choice) to use it in this particular
>>>>>> case.
>>>>>>
>>>>>> Because as I said before, for 1920x1080x32 we are talking about a
>>>>>> 16KiB extremely short lived temporary allocation, vs the similar
>>>>>> size for the sg radix cache. But radix cache sticks around the the
>>>>>> lifetime of obj->mm.pages and it wouldn't otherwise be there since
>>>>>> AFAICS in practice no one really touches frame buffers in a way to
>>>>>> trigger its creation.
>>>>>>
>>>>>> Those amounts of memory are not a concern, but again, is the
>>>>>> simplification of the code worth the conceptual downsides mentioned
>>>>>> above? Even if we considered 4K frame buffers, when both allocations
>>>>>> go to ~64KiB, would that change anything? I am not sure, probably
>>>>>> not for me.
>>>>>>
>>>>>> So I am still unsure that we should go with this change.
>>>>>
>>>>> Again, the complaint you have here are general concerns about caching
>>>>> the mapping. Avoiding using the cache instead of improving the cache
>>>>> seems the wrong approach.
>>>>
>>>> Depends what kind of improvments to the cache you have in mind. If
>>>> you are thinking about size then I disagree, I think it is efficient
>>>> enough already. But if you are thinking about the lifetime
>>>> management then it is obvious from all that I have written so far
>>>> that I would agree with that. Since the core of my "complaint" is
>>>> the lifetime mismatch, and not the size.
>>>>
>>>> For lifetime I am not sure what you could do. Exposing the size of
>>>> it, with maybe some other bits attached the the object, to the
>>>> shrinker I think doesn't make much sense since the sizes are so
>>>> small compared to the backing store sizes.
>>>>
>>>> Perhaps you could add an explicit reset of the cache after the
>>>> rotation is done with it, but then the only remaining benefit will
>>>> be avoiding greater than zero order allocations. I say the only
>>>> one.. it would still be a good one. Just have no idea if this level
>>>> of cache usage would satisfy you!
>>>>
>>>> Perhaps you could say what kind of optimisation you have in mind to
>>>> save me guessing? :)
>>>
>>> I was thinking you would like an inactivity timer. Or we could have a
>>> separate shrinker, as that's the principal cache management system.
>>
>> I thought about the shrinker myself. Even wrote some code to more
>> accurately size the objects as part of the existing passes. But as I
>> said the contribution of anything object and not backing store is so
>> small that, even though it would conceptually be more correct and
>> perhaps avoid some marginal over-shrinking, I am not sure it is worth
>> doing it. Assuming of course that I got the sizing of the radix tree
>> correct! I just hacked something up based on some debug dumping code
>> from radix-tree.c.
>>
>> So the complication is there is no API to get the size of the radix tree
>> (or the scatter list table) and we would have to add something, either
>> internally to i915, or try and upstream it.
>>
>> Or we avoid that with your timer idea and just purge all caches which
>> haven't been used in a while. Maybe from idle work or something.
>
> Tempting. I like hooking into mark_idle/park more than adding a new
> timer, and we already have the precedent of using that to initiate a
> cache flush.
>
> What's the impact of us keeping pages pinned when idle -- (a lot) more
> work in the shrinker. Let's see where the cost-beneift lies.
>
>> But for this immediate patch, would you be happy with adding and
>> exporting i915_gem_object_reset_page_iter and calling it after rotation
>> is done with accessing the pages? Benefit would be avoidance of
>> drm_malloc_gfp if that bothers you most.
>
> Honestly I think the page_iter cache is useful and likely to already
> exist or be used shortly after a portion of the object is rotated.
How come? I thought CPU access to framebuffers is atypical nowadays.
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-11-15 9:18 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-17 15:10 [PATCH] drm/i915: Remove temporary allocation of dma addresses when rotating Chris Wilson
2017-02-17 18:22 ` ✓ Fi.CI.BAT: success for drm/i915: Remove temporary allocation of dma addresses when rotating (rev2) Patchwork
2017-02-21 15:01 ` [PATCH] drm/i915: Remove temporary allocation of dma addresses when rotating Joonas Lahtinen
2017-02-22 8:29 ` Tvrtko Ursulin
2017-02-22 8:44 ` Chris Wilson
2017-02-27 9:55 ` Tvrtko Ursulin
2017-02-27 10:06 ` Chris Wilson
2017-02-27 10:14 ` Tvrtko Ursulin
2017-02-27 10:21 ` Chris Wilson
2017-02-27 12:52 ` Joonas Lahtinen
2017-02-27 14:31 ` Tvrtko Ursulin
2017-11-14 18:14 ` Chris Wilson
2017-11-15 9:18 ` Tvrtko Ursulin [this message]
2017-11-15 10:03 ` Chris Wilson
-- strict thread matches above, loose matches on Subject: below --
2017-02-17 15:07 Chris Wilson
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=bb153292-36ae-d0ff-4647-db35f9ba018c@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=joonas.lahtinen@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox