From: Thomas Hellstrom <thellstrom@vmware.com>
To: airlied@redhat.com
Cc: Thomas Hellstrom <thellstrom@vmware.com>,
dri-devel@lists.freedesktop.org
Subject: [PATCH 1/5] drm/ttm: Optimize ttm_eu_backoff_reservation
Date: Wed, 17 Nov 2010 13:28:27 +0100 [thread overview]
Message-ID: <1289996911-14329-2-git-send-email-thellstrom@vmware.com> (raw)
In-Reply-To: <1289996911-14329-1-git-send-email-thellstrom@vmware.com>
Avoid the ttm_bo_unreserve() spinlocks by calling
ttm_eu_backoff_reservation_locked under the lru spinlock.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
---
drivers/gpu/drm/ttm/ttm_execbuf_util.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/ttm/ttm_execbuf_util.c b/drivers/gpu/drm/ttm/ttm_execbuf_util.c
index efb42a8..3f0d23c 100644
--- a/drivers/gpu/drm/ttm/ttm_execbuf_util.c
+++ b/drivers/gpu/drm/ttm/ttm_execbuf_util.c
@@ -99,15 +99,16 @@ static int ttm_eu_wait_unreserved_locked(struct list_head *list,
void ttm_eu_backoff_reservation(struct list_head *list)
{
struct ttm_validate_buffer *entry;
+ struct ttm_bo_global *glob;
- list_for_each_entry(entry, list, head) {
- struct ttm_buffer_object *bo = entry->bo;
- if (!entry->reserved)
- continue;
+ if (list_empty(list))
+ return;
- entry->reserved = false;
- ttm_bo_unreserve(bo);
- }
+ entry = list_first_entry(list, struct ttm_validate_buffer, head);
+ glob = entry->bo->glob;
+ spin_lock(&glob->lru_lock);
+ ttm_eu_backoff_reservation_locked(list);
+ spin_unlock(&glob->lru_lock);
}
EXPORT_SYMBOL(ttm_eu_backoff_reservation);
--
1.6.2.5
next prev parent reply other threads:[~2010-11-17 12:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-17 12:28 [PATCH 0/5][-next] TTM bo reservation and fencing improvements Thomas Hellstrom
2010-11-17 12:28 ` Thomas Hellstrom [this message]
2010-11-17 12:28 ` [PATCH 2/5] drm/ttm: Don't deadlock on recursive multi-bo reservations Thomas Hellstrom
2010-11-17 12:28 ` [PATCH 3/5] drm/ttm/radeon/nouveau: Kill the bo lock in favour of a bo device fence_lock Thomas Hellstrom
2010-11-17 12:28 ` [PATCH 4/5] drm/ttm: Improved fencing of buffer object lists Thomas Hellstrom
2010-11-17 12:28 ` [PATCH 5/5] drm/ttm/vmwgfx: Have TTM manage the validation sequence Thomas Hellstrom
2010-11-17 19:07 ` [PATCH 0/5][-next] TTM bo reservation and fencing improvements Jerome Glisse
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=1289996911-14329-2-git-send-email-thellstrom@vmware.com \
--to=thellstrom@vmware.com \
--cc=airlied@redhat.com \
--cc=dri-devel@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