public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Damien Lespiau <damien.lespiau@intel.com>
To: "Volkin, Bradley D" <bradley.d.volkin@intel.com>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915: Use hash tables for the command parser
Date: Thu, 8 May 2014 16:59:15 +0100	[thread overview]
Message-ID: <20140508155915.GI22477@strange.amr.corp.intel.com> (raw)
In-Reply-To: <20140508155338.GC21594@bdvolkin-ubuntu-desktop>

On Thu, May 08, 2014 at 08:53:38AM -0700, Volkin, Bradley D wrote:
> On Thu, May 08, 2014 at 06:15:44AM -0700, Lespiau, Damien wrote:
> > On Thu, May 08, 2014 at 02:05:07PM +0100, Damien Lespiau wrote:
> > > On Mon, Apr 28, 2014 at 08:22:08AM -0700, bradley.d.volkin@intel.com wrote:
> > > > From: Brad Volkin <bradley.d.volkin@intel.com>
> > > > +/*
> > > > + * Different command ranges have different numbers of bits for the opcode.
> > > > + * In order to use the opcode bits, and only the opcode bits, for the hash key
> > > > + * we should use the MI_* command opcode mask (since those commands use the
> > > > + * fewest bits for the opcode.)
> > > > + */
> > > > +#define CMD_HASH_MASK STD_MI_OPCODE_MASK
> > > 
> > > This is not very convicing (but could well be correct).
> > > 
> > > #define STD_MI_OPCODE_MASK  0xFF800000
> > > #define STD_3D_OPCODE_MASK  0xFFFF0000
> > > 
> > > So it only works if the 3D opcodes have the top 9 bits all distinct?
> > 
> > To expand on that, with the attached program:
> > 
> > $ ./minimal-hash-hsw-render  | wc -l
> > 44
> > 
> > $ ./minimal-hash-hsw-render  | sort -u | wc -l
> > 37
> 
> Yes, as it's currently written, some commands may hash to the same
> bucket. The per-bucket search will use the full mask from the cmd
> descriptor to get an exact match.
> 
> The issue is that, for example, MI commands in a batch may use bits
> 22:16 for something other than the opcode (e.g. GGTT vs PPGTT). If we
> mask a command from a batch with 0xFFFF0000 then an MI command may hash
> to the wrong bucket. If we want a perfect hash then I suppose we should
> look at bits 31:29 and mask with the exact STD_xx_OPCODE_MASK for the
> client. The existing INSTR_CLIENT_MASK/SHIFT defines could be reused
> for that.

Ah that works then, not super convinced that's the best way we can do
it, but it seems to be an improvement, so well... can't argue with that.

-- 
Damien

  reply	other threads:[~2014-05-08 15:59 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
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 [this message]
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=20140508155915.GI22477@strange.amr.corp.intel.com \
    --to=damien.lespiau@intel.com \
    --cc=bradley.d.volkin@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