public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@intel.com>
To: "Gupta, Sourab" <sourab.gupta@intel.com>,
	Chris Wilson <chris@chris-wilson.co.uk>
Cc: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"Barnes, Jesse" <jesse.barnes@intel.com>,
	"Goel, Akash" <akash.goel@intel.com>,
	"Wilson, Chris" <chris.wilson@intel.com>
Subject: Re: [RFC 3/3] drm/i915: Add the truncation logic for Stolen objects.
Date: Wed, 05 Mar 2014 20:47:31 +0100	[thread overview]
Message-ID: <53177F53.40006@intel.com> (raw)
In-Reply-To: <65889429B5341B4E95B705EB9142B060090E0A@BGSMSX103.gar.corp.intel.com>

On 05/03/2014 20:24, Gupta, Sourab wrote:
> We have assumed the following lifecycle of the (stolen)object, w.r.t the truncation usecase:
>
> 1) The user creates the (non-cpu mappable)object --> the gem object is created. Shmem filep is allocated. No backing storage present
> 2) GPU operations performed (after mmap_gtt ) --> object is moved to stolen memory and the backing pages are allocated from stolen mem area.
> 3) Object is marked as purgeable (by madvise_ioctl)-->  here two scenarios can occur:
> 	a) Object has not yet been processed by GPU. In this case it will be in the active list. So, madvise_ioctl will mark it as purgeable and return.
> 	     Subsequently, when the retire handler runs, and object is being moved to inactive list, then, the purgeable object is truncated and marked as purged.
> 	b) Object is already processed by the GPU. In this case, it will be in the inactive list. So, madvise_ioctl will do the object truncation and mark it as purged.
> 4) If object is not marked as purgeable, the backing pages of the object will remain.
> 5) When object is freed, backing pages are released, if the object has not been purged already.
>
> Is the object being in the inactive list, the necessary and sufficient condition of it not being in use?
> We may be missing out on some condition regarding when the object will be in use.
> Can you please point us to the flaws in above assumption regarding when we can truncate the object.
Immediately purging the backing storage is not the idea of the madvise 
ioctl. The idea is to purge it as late as possible, i.e. when we've 
tried to allocate more stolen space but failed. For comparison see how 
purgeable works for normal objects: Those only get purged in the 
shrinker, i.e. when the linux mm is short on memory.
-Daniel
Intel Semiconductor AG
Registered No. 020.30.913.786-7
Registered Office: World Trade Center, Leutschenbachstrasse 95, 8050 Zurich, Switzerland

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

  reply	other threads:[~2014-03-05 19:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-05 11:35 [RFC 0/3] Increase the utilization of Stolen area on VLV sourab.gupta
2014-03-05 11:35 ` [RFC 1/3] drm/i915: Added a new 'I915_CPU_MAP_NOT_NEEDED' flag to gem_create ioctl sourab.gupta
2014-03-05 11:35 ` [RFC 2/3] i915/drm: Increase the utilization of stolen memory on VLV sourab.gupta
2014-03-05 11:35 ` [RFC 3/3] drm/i915: Add the truncation logic for Stolen objects sourab.gupta
2014-03-05 11:49   ` Chris Wilson
2014-03-05 12:26     ` Gupta, Sourab
2014-03-05 12:45       ` Chris Wilson
2014-03-05 19:24         ` Gupta, Sourab
2014-03-05 19:47           ` Daniel Vetter [this message]
2014-03-06  9:39             ` Gupta, Sourab
2014-03-06  9:48               ` Daniel Vetter
2014-03-06 10:48                 ` Gupta, Sourab
2014-03-06 11:17                   ` 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=53177F53.40006@intel.com \
    --to=daniel.vetter@intel.com \
    --cc=akash.goel@intel.com \
    --cc=chris.wilson@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jesse.barnes@intel.com \
    --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