From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Thomas Wood <thomas.wood@intel.com>
Cc: Intel Graphics Development <Intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t] gem_ppgtt: Test VMA leak on context destruction
Date: Wed, 23 Sep 2015 13:36:17 +0100 [thread overview]
Message-ID: <56029CC1.4030708@linux.intel.com> (raw)
In-Reply-To: <CANkqdn1=0cSkWf+axeoC2zkJ1ohzJ4KzgMjhvcscObhSpWB_8Q@mail.gmail.com>
Hi,
On 09/18/2015 12:17 PM, Thomas Wood wrote:
> On 11 September 2015 at 15:31, Tvrtko Ursulin
> <tvrtko.ursulin@linux.intel.com> wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> Test that VMAs associated with a context are cleaned up when
>> contexts are destroyed.
>>
>> In practice this emulates the leak seen between fbcon and X server.
>> Every time the X server exits we gain one VMA on the fbcon frame
>> buffer object as externally visible via for example
>> /sys/kernel/debug/dri/0/i915_gem_gtt.
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> ---
>> tests/gem_ppgtt.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 80 insertions(+)
>>
>> diff --git a/tests/gem_ppgtt.c b/tests/gem_ppgtt.c
>> index 4f6df063214a..363f9d701585 100644
>> --- a/tests/gem_ppgtt.c
>> +++ b/tests/gem_ppgtt.c
>> @@ -265,6 +265,83 @@ static void flink_and_close(void)
>> close(fd2);
>> }
>>
>> +static int grep_name(char *match, int to_match)
>
> This could be added to igt_debugfs.c, as it might be useful for other tests.
I couldn't force myself to do it.
>
>> +{
>> + int fdd, ret, matched;
>> +
>> + fdd = open("/sys/kernel/debug/dri/0/i915_gem_gtt", O_RDONLY);
>
> igt_debugfs_open would be more robust here, as it checks various
> locations for the debugfs and also attempts to mount it if it can't be
> found.
Done.
>
>
>> + igt_assert(fdd >= 0);
>> +
>> + matched = 0;
>> + do {
>> + char ch;
>> +
>> + ret = read(fdd, &ch, 1);
>> + if (ret == 0)
>> + break;
>> + igt_assert(ret == 1);
>> +
>> + if (ch == match[matched])
>> + matched++;
>> + else
>> + matched = 0;
>> + } while (matched < to_match);
>
> igt_debugfs_fopen is also available, which would allow the use of
> getline and strstr here instead, as a slightly simpler implementation.
Also done. Ah not via fopen but open+fdopen... drat..
You want v3 or you can live with v2?
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-09-23 12:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-11 14:31 [PATCH i-g-t] gem_ppgtt: Test VMA leak on context destruction Tvrtko Ursulin
2015-09-18 11:17 ` Thomas Wood
2015-09-23 12:36 ` Tvrtko Ursulin [this message]
2015-09-23 16:16 ` Thomas Wood
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=56029CC1.4030708@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=Intel-gfx@lists.freedesktop.org \
--cc=thomas.wood@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