From: "Ceraolo Spurio, Daniele" <daniele.ceraolospurio@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
intel-gfx@lists.freedesktop.org,
Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: Re: [PATCH v3] [i-g-t] tests/gem_ppgtt: Check for vm leaks with flink and ppgtt
Date: Thu, 23 Apr 2015 14:01:43 +0100 [thread overview]
Message-ID: <5538ED37.4030200@intel.com> (raw)
In-Reply-To: <20150423113640.GG21511@nuc-i3427.alporthouse.com>
On 4/23/2015 12:36 PM, Chris Wilson wrote:
> On Thu, Apr 23, 2015 at 12:23:17PM +0100, daniele.ceraolospurio@intel.com wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> Using imported objects should not leak i915 vmas (and vms).
>>
>> In practice this simulates Xorg importing fbcon and leaking (or not) one vma
>> per Xorg startup cycle.
>>
>> v2: use low-level ioctl wrappers and bo offset to check the leak (Chris)
>> v3: use the flinked bo as batch (Chris)
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> (v2+)
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> Bikeshedding for fun aside,
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
>
>> +static uint64_t exec_and_get_offset(int fd, uint32_t batch)
>> +{
>> + struct drm_i915_gem_execbuffer2 execbuf;
>> + struct drm_i915_gem_exec_object2 exec[1];
>> + uint32_t batch_data[2] = { MI_NOOP, MI_BATCH_BUFFER_END };
>
> uint32_t buf[2] = { MI_BATCH_BUFFER_END };
>
>> +
>> + gem_write(fd, batch, 0, batch_data, sizeof(batch_data));
>> +
>> + memset(exec, 0, sizeof(exec));
>> + exec[0].handle = batch;
>> + exec[0].relocation_count = 0;
>> + exec[0].relocs_ptr = 0;
>
> We just memset(0) these two, so we don't need to clear them again.
>
>> + memset(&execbuf, 0, sizeof(execbuf));
>> + execbuf.buffers_ptr = (uintptr_t)exec;
>> + execbuf.buffer_count = 1;
>> + execbuf.batch_len = sizeof(batch_data);
>> + execbuf.flags = 0;
> These two can also happily disappear.
Ok for the execbuf.flags and for the other fixes, but why remove also
execbuf.batch_len?
Thanks,
Daniele
>
>> + gem_execbuf(fd, &execbuf);
>
> igt_assert_neq(exec[0].offset, -1)
> -Chris
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-04-23 13:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-20 12:14 [PATCH i-g-t] tests/gem_ppgtt: Check for vm leaks with flink and ppgtt Tvrtko Ursulin
2015-04-20 12:50 ` Chris Wilson
2015-04-20 14:56 ` Tvrtko Ursulin
2015-04-20 15:01 ` Chris Wilson
2015-04-20 16:25 ` Daniel Vetter
2015-04-23 9:30 ` [PATCH v2] [i-g-t] " daniele.ceraolospurio
2015-04-23 9:43 ` Chris Wilson
2015-04-23 10:14 ` Ceraolo Spurio, Daniele
2015-04-23 10:31 ` Chris Wilson
2015-04-23 11:23 ` [PATCH v3] " daniele.ceraolospurio
2015-04-23 11:36 ` Chris Wilson
2015-04-23 13:01 ` Ceraolo Spurio, Daniele [this message]
2015-04-23 13:09 ` Chris Wilson
2015-04-23 11:46 ` Tvrtko Ursulin
2015-04-23 14:39 ` [PATCH v4] " daniele.ceraolospurio
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=5538ED37.4030200@intel.com \
--to=daniele.ceraolospurio@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=tvrtko.ursulin@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 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.