[Mesa-dev] [PATCH 3/4] winsys/radeon: Keep bo statistics
Marek Olšák
maraeo at gmail.com
Wed Jan 8 06:54:04 PST 2014
On Wed, Jan 8, 2014 at 2:56 PM, Lauri Kasanen <cand at gmx.com> wrote:
> On Wed, 8 Jan 2014 12:03:12 +0100
> Marek Olšák <maraeo at gmail.com> wrote:
>
>> On Tue, Jan 7, 2014 at 7:14 PM, Lauri Kasanen <cand at gmx.com> wrote:
>> > These will be used later on for optimizing the VRAM placement.
>> >
>> > No measurable overhead (glxgears, torcs).
>> >
>> > v2: Get accurate stats by taking dirty_masks into account
>>
>> Why don't you just set the statistics once per CS in
>> radeon_drm_cs_flush? I don't see a value in doing it in every function
>> that sets the resources.
>
> It's the only way to get accurate statistics that I can see. Doing it
> per-cs could be off by big amounts (100x even?). Being off by that much
> could lead to rather worse decisions.
It's not accurate at all, it's actually pretty random. The stats
should not be called "num_reads" and "num_writes", they should be
called "num_state_changes", and the number of resource state changes
has nothing to do with how the resources affect GPU performance. You
might get a pretty high score for unimportant resources with your
approach. It's as useful as assigning a random number to each
resource.
Another issue is that you record times when resource state changes
happen, but rendering actually starts after radeon_drm_cs_flush is
called. Your recorded times actually only tell you when the user
changed states, which may be useful for CPU measurements, but it's
useless for everything else.
The only way to get accurate numbers of reads and writes is to use GPU
performance counters, which we won't probably have in the open driver,
and I don't think it's possible to record the numbers for every
resource individually anyway.
Marek
More information about the mesa-dev
mailing list