From: "Christian König" <deathsimple@vodafone.de>
To: "Marek Olšák" <maraeo@gmail.com>
Cc: dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 2/6] drm/radeon: track memory statistics about VRAM and GTT usage and buffer moves
Date: Wed, 26 Feb 2014 19:26:17 +0100 [thread overview]
Message-ID: <530E31C9.8090405@vodafone.de> (raw)
In-Reply-To: <CAAxE2A7WvRJzvhY=RqyV_BCFRMurH0Fg463aLiq9RcYRj_Vjzw@mail.gmail.com>
Am 26.02.2014 18:56, schrieb Marek Olšák:
> On Mon, Feb 24, 2014 at 5:20 PM, Christian König
> <deathsimple@vodafone.de> wrote:
>> Am 24.02.2014 16:20, schrieb Marek Olšák:
>>
>>> From: Marek Olšák <marek.olsak@amd.com>
>>>
>>> The statistics are:
>>> - VRAM usage in bytes
>>> - GTT usage in bytes
>>> - number of bytes moved by TTM
>>>
>>> The last one is actually a counter, so you need to sample it before and
>>> after
>>> command submission and take the difference.
>>>
>>> This is useful for finding performance bottlenecks. Userspace queries are
>>> also added.
>>>
>>> Signed-off-by: Marek Olšák <marek.olsak@amd.com>
>>> ---
>>> drivers/gpu/drm/radeon/radeon.h | 5 +++++
>>> drivers/gpu/drm/radeon/radeon_device.c | 1 +
>>> drivers/gpu/drm/radeon/radeon_kms.c | 15 ++++++++++++++
>>> drivers/gpu/drm/radeon/radeon_object.c | 38
>>> +++++++++++++++++++++++++++++++++-
>>> drivers/gpu/drm/radeon/radeon_object.h | 2 +-
>>> drivers/gpu/drm/radeon/radeon_ttm.c | 10 ++++++++-
>>> include/uapi/drm/radeon_drm.h | 3 +++
>>> 7 files changed, 71 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/radeon/radeon.h
>>> b/drivers/gpu/drm/radeon/radeon.h
>>> index 3f10782..d37a57a 100644
>>> --- a/drivers/gpu/drm/radeon/radeon.h
>>> +++ b/drivers/gpu/drm/radeon/radeon.h
>>> @@ -2307,6 +2307,11 @@ struct radeon_device {
>>> /* virtual memory */
>>> struct radeon_vm_manager vm_manager;
>>> struct mutex gpu_clock_mutex;
>>> + /* memory stats */
>>> + struct mutex memory_stats_mutex;
>>> + uint64_t vram_usage;
>>> + uint64_t gtt_usage;
>>> + uint64_t num_bytes_moved;
>>
>> As far as I can see you could make those tree values atomic64_t instead and
>> avoid the mutex.
> I'm afraid I cannot use atomic64_t. It doesn't work on x86 32-bit.
> This seems to be a no-op:
>
> u64 size = (u64)bo->num_pages << PAGE_SHIFT;
> atomic64_add(size, &rdev->num_bytes_moved);
Are you sure about this? Haven't tested x86 32-bit in a long time, but
we use atomic64 all around the place and they usually work perfectly.
Christian.
> Marek
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2014-02-26 18:26 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-24 15:20 [PATCH 0/6] Radeon memory management improvements Marek Olšák
2014-02-24 15:20 ` [PATCH 1/6] drm/radeon: add a way to get and set initial buffer domains Marek Olšák
2014-02-24 16:17 ` Christian König
2014-02-26 0:44 ` Marek Olšák
2014-02-26 9:39 ` Christian König
2014-02-26 10:58 ` Marek Olšák
2014-02-24 15:20 ` [PATCH 2/6] drm/radeon: track memory statistics about VRAM and GTT usage and buffer moves Marek Olšák
2014-02-24 16:20 ` Christian König
2014-02-26 17:56 ` Marek Olšák
2014-02-26 18:26 ` Christian König [this message]
2014-02-27 0:39 ` Marek Olšák
2014-02-24 15:20 ` [PATCH 3/6] drm/radeon: deduplicate code in radeon_gem_busy_ioctl Marek Olšák
2014-02-24 15:20 ` [PATCH 4/6] drm/radeon: add buffers to the LRU list from smallest to largest Marek Olšák
2014-02-24 15:20 ` [PATCH 5/6] drm/radeon: validate relocations in the order determined by userspace Marek Olšák
2014-02-24 16:27 ` Christian König
2014-02-24 15:20 ` [PATCH 6/6] drm/radeon: limit how much memory TTM can move per IB according to VRAM usage Marek Olšák
2014-02-24 16:40 ` [PATCH 0/6] Radeon memory management improvements Christian König
2014-02-24 19:23 ` Alex Deucher
2014-02-24 19:39 ` Marek Olšák
2014-02-25 10:11 ` Christian König
2014-02-25 23:29 ` Marek Olšák
2014-02-27 1:17 ` Jerome Glisse
2014-02-25 2:52 ` Michel Dänzer
-- strict thread matches above, loose matches on Subject: below --
2014-02-26 18:25 [PATCH 1/6] drm/radeon: add a way to get and set initial buffer domains Marek Olšák
2014-02-26 18:25 ` [PATCH 2/6] drm/radeon: track memory statistics about VRAM and GTT usage and buffer moves Marek Olšák
2014-03-01 23:56 [PATCH 0/6] Radeon memory management improvements v3 Marek Olšák
2014-03-01 23:56 ` [PATCH 2/6] drm/radeon: track memory statistics about VRAM and GTT usage and buffer moves Marek Olšák
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=530E31C9.8090405@vodafone.de \
--to=deathsimple@vodafone.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=maraeo@gmail.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 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.