From: Akash Goel <akash.goel@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org, sourab.gupta@intel.com
Subject: Re: [PATCH v2] drm/i915: Pre-allocation of shmem pages of a GEM object
Date: Mon, 05 May 2014 18:35:00 +0530 [thread overview]
Message-ID: <1399295100.4745.43.camel@akashgoe-desktop> (raw)
In-Reply-To: <20140505081755.GB4438@nuc-i3427.alporthouse.com>
On Mon, 2014-05-05 at 09:17 +0100, Chris Wilson wrote:
> On Mon, May 05, 2014 at 09:55:29AM +0530, akash.goel@intel.com wrote:
> > From: Akash Goel <akash.goel@intel.com>
> >
> > This patch could help to reduce the time, 'struct_mutex' is kept
> > locked during either the exec-buffer path or Page fault
> > handling path as now the backing pages are requested from shmem layer
> > without holding the 'struct_mutex'.
> >
> > v2: Fixed the merge issue, due to which 'exec_lock' mutex was not released.
>
> This would be a good excuse to work on per-object locks and augmenting
> i915_gem_madvise_ioctl() to grab pages. iow, add obj->mutex and use that
> for guarding all obj->pages related members/operations, then add
> I915_MADV_POPULATE which can run without the struct mutex.
>
> That should provide you with the lockless get_pages and keep execbuffer
> reasonably clean and fast.
Yes the per object lock would be a more cleaner approach here.
But it could take some time to implement it, so time being can we
consider this as a stopgap solution.
> Again, please think about why you are *clflushing* so many pages so
> often. That is a sign of userspace bo cache failure.
> -Chris
>
Sorry not sure that whether I understood your point here, but we are not
doing any extra clflush here, just doing the needful.
Any newly allocated buffer from shmem, is by default marked as to be
present in CPU domain, so when it is being submitted to rendering on
GPU, all the pages of this buffer are 'clflushed'.
This is probably to ensure that any stale data for this buffer in CPU
cache is flushed out, before GPU actually starts writing to this buffer,
otherwise the data written by GPU could be overwritten with stale data
in CPU cache subsequently.
Sometimes there is an odd need to process buffers of huge size (like ~34
MB) and that's where the user space bo cache might also fail.
Best regards
Akash
prev parent reply other threads:[~2014-05-05 13:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-05 4:25 [PATCH v2] drm/i915: Pre-allocation of shmem pages of a GEM object akash.goel
2014-05-05 8:17 ` Chris Wilson
2014-05-05 13:05 ` Akash Goel [this message]
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=1399295100.4745.43.camel@akashgoe-desktop \
--to=akash.goel@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=sourab.gupta@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