* [Intel-gfx] [PATCH i-g-t] i915/gem_mmap_offset: Exercise many, many mmap_offset
@ 2020-01-17 21:11 Chris Wilson
2020-01-20 11:13 ` Abdiel Janulgue
0 siblings, 1 reply; 2+ messages in thread
From: Chris Wilson @ 2020-01-17 21:11 UTC (permalink / raw)
To: intel-gfx; +Cc: igt-dev
Just keep on generating a new mmap_offset for the same old buffer, but
for different handles and so exercise the scaling of the obj->mmo lists.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
---
tests/i915/gem_mmap_offset.c | 66 ++++++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+)
diff --git a/tests/i915/gem_mmap_offset.c b/tests/i915/gem_mmap_offset.c
index 95e1e3e6c..005839c38 100644
--- a/tests/i915/gem_mmap_offset.c
+++ b/tests/i915/gem_mmap_offset.c
@@ -326,6 +326,69 @@ static void close_race(int i915, int timeout)
munmap(handles, len);
}
+static void open_flood(int i915, int timeout)
+{
+ unsigned long count;
+ uint32_t handle;
+ int dmabuf;
+ int *ctl;
+
+ ctl = mmap(0, 4096, PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0);
+ igt_assert(ctl != MAP_FAILED);
+
+ handle = gem_create(i915, 4096);
+ dmabuf = prime_handle_to_fd(i915, handle);
+
+ for_each_mmap_offset_type(t) {
+ struct drm_i915_gem_mmap_offset arg = {
+ .handle = handle,
+ .flags = t->type,
+ };
+
+ if (mmap_offset_ioctl(i915, &arg))
+ continue;
+
+ igt_fork(child, 1) {
+ i915 = gem_reopen_driver(i915);
+ arg.handle = prime_fd_to_handle(i915, dmabuf);
+
+ do {
+ igt_assert_eq(mmap_offset_ioctl(i915, &arg), 0);
+ } while (!READ_ONCE(*ctl));
+ }
+ }
+ gem_close(i915, handle);
+
+ count = 0;
+ igt_until_timeout(timeout) {
+ int tmp;
+
+ tmp = gem_reopen_driver(i915);
+ handle = prime_fd_to_handle(i915, dmabuf);
+
+ for_each_mmap_offset_type(t) {
+ struct drm_i915_gem_mmap_offset arg = {
+ .handle = handle,
+ .flags = t->type,
+ };
+
+ mmap_offset_ioctl(i915, &arg);
+ }
+
+ close(tmp);
+ count++;
+ }
+
+ igt_info("Completed %lu cycles\n", count);
+
+ close(dmabuf);
+ close(i915);
+
+ *ctl = 1;
+ igt_waitchildren();
+ munmap(ctl, 4096);
+}
+
static uint64_t atomic_compare_swap_u64(_Atomic(uint64_t) *ptr,
uint64_t oldval, uint64_t newval)
{
@@ -488,6 +551,9 @@ igt_main
igt_subtest_f("close-race")
close_race(i915, 20);
+ igt_subtest_f("open-flood")
+ open_flood(i915, 20);
+
igt_subtest_f("clear")
always_clear(i915, 20);
--
2.25.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Intel-gfx] [PATCH i-g-t] i915/gem_mmap_offset: Exercise many, many mmap_offset
2020-01-17 21:11 [Intel-gfx] [PATCH i-g-t] i915/gem_mmap_offset: Exercise many, many mmap_offset Chris Wilson
@ 2020-01-20 11:13 ` Abdiel Janulgue
0 siblings, 0 replies; 2+ messages in thread
From: Abdiel Janulgue @ 2020-01-20 11:13 UTC (permalink / raw)
To: Chris Wilson, intel-gfx; +Cc: igt-dev
On 17/01/2020 23.11, Chris Wilson wrote:
> Just keep on generating a new mmap_offset for the same old buffer, but
> for different handles and so exercise the scaling of the obj->mmo lists.
>
Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-20 11:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-17 21:11 [Intel-gfx] [PATCH i-g-t] i915/gem_mmap_offset: Exercise many, many mmap_offset Chris Wilson
2020-01-20 11:13 ` Abdiel Janulgue
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).