From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/6] drm/i915: Eliminate vmap overhead for cmd parser
Date: Thu, 1 Oct 2015 16:29:48 +0300 [thread overview]
Message-ID: <20151001132948.GI26517@intel.com> (raw)
In-Reply-To: <20151001132453.GL9929@nuc-i3427.alporthouse.com>
On Thu, Oct 01, 2015 at 02:24:53PM +0100, Chris Wilson wrote:
> On Thu, Oct 01, 2015 at 03:37:21PM +0300, Ville Syrjälä wrote:
> > On Thu, Oct 01, 2015 at 12:57:10PM +0100, Chris Wilson wrote:
> > > - while (cmd < batch_end) {
> > > - const struct drm_i915_cmd_descriptor *desc;
> > > - u32 length;
> > > + k = i;
> > > + if (k > PAGE_SIZE - out)
> > > + k = PAGE_SIZE - out;
> > > + if (k == PAGE_SIZE)
> > > + copy_page(dst, src);
> > > + else
> > > + memcpy(dst + out, src + j, k);
> > > +
> > > + out += k;
> > > + j += k;
> > > + i -= k;
> > > + } while (i);
> > > +
> > > + cmd = src + in;
> >
> > So you're now checking the src batch? What prevents userspace from
> > overwriting it with eg. NOPS between the time you copied it and the
> > time you check it?
>
> Zilch. I picked src as it was already in the CPU cache, whereas dst will
> be WC later. To satisfy you and byt, I need to stage the copy into a
> temporary page, scan it, then copy into dst.
>
> The silver lining is that it does remove some lines of code. I'm pretty
> confident that the double copy should not be noticed if I remember about
> the cache-trashing of kunmap and carefully manage that.
Yeah, I was thinking that optimally we'd do the copy+scan in cacheline
units, but maybe that's too small to make it actually efficient?
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-10-01 13:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-01 11:57 [PATCH 1/6] drm/i915: Eliminate vmap overhead for cmd parser Chris Wilson
2015-10-01 11:57 ` [PATCH 2/6] drm/i915: Cache last cmd descriptor when parsing Chris Wilson
2015-10-01 11:57 ` [PATCH 3/6] drm/i915: Use WC copies on !llc platforms for the command parser Chris Wilson
2015-10-01 11:57 ` [PATCH 4/6] drm/i915: Reduce arithmetic operations during cmd parser lookup Chris Wilson
2015-10-01 11:57 ` [PATCH 5/6] drm/i915: Reduce pointer indirection " Chris Wilson
2015-10-01 11:57 ` [PATCH 6/6] drm/i915: Improve hash function for the command parser Chris Wilson
2015-10-01 12:37 ` [PATCH 1/6] drm/i915: Eliminate vmap overhead for cmd parser Ville Syrjälä
2015-10-01 13:24 ` Chris Wilson
2015-10-01 13:29 ` Ville Syrjälä [this message]
2015-10-01 13:39 ` Chris Wilson
2015-10-06 12:44 ` Daniel Vetter
2015-10-06 13:00 ` 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=20151001132948.GI26517@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--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 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.