All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tursulin@ursulin.net>
To: Intel-gfx@lists.freedesktop.org
Subject: [RFC 7/7] drm/i915: Trim sg table after creating it
Date: Thu, 13 Oct 2016 10:04:04 +0100	[thread overview]
Message-ID: <1476349444-7331-8-git-send-email-tvrtko.ursulin@linux.intel.com> (raw)
In-Reply-To: <1476349444-7331-1-git-send-email-tvrtko.ursulin@linux.intel.com>

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Since most of our callers do not know in advance how many entries
in the sg table they will need, it is beneficial to trim the table
after it has been created.

Use the newly added sg_trim_table to do that when i915_sg_complete
is called.

Before we were wasting between 1-2 MiB of space on unused sg
entries just when logging into an idle desktop (KDE), around 3 MiB
while running the T-Rex benchmark or around 5-6 MiB with Manhattan.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 05dc2af1a89e..1b722c5ebb26 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2347,6 +2347,8 @@ struct sg_table *i915_sg_complete(struct i915_sg_create_state *state)
 
 	kfree(state);
 
+	sg_trim_table(st);
+
 	return st;
 }
 
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-10-13  9:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-13  9:03 [RFC 0/7] Save megabytes of wasted sg entries Tvrtko Ursulin
2016-10-13  9:03 ` [RFC 1/7] drm/i915: Extract sg creation into a helper Tvrtko Ursulin
2016-10-13  9:20   ` Chris Wilson
2016-10-13  9:55     ` Tvrtko Ursulin
2016-10-13 10:12       ` Chris Wilson
2016-10-13  9:03 ` [RFC 2/7] drm/i915: Use i915_sg_create for userptr Tvrtko Ursulin
2016-10-13  9:04 ` [RFC 3/7] drm/i915: Use i915_sg_create for partial views Tvrtko Ursulin
2016-10-13  9:04 ` [RFC 4/7] drm/i915: Use i915_sg_create for rotated pages view Tvrtko Ursulin
2016-10-13  9:04 ` [RFC 5/7] drm/i915: Use i915_sg_create for dmabuf Tvrtko Ursulin
2016-10-13  9:15   ` Chris Wilson
2016-10-13  9:49     ` Tvrtko Ursulin
2016-10-13  9:04 ` [RFC 6/7] lib/scatterlist: Add sg_trim_table Tvrtko Ursulin
2016-10-13  9:23   ` Chris Wilson
2016-10-13  9:51     ` Tvrtko Ursulin
2016-10-13  9:04 ` Tvrtko Ursulin [this message]
2016-10-13 10:27 ` ✗ Fi.CI.BAT: failure for Save megabytes of wasted sg entries Patchwork
2016-10-13 11:24   ` Saarinen, Jani
2016-10-13 15:33     ` Daniel Vetter
2016-10-13 16:09       ` Tvrtko Ursulin

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=1476349444-7331-8-git-send-email-tvrtko.ursulin@linux.intel.com \
    --to=tursulin@ursulin.net \
    --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.