From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Damien Lespiau <damien.lespiau@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Use hash tables for the command parser
Date: Thu, 08 May 2014 14:24:01 +0100 [thread overview]
Message-ID: <536B8571.20101@linux.intel.com> (raw)
In-Reply-To: <20140508130211.GA22477@strange.amr.corp.intel.com>
On 05/08/2014 02:02 PM, Damien Lespiau wrote:
> On Thu, May 08, 2014 at 01:25:33PM +0100, Tvrtko Ursulin wrote:
>>
>> On 05/08/2014 12:44 PM, Damien Lespiau wrote:
>>> On Thu, May 08, 2014 at 10:56:05AM +0100, Tvrtko Ursulin wrote:
>>>>
>>>> Hi Brad,
>>>>
>>>> On 04/28/2014 04:22 PM, bradley.d.volkin@intel.com wrote:
>>>> [snip]
>>>>> - BUG_ON(!validate_cmds_sorted(ring));
>>>>> + BUG_ON(!validate_cmds_sorted(ring, cmd_tables, cmd_table_count));
>>>>> BUG_ON(!validate_regs_sorted(ring));
>>>>> +
>>>>> + BUG_ON(init_hash_table(ring, cmd_tables, cmd_table_count));
>>>>
>>>> Is a BUG_ON a bit harsh since the above fails only on ENOMEM condition?
>>>>
>>>> If the concern is not allowing any command execution if parser setup
>>>> has failed, it would be nicer to the system as whole to just keep
>>>> rejecting everything, but let the rest of the kernel live to enable
>>>> debug or whatever?
>>>
>>> Those number_of_cmds allocations are a bit awkward though, couldn't we
>>> just embed the hlist_node into the desciptor struct?
>>
>> Until Brad comes online, I think that is because command descriptors
>> to hash table entries are not 1-to-1.
>
> Ah, I guess the common cmds are part of several hash tables. We could at
> least turn the multiple allocations into one big allocation though.
Probably a problem since commands can be added dynamically.
Also from the memory use point of view, single allocations are 12/24
bytes so fit into 16/32 byte slabs. That's some wastage on the face of
it, but bunching them up would make... say common plus render commands
are ~30 in total, so 360/720 bytes. Which would waste 152/304 bytes (512
and 1024 slabs) vs. 120/240 bytes for individual allocations. So for 30
command array current approach is even better. :)
Maybe make a dedicated cache for struct cmd_node?
Tvrtko
next prev parent reply other threads:[~2014-05-08 13:24 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-28 15:22 [PATCH] drm/i915: Use hash tables for the command parser bradley.d.volkin
2014-04-28 15:42 ` Daniel Vetter
2014-04-28 16:01 ` Volkin, Bradley D
2014-04-28 15:48 ` Volkin, Bradley D
2014-04-28 15:53 ` Daniel Vetter
2014-04-28 16:07 ` Volkin, Bradley D
2014-04-28 16:11 ` Daniel Vetter
2014-05-07 16:34 ` Volkin, Bradley D
2014-05-08 9:56 ` Tvrtko Ursulin
2014-05-08 11:44 ` Damien Lespiau
2014-05-08 12:25 ` Tvrtko Ursulin
2014-05-08 13:02 ` Damien Lespiau
2014-05-08 13:24 ` Tvrtko Ursulin [this message]
2014-05-08 13:52 ` Damien Lespiau
2014-05-08 15:27 ` Volkin, Bradley D
2014-05-08 15:45 ` Ville Syrjälä
2014-05-08 16:02 ` Volkin, Bradley D
2014-05-12 16:24 ` Daniel Vetter
2014-05-12 16:41 ` Volkin, Bradley D
2014-05-12 17:47 ` Daniel Vetter
2014-05-08 15:50 ` Tvrtko Ursulin
2014-05-08 16:04 ` Volkin, Bradley D
2014-05-08 13:05 ` Damien Lespiau
2014-05-08 13:15 ` Damien Lespiau
2014-05-08 15:53 ` Volkin, Bradley D
2014-05-08 15:59 ` Damien Lespiau
2014-05-08 13:42 ` Tvrtko Ursulin
2014-05-08 15:40 ` Volkin, Bradley D
-- strict thread matches above, loose matches on Subject: below --
2014-05-10 21:10 bradley.d.volkin
2014-05-12 13:47 ` Damien Lespiau
2014-05-12 14:49 ` Tvrtko Ursulin
2014-05-12 16:49 ` Daniel Vetter
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=536B8571.20101@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=damien.lespiau@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/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