public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v2 0/5] Remove random allocator and improve reloc one
@ 2022-12-05 20:27 Zbigniew Kempczyński
  2022-12-05 20:27 ` [igt-dev] [PATCH i-g-t v2 1/5] lib/intel_allocator: Remove RANDOM allocator Zbigniew Kempczyński
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Zbigniew Kempczyński @ 2022-12-05 20:27 UTC (permalink / raw)
  To: igt-dev

During some debugging session with our hw team I just realized that reloc
stateless is quite big problem when I would like to collect few blits
in single batch provided by the library. Especially where are more
more objects required to acquire the offsets and not to stall if more
separate blits should be added.

I removed also RANDOM allocator, we're not using it and in softpin world
it may potentially problematic as we don't control object overlapping.

For verification real world scenario where reloc stateful is required
I changed one of subtest which previously required simple allocator
and another which requires distinguish offset (previously stateless reloc
hides this proposing new offset each alloc()).

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>

Zbigniew Kempczyński (5):
  lib/intel_allocator: Remove RANDOM allocator
  tests/api_intel_allocator: Remove duplicated reuse and reserve
    subtests
  lib/intel_allocator_reloc: Introduce stateful allocations in reloc
  tests/gem_ctx_shared: Remove necessity of passing offset to function
    call
  tests/gem_exec_parallel: Avoid acquiring offset for overlapping handle

 lib/intel_allocator.c            |   3 -
 lib/intel_allocator.h            |   3 +-
 lib/intel_allocator_random.c     | 191 -------------------------------
 lib/intel_allocator_reloc.c      | 115 ++++++++++++++++---
 lib/meson.build                  |   1 -
 tests/i915/api_intel_allocator.c |  35 +++---
 tests/i915/api_intel_bb.c        |  12 --
 tests/i915/gem_ctx_shared.c      |  45 +++-----
 tests/i915/gem_exec_parallel.c   |  16 ++-
 9 files changed, 147 insertions(+), 274 deletions(-)
 delete mode 100644 lib/intel_allocator_random.c

-- 
2.34.1

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [igt-dev] [PATCH i-g-t v2 1/5] lib/intel_allocator: Remove RANDOM allocator
  2022-12-05 20:27 [igt-dev] [PATCH i-g-t v2 0/5] Remove random allocator and improve reloc one Zbigniew Kempczyński
@ 2022-12-05 20:27 ` Zbigniew Kempczyński
  2022-12-06 15:56   ` Kamil Konieczny
  2022-12-05 20:27 ` [igt-dev] [PATCH i-g-t v2 2/5] tests/api_intel_allocator: Remove duplicated reuse and reserve subtests Zbigniew Kempczyński
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Zbigniew Kempczyński @ 2022-12-05 20:27 UTC (permalink / raw)
  To: igt-dev

It was added in first allocator series as modification of previously
existing offset provider. As it is randomizing offsets there's a risk
they can overlap and during exec we can get ENOSPC in softpin mode.
Another thing is nobody is using it, so it is good idea to remove it
and prevent to have incidental failures in case of use.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
---
 lib/intel_allocator.c            |   3 -
 lib/intel_allocator.h            |   3 +-
 lib/intel_allocator_random.c     | 191 -------------------------------
 lib/meson.build                  |   1 -
 tests/i915/api_intel_allocator.c |   8 +-
 tests/i915/api_intel_bb.c        |  12 --
 6 files changed, 3 insertions(+), 215 deletions(-)
 delete mode 100644 lib/intel_allocator_random.c

diff --git a/lib/intel_allocator.c b/lib/intel_allocator.c
index 717d7fc56b..3004f15ae1 100644
--- a/lib/intel_allocator.c
+++ b/lib/intel_allocator.c
@@ -305,9 +305,6 @@ static struct intel_allocator *intel_allocator_create(int fd,
 	case INTEL_ALLOCATOR_RELOC:
 		ial = intel_allocator_reloc_create(fd, start, end);
 		break;
-	case INTEL_ALLOCATOR_RANDOM:
-		ial = intel_allocator_random_create(fd, start, end);
-		break;
 	case INTEL_ALLOCATOR_SIMPLE:
 		ial = intel_allocator_simple_create(fd, start, end,
 						    allocator_strategy);
diff --git a/lib/intel_allocator.h b/lib/intel_allocator.h
index c237e8e442..28e1165540 100644
--- a/lib/intel_allocator.h
+++ b/lib/intel_allocator.h
@@ -213,8 +213,7 @@ void intel_allocator_print(uint64_t allocator_handle);
 #define ALLOC_INVALID_ADDRESS (-1ull)
 #define INTEL_ALLOCATOR_NONE   0
 #define INTEL_ALLOCATOR_RELOC  1
-#define INTEL_ALLOCATOR_RANDOM 2
-#define INTEL_ALLOCATOR_SIMPLE 3
+#define INTEL_ALLOCATOR_SIMPLE 2
 
 #define GEN8_GTT_ADDRESS_WIDTH 48
 
diff --git a/lib/intel_allocator_random.c b/lib/intel_allocator_random.c
deleted file mode 100644
index d22f817670..0000000000
--- a/lib/intel_allocator_random.c
+++ /dev/null
@@ -1,191 +0,0 @@
-// SPDX-License-Identifier: MIT
-/*
- * Copyright © 2021 Intel Corporation
- */
-
-#include <sys/ioctl.h>
-#include <stdlib.h>
-#include "igt.h"
-#include "igt_x86.h"
-#include "igt_rand.h"
-#include "intel_allocator.h"
-
-struct intel_allocator *
-intel_allocator_random_create(int fd, uint64_t start, uint64_t end);
-
-struct intel_allocator_random {
-	uint32_t prng;
-	uint64_t start;
-	uint64_t end;
-
-	/* statistics */
-	uint64_t allocated_objects;
-};
-
-/* Keep the low 256k clear, for negative deltas */
-#define BIAS (256 << 10)
-#define RETRIES 8
-
-static void intel_allocator_random_get_address_range(struct intel_allocator *ial,
-						     uint64_t *startp,
-						     uint64_t *endp)
-{
-	struct intel_allocator_random *ialr = ial->priv;
-
-	if (startp)
-		*startp = ialr->start;
-
-	if (endp)
-		*endp = ialr->end;
-}
-
-static uint64_t intel_allocator_random_alloc(struct intel_allocator *ial,
-					     uint32_t handle, uint64_t size,
-					     uint64_t alignment,
-					     enum allocator_strategy strategy)
-{
-	struct intel_allocator_random *ialr = ial->priv;
-	uint64_t offset;
-	int cnt = RETRIES;
-
-	(void) handle;
-	(void) strategy;
-
-	/* randomize the address, we try to avoid relocations */
-	do {
-		offset = hars_petruska_f54_1_random64(&ialr->prng);
-		/* maximize the chances of fitting in the last iteration */
-		if (cnt == 1)
-			offset = 0;
-
-		offset %= ialr->end - ialr->start;
-		offset += ialr->start;
-		offset = ALIGN(offset, alignment);
-	} while (offset + size > ialr->end && --cnt);
-
-	if (!cnt)
-		return ALLOC_INVALID_ADDRESS;
-
-	ialr->allocated_objects++;
-
-	return offset;
-}
-
-static bool intel_allocator_random_free(struct intel_allocator *ial,
-					uint32_t handle)
-{
-	struct intel_allocator_random *ialr = ial->priv;
-
-	(void) handle;
-
-	ialr->allocated_objects--;
-
-	return false;
-}
-
-static bool intel_allocator_random_is_allocated(struct intel_allocator *ial,
-						uint32_t handle, uint64_t size,
-						uint64_t offset)
-{
-	(void) ial;
-	(void) handle;
-	(void) size;
-	(void) offset;
-
-	return false;
-}
-
-static void intel_allocator_random_destroy(struct intel_allocator *ial)
-{
-	igt_assert(ial);
-
-	free(ial->priv);
-	free(ial);
-}
-
-static bool intel_allocator_random_reserve(struct intel_allocator *ial,
-					   uint32_t handle,
-					   uint64_t start, uint64_t end)
-{
-	(void) ial;
-	(void) handle;
-	(void) start;
-	(void) end;
-
-	return false;
-}
-
-static bool intel_allocator_random_unreserve(struct intel_allocator *ial,
-					     uint32_t handle,
-					     uint64_t start, uint64_t end)
-{
-	(void) ial;
-	(void) handle;
-	(void) start;
-	(void) end;
-
-	return false;
-}
-
-static bool intel_allocator_random_is_reserved(struct intel_allocator *ial,
-					       uint64_t start, uint64_t end)
-{
-	(void) ial;
-	(void) start;
-	(void) end;
-
-	return false;
-}
-
-static void intel_allocator_random_print(struct intel_allocator *ial, bool full)
-{
-	struct intel_allocator_random *ialr = ial->priv;
-
-	(void) full;
-
-	igt_info("<ial: %p, fd: %d> allocated objects: %" PRIx64 "\n",
-		 ial, ial->fd, ialr->allocated_objects);
-}
-
-static bool intel_allocator_random_is_empty(struct intel_allocator *ial)
-{
-	struct intel_allocator_random *ialr = ial->priv;
-
-	return !ialr->allocated_objects;
-}
-
-struct intel_allocator *
-intel_allocator_random_create(int fd, uint64_t start, uint64_t end)
-{
-	struct intel_allocator *ial;
-	struct intel_allocator_random *ialr;
-
-	igt_debug("Using random allocator\n");
-	ial = calloc(1, sizeof(*ial));
-	igt_assert(ial);
-
-	ial->fd = fd;
-	ial->get_address_range = intel_allocator_random_get_address_range;
-	ial->alloc = intel_allocator_random_alloc;
-	ial->free = intel_allocator_random_free;
-	ial->is_allocated = intel_allocator_random_is_allocated;
-	ial->reserve = intel_allocator_random_reserve;
-	ial->unreserve = intel_allocator_random_unreserve;
-	ial->is_reserved = intel_allocator_random_is_reserved;
-	ial->destroy = intel_allocator_random_destroy;
-	ial->print = intel_allocator_random_print;
-	ial->is_empty = intel_allocator_random_is_empty;
-
-	ialr = ial->priv = calloc(1, sizeof(*ialr));
-	igt_assert(ial->priv);
-	ialr->prng = (uint32_t) to_user_pointer(ial);
-
-	start = max_t(uint64_t, start, BIAS);
-	igt_assert(start < end);
-	ialr->start = start;
-	ialr->end = end;
-
-	ialr->allocated_objects = 0;
-
-	return ial;
-}
diff --git a/lib/meson.build b/lib/meson.build
index 8ae9fe13d1..2c6ebce7b6 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -47,7 +47,6 @@ lib_sources = [
 	'instdone.c',
 	'intel_allocator.c',
 	'intel_allocator_msgchannel.c',
-	'intel_allocator_random.c',
 	'intel_allocator_reloc.c',
 	'intel_allocator_simple.c',
 	'intel_batchbuffer.c',
diff --git a/tests/i915/api_intel_allocator.c b/tests/i915/api_intel_allocator.c
index a7929e9b13..098b9e6960 100644
--- a/tests/i915/api_intel_allocator.c
+++ b/tests/i915/api_intel_allocator.c
@@ -179,9 +179,6 @@ static void basic_alloc(int fd, int cnt, uint8_t type)
 	for (i = 0; i < cnt; i++) {
 		igt_progress("check overlapping: ", i, cnt);
 
-		if (type == INTEL_ALLOCATOR_RANDOM)
-			continue;
-
 		for (j = 0; j < cnt; j++) {
 			if (j == i)
 				continue;
@@ -307,8 +304,8 @@ static void parallel_one(int fd, uint8_t type)
 
 	/* Check if all objects are allocated */
 	for (i = 0; i < count; i++) {
-		/* Reloc + random allocators don't have state. */
-		if (type == INTEL_ALLOCATOR_RELOC || type == INTEL_ALLOCATOR_RANDOM)
+		/* Reloc don't have state. */
+		if (type == INTEL_ALLOCATOR_RELOC)
 			break;
 
 		igt_assert_eq(offsets[i],
@@ -752,7 +749,6 @@ struct allocators {
 } als[] = {
 	{"simple", INTEL_ALLOCATOR_SIMPLE},
 	{"reloc",  INTEL_ALLOCATOR_RELOC},
-	{"random", INTEL_ALLOCATOR_RANDOM},
 	{NULL, 0},
 };
 
diff --git a/tests/i915/api_intel_bb.c b/tests/i915/api_intel_bb.c
index 4c8ca6ab36..980906f4ed 100644
--- a/tests/i915/api_intel_bb.c
+++ b/tests/i915/api_intel_bb.c
@@ -1620,24 +1620,12 @@ igt_main_args("dpibc:", NULL, help_str, opt_handler, NULL)
 	igt_subtest("object-noreloc-keep-cache-simple")
 		object_noreloc(bops, KEEP_CACHE, INTEL_ALLOCATOR_SIMPLE);
 
-	igt_subtest("object-noreloc-purge-cache-random")
-		object_noreloc(bops, PURGE_CACHE, INTEL_ALLOCATOR_RANDOM);
-
-	igt_subtest("object-noreloc-keep-cache-random")
-		object_noreloc(bops, KEEP_CACHE, INTEL_ALLOCATOR_RANDOM);
-
 	igt_subtest("blit-reloc-purge-cache")
 		blit(bops, RELOC, PURGE_CACHE, INTEL_ALLOCATOR_SIMPLE);
 
 	igt_subtest("blit-reloc-keep-cache")
 		blit(bops, RELOC, KEEP_CACHE, INTEL_ALLOCATOR_SIMPLE);
 
-	igt_subtest("blit-noreloc-keep-cache-random")
-		blit(bops, NORELOC, KEEP_CACHE, INTEL_ALLOCATOR_RANDOM);
-
-	igt_subtest("blit-noreloc-purge-cache-random")
-		blit(bops, NORELOC, PURGE_CACHE, INTEL_ALLOCATOR_RANDOM);
-
 	igt_subtest("blit-noreloc-keep-cache")
 		blit(bops, NORELOC, KEEP_CACHE, INTEL_ALLOCATOR_SIMPLE);
 
-- 
2.34.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [igt-dev] [PATCH i-g-t v2 2/5] tests/api_intel_allocator: Remove duplicated reuse and reserve subtests
  2022-12-05 20:27 [igt-dev] [PATCH i-g-t v2 0/5] Remove random allocator and improve reloc one Zbigniew Kempczyński
  2022-12-05 20:27 ` [igt-dev] [PATCH i-g-t v2 1/5] lib/intel_allocator: Remove RANDOM allocator Zbigniew Kempczyński
@ 2022-12-05 20:27 ` Zbigniew Kempczyński
  2022-12-06 15:58   ` Kamil Konieczny
  2022-12-05 20:27 ` [igt-dev] [PATCH i-g-t v2 3/5] lib/intel_allocator_reloc: Introduce stateful allocations in reloc Zbigniew Kempczyński
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Zbigniew Kempczyński @ 2022-12-05 20:27 UTC (permalink / raw)
  To: igt-dev

For SIMPLE allocator those subtest are duplicated outside loop which
exercises all defined allocators. Lets remove it and not waste time
for double run.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
---
 tests/i915/api_intel_allocator.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/tests/i915/api_intel_allocator.c b/tests/i915/api_intel_allocator.c
index 098b9e6960..b55587e549 100644
--- a/tests/i915/api_intel_allocator.c
+++ b/tests/i915/api_intel_allocator.c
@@ -769,12 +769,6 @@ igt_main
 	igt_subtest_f("reserve-simple")
 		reserve_simple(fd);
 
-	igt_subtest_f("reuse")
-		reuse(fd, INTEL_ALLOCATOR_SIMPLE);
-
-	igt_subtest_f("reserve")
-		reserve(fd, INTEL_ALLOCATOR_SIMPLE);
-
 	igt_describe("For simple allocator check does default alignment is "
 		     "properly handled in open and alloc functions");
 	igt_subtest_f("default-alignment")
-- 
2.34.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [igt-dev] [PATCH i-g-t v2 3/5] lib/intel_allocator_reloc: Introduce stateful allocations in reloc
  2022-12-05 20:27 [igt-dev] [PATCH i-g-t v2 0/5] Remove random allocator and improve reloc one Zbigniew Kempczyński
  2022-12-05 20:27 ` [igt-dev] [PATCH i-g-t v2 1/5] lib/intel_allocator: Remove RANDOM allocator Zbigniew Kempczyński
  2022-12-05 20:27 ` [igt-dev] [PATCH i-g-t v2 2/5] tests/api_intel_allocator: Remove duplicated reuse and reserve subtests Zbigniew Kempczyński
@ 2022-12-05 20:27 ` Zbigniew Kempczyński
  2022-12-06 21:39   ` Kamil Konieczny
  2022-12-05 20:27 ` [igt-dev] [PATCH i-g-t v2 4/5] tests/gem_ctx_shared: Remove necessity of passing offset to function call Zbigniew Kempczyński
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Zbigniew Kempczyński @ 2022-12-05 20:27 UTC (permalink / raw)
  To: igt-dev

Till now reloc allocator was stateless - that means if we would
call alloc() twice for same handle + size, we would get consecutive
offsets (according to size and alignment). This is problematic
in library code, where we get handle and we would like to get offset
which must be same like in the caller. It wasn't possible thus library
instead of alloc() has to get offset from the caller instead. For
single object it is not big problem but passing more makes prototype
much longer and usage is inconvinient.

Introducing stateful allocations tracking in reloc solves this issue
- alloc() can be called many times in dependent code and same offset
will be returned until free().

Tracking was added to alloc()/free() only - reserve()/unreserve()
are not handled by reloc allocator at the moment at all.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
---
 lib/intel_allocator_reloc.c      | 115 ++++++++++++++++++++++++++-----
 tests/i915/api_intel_allocator.c |  21 ++++--
 2 files changed, 111 insertions(+), 25 deletions(-)

diff --git a/lib/intel_allocator_reloc.c b/lib/intel_allocator_reloc.c
index ee3ad43f4a..60cbb88511 100644
--- a/lib/intel_allocator_reloc.c
+++ b/lib/intel_allocator_reloc.c
@@ -9,11 +9,13 @@
 #include "igt_x86.h"
 #include "igt_rand.h"
 #include "intel_allocator.h"
+#include "igt_map.h"
 
 struct intel_allocator *
 intel_allocator_reloc_create(int fd, uint64_t start, uint64_t end);
 
 struct intel_allocator_reloc {
+	struct igt_map *objects;
 	uint32_t prng;
 	uint64_t start;
 	uint64_t end;
@@ -23,9 +25,41 @@ struct intel_allocator_reloc {
 	uint64_t allocated_objects;
 };
 
+struct intel_allocator_record {
+	uint32_t handle;
+	uint64_t offset;
+	uint64_t size;
+};
+
 /* Keep the low 256k clear, for negative deltas */
 #define BIAS (256 << 10)
 
+/* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */
+#define GOLDEN_RATIO_PRIME_32 0x9e370001UL
+
+/*  2^63 + 2^61 - 2^57 + 2^54 - 2^51 - 2^18 + 1 */
+#define GOLDEN_RATIO_PRIME_64 0x9e37fffffffc0001ULL
+
+static inline uint32_t hash_handles(const void *val)
+{
+	uint32_t hash = *(uint32_t *) val;
+
+	hash = hash * GOLDEN_RATIO_PRIME_32;
+	return hash;
+}
+
+static int equal_handles(const void *a, const void *b)
+{
+	uint32_t *key1 = (uint32_t *) a, *key2 = (uint32_t *) b;
+
+	return *key1 == *key2;
+}
+
+static void map_entry_free_func(struct igt_map_entry *entry)
+{
+	free(entry->data);
+}
+
 static void intel_allocator_reloc_get_address_range(struct intel_allocator *ial,
 						    uint64_t *startp,
 						    uint64_t *endp)
@@ -44,25 +78,39 @@ static uint64_t intel_allocator_reloc_alloc(struct intel_allocator *ial,
 					    uint64_t alignment,
 					    enum allocator_strategy strategy)
 {
+	struct intel_allocator_record *rec;
 	struct intel_allocator_reloc *ialr = ial->priv;
 	uint64_t offset, aligned_offset;
 
-	(void) handle;
 	(void) strategy;
 
-	aligned_offset = ALIGN(ialr->offset, alignment);
+	rec = igt_map_search(ialr->objects, &handle);
+	if (rec) {
+		offset = rec->offset;
+		igt_assert(rec->size == size);
+	} else {
+		aligned_offset = ALIGN(ialr->offset, alignment);
 
-	/* Check we won't exceed end */
-	if (aligned_offset + size > ialr->end)
-		aligned_offset = ALIGN(ialr->start, alignment);
+		/* Check we won't exceed end */
+		if (aligned_offset + size > ialr->end)
+			aligned_offset = ALIGN(ialr->start, alignment);
 
-	/* Check that the object fits in the address range */
-	if (aligned_offset + size > ialr->end)
-		return ALLOC_INVALID_ADDRESS;
+		/* Check that the object fits in the address range */
+		if (aligned_offset + size > ialr->end)
+			return ALLOC_INVALID_ADDRESS;
 
-	offset = aligned_offset;
-	ialr->offset = offset + size;
-	ialr->allocated_objects++;
+		offset = aligned_offset;
+
+		rec = malloc(sizeof(*rec));
+		rec->handle = handle;
+		rec->offset = offset;
+		rec->size = size;
+
+		igt_map_insert(ialr->objects, &rec->handle, rec);
+
+		ialr->offset = offset + size;
+		ialr->allocated_objects++;
+	}
 
 	return offset;
 }
@@ -70,30 +118,60 @@ static uint64_t intel_allocator_reloc_alloc(struct intel_allocator *ial,
 static bool intel_allocator_reloc_free(struct intel_allocator *ial,
 				       uint32_t handle)
 {
+	struct intel_allocator_record *rec = NULL;
 	struct intel_allocator_reloc *ialr = ial->priv;
+	struct igt_map_entry *entry;
 
-	(void) handle;
+	entry = igt_map_search_entry(ialr->objects, &handle);
+	if (entry) {
+		igt_map_remove_entry(ialr->objects, entry);
+		if (entry->data) {
+			rec = (struct intel_allocator_record *) entry->data;
+			ialr->allocated_objects--;
+			free(rec);
 
-	ialr->allocated_objects--;
+			return true;
+		}
+	}
 
 	return false;
 }
 
+static inline bool __same(const struct intel_allocator_record *rec,
+			  uint32_t handle, uint64_t size, uint64_t offset)
+{
+	return rec->handle == handle && rec->size == size &&
+			DECANONICAL(rec->offset) == DECANONICAL(offset);
+}
+
 static bool intel_allocator_reloc_is_allocated(struct intel_allocator *ial,
 					       uint32_t handle, uint64_t size,
 					       uint64_t offset)
 {
-	(void) ial;
-	(void) handle;
-	(void) size;
-	(void) offset;
+	struct intel_allocator_record *rec;
+	struct intel_allocator_reloc *ialr;
+	bool same = false;
 
-	return false;
+	igt_assert(ial);
+	ialr = (struct intel_allocator_reloc *) ial->priv;
+	igt_assert(ialr);
+	igt_assert(handle);
+
+	rec = igt_map_search(ialr->objects, &handle);
+	if (rec && __same(rec, handle, size, offset))
+		same = true;
+
+	return same;
 }
 
 static void intel_allocator_reloc_destroy(struct intel_allocator *ial)
 {
+	struct intel_allocator_reloc *ialr;
+
 	igt_assert(ial);
+	ialr = (struct intel_allocator_reloc *) ial->priv;
+
+	igt_map_destroy(ialr->objects, map_entry_free_func);
 
 	free(ial->priv);
 	free(ial);
@@ -174,6 +252,7 @@ intel_allocator_reloc_create(int fd, uint64_t start, uint64_t end)
 
 	ialr = ial->priv = calloc(1, sizeof(*ialr));
 	igt_assert(ial->priv);
+	ialr->objects = igt_map_create(hash_handles, equal_handles);
 	ialr->prng = (uint32_t) to_user_pointer(ial);
 
 	start = max_t(uint64_t, start, BIAS);
diff --git a/tests/i915/api_intel_allocator.c b/tests/i915/api_intel_allocator.c
index b55587e549..87abd90084 100644
--- a/tests/i915/api_intel_allocator.c
+++ b/tests/i915/api_intel_allocator.c
@@ -195,6 +195,7 @@ static void basic_alloc(int fd, int cnt, uint8_t type)
 	igt_assert_eq(intel_allocator_close(ahnd), true);
 }
 
+#define NUM_OBJS 128
 static void reuse(int fd, uint8_t type)
 {
 	struct test_obj obj[128], tmp;
@@ -204,15 +205,15 @@ static void reuse(int fd, uint8_t type)
 
 	ahnd = intel_allocator_open(fd, 0, type);
 
-	for (i = 0; i < 128; i++) {
+	for (i = 0; i < NUM_OBJS; i++) {
 		obj[i].handle = gem_handle_gen();
 		obj[i].size = OBJ_SIZE;
 		obj[i].offset = intel_allocator_alloc(ahnd, obj[i].handle,
 						      obj[i].size, align);
 	}
 
-	/* check simple reuse */
-	for (i = 0; i < 128; i++) {
+	/* check reuse */
+	for (i = 0; i < NUM_OBJS; i++) {
 		prev_offset = obj[i].offset;
 		obj[i].offset = intel_allocator_alloc(ahnd, obj[i].handle,
 						      obj[i].size, 0);
@@ -225,7 +226,13 @@ static void reuse(int fd, uint8_t type)
 	/* alloc different buffer to fill freed hole */
 	tmp.handle = gem_handle_gen();
 	tmp.offset = intel_allocator_alloc(ahnd, tmp.handle, OBJ_SIZE, align);
-	igt_assert(prev_offset == tmp.offset);
+
+	/* Simple will return previously returned offset if fits */
+	if (type == INTEL_ALLOCATOR_SIMPLE)
+		igt_assert(prev_offset == tmp.offset);
+	/* Reloc is moving forward for new allocations */
+	else if (type == INTEL_ALLOCATOR_RELOC)
+		igt_assert(prev_offset != tmp.offset);
 
 	obj[i].offset = intel_allocator_alloc(ahnd, obj[i].handle,
 					      obj[i].size, 0);
@@ -785,10 +792,10 @@ igt_main
 			igt_dynamic("print")
 				basic_alloc(fd, 1UL << 2, a->type);
 
-			if (a->type == INTEL_ALLOCATOR_SIMPLE) {
-				igt_dynamic("reuse")
-					reuse(fd, a->type);
+			igt_dynamic("reuse")
+				reuse(fd, a->type);
 
+			if (a->type == INTEL_ALLOCATOR_SIMPLE) {
 				igt_dynamic("reserve")
 					reserve(fd, a->type);
 			}
-- 
2.34.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [igt-dev] [PATCH i-g-t v2 4/5] tests/gem_ctx_shared: Remove necessity of passing offset to function call
  2022-12-05 20:27 [igt-dev] [PATCH i-g-t v2 0/5] Remove random allocator and improve reloc one Zbigniew Kempczyński
                   ` (2 preceding siblings ...)
  2022-12-05 20:27 ` [igt-dev] [PATCH i-g-t v2 3/5] lib/intel_allocator_reloc: Introduce stateful allocations in reloc Zbigniew Kempczyński
@ 2022-12-05 20:27 ` Zbigniew Kempczyński
  2022-12-06 16:31   ` Kamil Konieczny
  2022-12-05 20:27 ` [igt-dev] [PATCH i-g-t v2 5/5] tests/gem_exec_parallel: Avoid acquiring offset for overlapping handle Zbigniew Kempczyński
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Zbigniew Kempczyński @ 2022-12-05 20:27 UTC (permalink / raw)
  To: igt-dev

Previously reloc allocator wasn't stateful for allocations thus alloc()
had to be done in single place. Now this limitation is removed so
dependent function can call allocator alloc() function again without
worrying about offset change.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
---
 tests/i915/gem_ctx_shared.c | 45 ++++++++++++++++---------------------
 1 file changed, 19 insertions(+), 26 deletions(-)

diff --git a/tests/i915/gem_ctx_shared.c b/tests/i915/gem_ctx_shared.c
index d6b56b72ab..55d3d5a975 100644
--- a/tests/i915/gem_ctx_shared.c
+++ b/tests/i915/gem_ctx_shared.c
@@ -512,9 +512,9 @@ static void exec_single_timeline(int i915, const intel_ctx_cfg_t *cfg,
 }
 
 static void store_dword(int i915, uint64_t ahnd, const intel_ctx_t *ctx,
-			unsigned ring, uint32_t target, uint64_t target_offset,
+			unsigned int ring, uint32_t target, uint64_t target_size,
 			uint32_t offset, uint32_t value,
-			uint32_t cork, uint64_t cork_offset,
+			uint32_t cork, uint64_t cork_size,
 			unsigned write_domain)
 {
 	const unsigned int gen = intel_gen(intel_get_drm_devid(i915));
@@ -537,9 +537,9 @@ static void store_dword(int i915, uint64_t ahnd, const intel_ctx_t *ctx,
 	obj[1].handle = target;
 	obj[2].handle = gem_create(i915, 4096);
 	if (ahnd) {
-		obj[0].offset = cork_offset;
+		obj[0].offset = get_offset(ahnd, cork, cork_size, 0);
 		obj[0].flags |= EXEC_OBJECT_PINNED;
-		obj[1].offset = target_offset;
+		obj[1].offset = get_offset(ahnd, target, target_size, 0);
 		obj[1].flags |= EXEC_OBJECT_PINNED;
 		if (write_domain)
 			obj[1].flags |= EXEC_OBJECT_WRITE;
@@ -768,7 +768,7 @@ static void reorder(int i915, const intel_ctx_cfg_t *cfg,
 	intel_ctx_cfg_t q_cfg;
 	const intel_ctx_t *ctx[2];
 	uint32_t plug;
-	uint64_t ahnd = get_reloc_ahnd(i915, 0), scratch_offset, plug_offset;
+	uint64_t ahnd = get_reloc_ahnd(i915, 0);
 
 	q_cfg = *cfg;
 	q_cfg.vm = gem_vm_create(i915);
@@ -781,17 +781,15 @@ static void reorder(int i915, const intel_ctx_cfg_t *cfg,
 	gem_context_set_priority(i915, ctx[HI]->id, flags & EQUAL ? MIN_PRIO : 0);
 
 	scratch = gem_create(i915, 4096);
-	scratch_offset = get_offset(ahnd, scratch, 4096, 0);
 	plug = igt_cork_plug(&cork, i915);
-	plug_offset = get_offset(ahnd, plug, 4096, 0);
 
 	/* We expect the high priority context to be executed first, and
 	 * so the final result will be value from the low priority context.
 	 */
-	store_dword(i915, ahnd, ctx[LO], ring, scratch, scratch_offset,
-		    0, ctx[LO]->id, plug, plug_offset, 0);
-	store_dword(i915, ahnd, ctx[HI], ring, scratch, scratch_offset,
-		    0, ctx[HI]->id, plug, plug_offset, 0);
+	store_dword(i915, ahnd, ctx[LO], ring, scratch, 4096,
+		    0, ctx[LO]->id, plug, 4096, 0);
+	store_dword(i915, ahnd, ctx[HI], ring, scratch, 4096,
+		    0, ctx[HI]->id, plug, 4096, 0);
 
 	unplug_show_queue(i915, &cork, ahnd, &q_cfg, ring);
 	gem_close(i915, plug);
@@ -825,7 +823,6 @@ static void promotion(int i915, const intel_ctx_cfg_t *cfg, unsigned ring)
 	const intel_ctx_t *ctx[3];
 	uint32_t plug;
 	uint64_t ahnd = get_reloc_ahnd(i915, 0);
-	uint64_t result_offset, dep_offset, plug_offset;
 
 	q_cfg = *cfg;
 	q_cfg.vm = gem_vm_create(i915);
@@ -841,30 +838,27 @@ static void promotion(int i915, const intel_ctx_cfg_t *cfg, unsigned ring)
 	gem_context_set_priority(i915, ctx[NOISE]->id, 0);
 
 	result = gem_create(i915, 4096);
-	result_offset = get_offset(ahnd, result, 4096, 0);
 	dep = gem_create(i915, 4096);
-	dep_offset = get_offset(ahnd, dep, 4096, 0);
 
 	plug = igt_cork_plug(&cork, i915);
-	plug_offset = get_offset(ahnd, plug, 4096, 0);
 
 	/* Expect that HI promotes LO, so the order will be LO, HI, NOISE.
 	 *
 	 * fifo would be NOISE, LO, HI.
 	 * strict priority would be  HI, NOISE, LO
 	 */
-	store_dword(i915, ahnd, ctx[NOISE], ring, result, result_offset,
-		    0, ctx[NOISE]->id, plug, plug_offset, 0);
-	store_dword(i915, ahnd, ctx[LO], ring, result, result_offset,
-		    0, ctx[LO]->id, plug, plug_offset, 0);
+	store_dword(i915, ahnd, ctx[NOISE], ring, result, 4096,
+		    0, ctx[NOISE]->id, plug, 4096, 0);
+	store_dword(i915, ahnd, ctx[LO], ring, result, 4096,
+		    0, ctx[LO]->id, plug, 4096, 0);
 
 	/* link LO <-> HI via a dependency on another buffer */
-	store_dword(i915, ahnd, ctx[LO], ring, dep, dep_offset,
+	store_dword(i915, ahnd, ctx[LO], ring, dep, 4096,
 		    0, ctx[LO]->id, 0, 0, I915_GEM_DOMAIN_INSTRUCTION);
-	store_dword(i915, ahnd, ctx[HI], ring, dep, dep_offset,
+	store_dword(i915, ahnd, ctx[HI], ring, dep, 4096,
 		    0, ctx[HI]->id, 0, 0, 0);
 
-	store_dword(i915, ahnd, ctx[HI], ring, result, result_offset,
+	store_dword(i915, ahnd, ctx[HI], ring, result, 4096,
 		    0, ctx[HI]->id, 0, 0, 0);
 
 	unplug_show_queue(i915, &cork, ahnd, &q_cfg, ring);
@@ -908,7 +902,6 @@ static void smoketest(int i915, const intel_ctx_cfg_t *cfg,
 	uint32_t scratch;
 	uint32_t *ptr;
 	uint64_t ahnd = get_reloc_ahnd(i915, 0); /* same vm */
-	uint64_t scratch_offset;
 
 	q_cfg = *cfg;
 	q_cfg.vm = gem_vm_create(i915);
@@ -926,7 +919,7 @@ static void smoketest(int i915, const intel_ctx_cfg_t *cfg,
 	igt_require(nengine);
 
 	scratch = gem_create(i915, 4096);
-	scratch_offset = get_offset(ahnd, scratch, 4096, 0);
+
 	igt_fork(child, ncpus) {
 		unsigned long count = 0;
 		const intel_ctx_t *ctx;
@@ -943,12 +936,12 @@ static void smoketest(int i915, const intel_ctx_cfg_t *cfg,
 
 			engine = engines[hars_petruska_f54_1_random_unsafe_max(nengine)];
 			store_dword(i915, ahnd, ctx, engine,
-				    scratch, scratch_offset,
+				    scratch, 4096,
 				    8*child + 0, ~child,
 				    0, 0, 0);
 			for (unsigned int step = 0; step < 8; step++)
 				store_dword(i915, ahnd, ctx, engine,
-					    scratch, scratch_offset,
+					    scratch, 4096,
 					    8*child + 4, count++,
 					    0, 0, 0);
 		}
-- 
2.34.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [igt-dev] [PATCH i-g-t v2 5/5] tests/gem_exec_parallel: Avoid acquiring offset for overlapping handle
  2022-12-05 20:27 [igt-dev] [PATCH i-g-t v2 0/5] Remove random allocator and improve reloc one Zbigniew Kempczyński
                   ` (3 preceding siblings ...)
  2022-12-05 20:27 ` [igt-dev] [PATCH i-g-t v2 4/5] tests/gem_ctx_shared: Remove necessity of passing offset to function call Zbigniew Kempczyński
@ 2022-12-05 20:27 ` Zbigniew Kempczyński
  2022-12-06 17:06   ` Kamil Konieczny
  2022-12-05 21:06 ` [igt-dev] ✓ Fi.CI.BAT: success for Remove random allocator and improve reloc one (rev2) Patchwork
  2022-12-05 22:24 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  6 siblings, 1 reply; 14+ messages in thread
From: Zbigniew Kempczyński @ 2022-12-05 20:27 UTC (permalink / raw)
  To: igt-dev

Subtest @fds incorporates objects created in some context in new context
created on new (reopened) drm fd. This might lead to clash handles
(same handle created over different fd,ctx) so acquiring offsets from
stateful allocator (reloc is from now on stateful for alloc()/free()
ops) might lead to bind same offset for two different objects. Lets
use some artificial (last max handle + 1) handle for bb to avoid offset
overlapping.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
---
 tests/i915/gem_exec_parallel.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/tests/i915/gem_exec_parallel.c b/tests/i915/gem_exec_parallel.c
index 730fc4a672..429620884b 100644
--- a/tests/i915/gem_exec_parallel.c
+++ b/tests/i915/gem_exec_parallel.c
@@ -75,7 +75,7 @@ static void *thread(void *data)
 	struct drm_i915_gem_relocation_entry reloc;
 	struct drm_i915_gem_execbuffer2 execbuf;
 	const intel_ctx_t *tmp_ctx = NULL;
-	uint64_t offset;
+	uint64_t offset, bb_offset;
 	uint32_t batch[16];
 	uint16_t used;
 	int fd, i;
@@ -136,6 +136,18 @@ static void *thread(void *data)
 		execbuf.rsvd1 = t->ctx->id;
 	}
 
+	/*
+	 * For FDS we have new drm fd, what means gem_create() for bb returns
+	 * handle == 1. As we're using objects from other fd it would overlap,
+	 * thus we need to acquire offset for bb from last handle + 1.
+	 * Other cases are within same fd, so obj[1].handle will be distinguish
+	 * anyway.
+	 */
+	if (t->flags & FDS)
+		bb_offset = get_offset(t->ahnd, t->scratch[NUMOBJ - 1] + 1, 4096, 0);
+	else
+		bb_offset = get_offset(t->ahnd, obj[1].handle, 4096, 0);
+
 	used = 0;
 	igt_until_timeout(1) {
 		unsigned int x = rand() % NUMOBJ;
@@ -154,7 +166,7 @@ static void *thread(void *data)
 			obj[0].offset = offset;
 			obj[0].flags |= EXEC_OBJECT_PINNED | EXEC_OBJECT_WRITE |
 					EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
-			obj[1].offset = get_offset(t->ahnd, obj[1].handle, 4096, 0);
+			obj[1].offset = bb_offset;
 			obj[1].flags |= EXEC_OBJECT_PINNED | EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
 			gem_write(fd, obj[1].handle, 0, batch, sizeof(batch));
 		}
-- 
2.34.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for Remove random allocator and improve reloc one (rev2)
  2022-12-05 20:27 [igt-dev] [PATCH i-g-t v2 0/5] Remove random allocator and improve reloc one Zbigniew Kempczyński
                   ` (4 preceding siblings ...)
  2022-12-05 20:27 ` [igt-dev] [PATCH i-g-t v2 5/5] tests/gem_exec_parallel: Avoid acquiring offset for overlapping handle Zbigniew Kempczyński
@ 2022-12-05 21:06 ` Patchwork
  2022-12-05 22:24 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  6 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2022-12-05 21:06 UTC (permalink / raw)
  To: Zbigniew Kempczyński; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 8651 bytes --]

== Series Details ==

Series: Remove random allocator and improve reloc one (rev2)
URL   : https://patchwork.freedesktop.org/series/111533/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_12469 -> IGTPW_8195
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/index.html

Participating hosts (43 -> 32)
------------------------------

  Additional (2): fi-hsw-4770 bat-dg1-6 
  Missing    (13): fi-kbl-soraka bat-kbl-2 bat-adls-5 bat-adlp-9 fi-bsw-n3050 bat-dg1-5 bat-dg2-8 bat-dg2-9 bat-adlp-6 bat-adlp-4 bat-jsl-3 bat-dg2-11 fi-bsw-nick 

Known issues
------------

  Here are the changes found in IGTPW_8195 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_mmap@basic:
    - bat-dg1-6:          NOTRUN -> [SKIP][1] ([i915#4083])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/bat-dg1-6/igt@gem_mmap@basic.html

  * igt@gem_render_tiled_blits@basic:
    - bat-dg1-6:          NOTRUN -> [SKIP][2] ([i915#4079]) +1 similar issue
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/bat-dg1-6/igt@gem_render_tiled_blits@basic.html

  * igt@gem_tiled_fence_blits@basic:
    - bat-dg1-6:          NOTRUN -> [SKIP][3] ([i915#4077]) +2 similar issues
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/bat-dg1-6/igt@gem_tiled_fence_blits@basic.html

  * igt@i915_pm_backlight@basic-brightness:
    - bat-dg1-6:          NOTRUN -> [SKIP][4] ([i915#7561])
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/bat-dg1-6/igt@i915_pm_backlight@basic-brightness.html

  * igt@i915_pm_rps@basic-api:
    - bat-dg1-6:          NOTRUN -> [SKIP][5] ([i915#6621])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/bat-dg1-6/igt@i915_pm_rps@basic-api.html

  * igt@kms_addfb_basic@addfb25-y-tiled-small-legacy:
    - fi-hsw-4770:        NOTRUN -> [SKIP][6] ([fdo#109271]) +11 similar issues
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/fi-hsw-4770/igt@kms_addfb_basic@addfb25-y-tiled-small-legacy.html

  * igt@kms_addfb_basic@basic-y-tiled-legacy:
    - bat-dg1-6:          NOTRUN -> [SKIP][7] ([i915#4215])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/bat-dg1-6/igt@kms_addfb_basic@basic-y-tiled-legacy.html

  * igt@kms_addfb_basic@tile-pitch-mismatch:
    - bat-dg1-6:          NOTRUN -> [SKIP][8] ([i915#4212]) +7 similar issues
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/bat-dg1-6/igt@kms_addfb_basic@tile-pitch-mismatch.html

  * igt@kms_chamelium@dp-crc-fast:
    - fi-hsw-4770:        NOTRUN -> [SKIP][9] ([fdo#109271] / [fdo#111827]) +8 similar issues
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/fi-hsw-4770/igt@kms_chamelium@dp-crc-fast.html

  * igt@kms_chamelium@hdmi-crc-fast:
    - bat-dg1-6:          NOTRUN -> [SKIP][10] ([fdo#111827]) +8 similar issues
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/bat-dg1-6/igt@kms_chamelium@hdmi-crc-fast.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor:
    - bat-dg1-6:          NOTRUN -> [SKIP][11] ([i915#4103] / [i915#4213])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/bat-dg1-6/igt@kms_cursor_legacy@basic-busy-flip-before-cursor.html

  * igt@kms_force_connector_basic@force-load-detect:
    - bat-dg1-6:          NOTRUN -> [SKIP][12] ([fdo#109285])
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/bat-dg1-6/igt@kms_force_connector_basic@force-load-detect.html

  * igt@kms_psr@sprite_plane_onoff:
    - bat-dg1-6:          NOTRUN -> [SKIP][13] ([i915#1072] / [i915#4078]) +3 similar issues
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/bat-dg1-6/igt@kms_psr@sprite_plane_onoff.html
    - fi-hsw-4770:        NOTRUN -> [SKIP][14] ([fdo#109271] / [i915#1072]) +3 similar issues
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/fi-hsw-4770/igt@kms_psr@sprite_plane_onoff.html

  * igt@kms_setmode@basic-clone-single-crtc:
    - bat-dg1-6:          NOTRUN -> [SKIP][15] ([i915#3555])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/bat-dg1-6/igt@kms_setmode@basic-clone-single-crtc.html

  * igt@prime_vgem@basic-gtt:
    - bat-dg1-6:          NOTRUN -> [SKIP][16] ([i915#3708] / [i915#4077]) +1 similar issue
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/bat-dg1-6/igt@prime_vgem@basic-gtt.html

  * igt@prime_vgem@basic-read:
    - bat-dg1-6:          NOTRUN -> [SKIP][17] ([i915#3708]) +3 similar issues
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/bat-dg1-6/igt@prime_vgem@basic-read.html

  * igt@prime_vgem@basic-userptr:
    - bat-dg1-6:          NOTRUN -> [SKIP][18] ([i915#3708] / [i915#4873])
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/bat-dg1-6/igt@prime_vgem@basic-userptr.html

  
#### Possible fixes ####

  * igt@i915_module_load@reload:
    - {bat-rpls-2}:       [DMESG-WARN][19] ([i915#6434]) -> [PASS][20]
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/bat-rpls-2/igt@i915_module_load@reload.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/bat-rpls-2/igt@i915_module_load@reload.html

  * igt@i915_suspend@basic-s2idle-without-i915:
    - fi-apl-guc:         [DMESG-WARN][21] ([i915#1982]) -> [PASS][22]
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/fi-apl-guc/igt@i915_suspend@basic-s2idle-without-i915.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/fi-apl-guc/igt@i915_suspend@basic-s2idle-without-i915.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions:
    - fi-bsw-kefka:       [FAIL][23] ([i915#6298]) -> [PASS][24]
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
  [i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
  [i915#2411]: https://gitlab.freedesktop.org/drm/intel/issues/2411
  [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
  [i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
  [i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
  [i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078
  [i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
  [i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
  [i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
  [i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212
  [i915#4213]: https://gitlab.freedesktop.org/drm/intel/issues/4213
  [i915#4215]: https://gitlab.freedesktop.org/drm/intel/issues/4215
  [i915#4873]: https://gitlab.freedesktop.org/drm/intel/issues/4873
  [i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
  [i915#6298]: https://gitlab.freedesktop.org/drm/intel/issues/6298
  [i915#6434]: https://gitlab.freedesktop.org/drm/intel/issues/6434
  [i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
  [i915#6856]: https://gitlab.freedesktop.org/drm/intel/issues/6856
  [i915#7125]: https://gitlab.freedesktop.org/drm/intel/issues/7125
  [i915#7561]: https://gitlab.freedesktop.org/drm/intel/issues/7561


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_7083 -> IGTPW_8195

  CI-20190529: 20190529
  CI_DRM_12469: 886c7f9510ce20f099d27d9e7d9de32402c9e5e6 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_8195: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/index.html
  IGT_7083: c001793d5f22deb01918b6ba52af829794582df1 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git


Testlist changes
----------------

-igt@api_intel_allocator@random-allocator
-igt@api_intel_allocator@reserve
-igt@api_intel_allocator@reuse
-igt@api_intel_bb@blit-noreloc-keep-cache-random
-igt@api_intel_bb@blit-noreloc-purge-cache-random
-igt@api_intel_bb@object-noreloc-keep-cache-random
-igt@api_intel_bb@object-noreloc-purge-cache-random

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/index.html

[-- Attachment #2: Type: text/html, Size: 10006 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [igt-dev] ✓ Fi.CI.IGT: success for Remove random allocator and improve reloc one (rev2)
  2022-12-05 20:27 [igt-dev] [PATCH i-g-t v2 0/5] Remove random allocator and improve reloc one Zbigniew Kempczyński
                   ` (5 preceding siblings ...)
  2022-12-05 21:06 ` [igt-dev] ✓ Fi.CI.BAT: success for Remove random allocator and improve reloc one (rev2) Patchwork
@ 2022-12-05 22:24 ` Patchwork
  6 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2022-12-05 22:24 UTC (permalink / raw)
  To: Zbigniew Kempczyński; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 43122 bytes --]

== Series Details ==

Series: Remove random allocator and improve reloc one (rev2)
URL   : https://patchwork.freedesktop.org/series/111533/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_12469_full -> IGTPW_8195_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/index.html

Participating hosts (12 -> 11)
------------------------------

  Additional (2): shard-rkl shard-dg1 
  Missing    (3): pig-skl-6260u pig-kbl-iris pig-glk-j5005 

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_8195_full:

### IGT changes ###

#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@gem_create@hog-create@smem0:
    - {shard-dg1}:        NOTRUN -> [CRASH][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-dg1-17/igt@gem_create@hog-create@smem0.html

  * igt@gem_ctx_isolation@preservation@bcs0:
    - {shard-rkl}:        NOTRUN -> [FAIL][2] +17 similar issues
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-rkl-6/igt@gem_ctx_isolation@preservation@bcs0.html

  * igt@gem_ctx_isolation@preservation@vcs1:
    - {shard-dg1}:        NOTRUN -> [FAIL][3] +27 similar issues
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-dg1-13/igt@gem_ctx_isolation@preservation@vcs1.html

  * igt@gen9_exec_parse@allowed-all:
    - {shard-rkl}:        NOTRUN -> [DMESG-WARN][4]
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-rkl-5/igt@gen9_exec_parse@allowed-all.html

  * igt@kms_vblank@pipe-d-wait-forked-busy-hang:
    - {shard-tglu-9}:     NOTRUN -> [SKIP][5] +45 similar issues
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglu-9/igt@kms_vblank@pipe-d-wait-forked-busy-hang.html

  
New tests
---------

  New tests have been introduced between CI_DRM_12469_full and IGTPW_8195_full:

### New IGT tests (1) ###

  * igt@api_intel_allocator@reloc-allocator@reuse:
    - Statuses : 6 pass(s)
    - Exec time: [0.0] s

  

Known issues
------------

  Here are the changes found in IGTPW_8195_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_ctx_persistence@many-contexts:
    - shard-tglb:         NOTRUN -> [FAIL][6] ([i915#2410])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglb7/igt@gem_ctx_persistence@many-contexts.html

  * igt@gem_ctx_persistence@smoketest:
    - shard-iclb:         [PASS][7] -> [FAIL][8] ([i915#5099])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-iclb8/igt@gem_ctx_persistence@smoketest.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb2/igt@gem_ctx_persistence@smoketest.html

  * igt@gem_exec_balancer@parallel-out-fence:
    - shard-iclb:         [PASS][9] -> [SKIP][10] ([i915#4525])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-iclb2/igt@gem_exec_balancer@parallel-out-fence.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb5/igt@gem_exec_balancer@parallel-out-fence.html

  * igt@gem_exec_fair@basic-deadline:
    - shard-glk:          [PASS][11] -> [FAIL][12] ([i915#2846])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-glk3/igt@gem_exec_fair@basic-deadline.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-glk7/igt@gem_exec_fair@basic-deadline.html

  * igt@gem_exec_fair@basic-none-rrul@rcs0:
    - shard-glk:          NOTRUN -> [FAIL][13] ([i915#2842])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-glk9/igt@gem_exec_fair@basic-none-rrul@rcs0.html

  * igt@gem_exec_fair@basic-none@vcs1:
    - shard-iclb:         NOTRUN -> [FAIL][14] ([i915#2842]) +1 similar issue
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb2/igt@gem_exec_fair@basic-none@vcs1.html

  * igt@gem_exec_fair@basic-pace-solo@rcs0:
    - shard-tglb:         NOTRUN -> [FAIL][15] ([i915#2842])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglb6/igt@gem_exec_fair@basic-pace-solo@rcs0.html

  * igt@gem_exec_fair@basic-pace@rcs0:
    - shard-glk:          [PASS][16] -> [FAIL][17] ([i915#2842]) +1 similar issue
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-glk2/igt@gem_exec_fair@basic-pace@rcs0.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-glk8/igt@gem_exec_fair@basic-pace@rcs0.html

  * igt@gem_lmem_swapping@parallel-random:
    - shard-glk:          NOTRUN -> [SKIP][18] ([fdo#109271] / [i915#4613]) +2 similar issues
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-glk5/igt@gem_lmem_swapping@parallel-random.html

  * igt@gem_lmem_swapping@parallel-random-engines:
    - shard-apl:          NOTRUN -> [SKIP][19] ([fdo#109271] / [i915#4613]) +2 similar issues
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-apl7/igt@gem_lmem_swapping@parallel-random-engines.html
    - shard-tglb:         NOTRUN -> [SKIP][20] ([i915#4613]) +1 similar issue
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglb7/igt@gem_lmem_swapping@parallel-random-engines.html

  * igt@gem_lmem_swapping@random-engines:
    - shard-iclb:         NOTRUN -> [SKIP][21] ([i915#4613]) +1 similar issue
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb6/igt@gem_lmem_swapping@random-engines.html

  * igt@gem_render_copy@y-tiled-mc-ccs-to-vebox-yf-tiled:
    - shard-iclb:         NOTRUN -> [SKIP][22] ([i915#768])
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb5/igt@gem_render_copy@y-tiled-mc-ccs-to-vebox-yf-tiled.html

  * igt@gen9_exec_parse@bb-chained:
    - shard-tglb:         NOTRUN -> [SKIP][23] ([i915#2527] / [i915#2856])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglb6/igt@gen9_exec_parse@bb-chained.html
    - shard-iclb:         NOTRUN -> [SKIP][24] ([i915#2856])
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb7/igt@gen9_exec_parse@bb-chained.html

  * igt@i915_pm_dc@dc6-psr:
    - shard-iclb:         [PASS][25] -> [FAIL][26] ([i915#3989] / [i915#454])
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-iclb5/igt@i915_pm_dc@dc6-psr.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb7/igt@i915_pm_dc@dc6-psr.html

  * igt@i915_pm_dc@dc9-dpms:
    - shard-tglb:         NOTRUN -> [SKIP][27] ([i915#4281])
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglb2/igt@i915_pm_dc@dc9-dpms.html

  * igt@i915_pm_rps@engine-order:
    - shard-apl:          [PASS][28] -> [FAIL][29] ([i915#6537])
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-apl2/igt@i915_pm_rps@engine-order.html
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-apl6/igt@i915_pm_rps@engine-order.html

  * igt@i915_query@test-query-geometry-subslices:
    - shard-iclb:         NOTRUN -> [SKIP][30] ([i915#5723])
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb7/igt@i915_query@test-query-geometry-subslices.html
    - shard-tglb:         NOTRUN -> [SKIP][31] ([i915#5723])
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglb2/igt@i915_query@test-query-geometry-subslices.html

  * igt@i915_selftest@live@hangcheck:
    - shard-iclb:         [PASS][32] -> [INCOMPLETE][33] ([i915#5153] / [i915#6106])
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-iclb8/igt@i915_selftest@live@hangcheck.html
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb3/igt@i915_selftest@live@hangcheck.html

  * igt@i915_suspend@basic-s3-without-i915:
    - shard-snb:          [PASS][34] -> [INCOMPLETE][35] ([i915#4528] / [i915#4817])
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-snb5/igt@i915_suspend@basic-s3-without-i915.html
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-snb7/igt@i915_suspend@basic-s3-without-i915.html

  * igt@kms_atomic@atomic_plane_damage:
    - shard-iclb:         NOTRUN -> [SKIP][36] ([i915#4765])
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb1/igt@kms_atomic@atomic_plane_damage.html

  * igt@kms_atomic@plane-primary-overlay-mutable-zpos:
    - shard-tglb:         NOTRUN -> [SKIP][37] ([i915#404])
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglb5/igt@kms_atomic@plane-primary-overlay-mutable-zpos.html
    - shard-iclb:         NOTRUN -> [SKIP][38] ([i915#404])
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb8/igt@kms_atomic@plane-primary-overlay-mutable-zpos.html

  * igt@kms_big_fb@linear-32bpp-rotate-270:
    - shard-apl:          NOTRUN -> [SKIP][39] ([fdo#109271]) +65 similar issues
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-apl7/igt@kms_big_fb@linear-32bpp-rotate-270.html
    - shard-tglb:         NOTRUN -> [SKIP][40] ([fdo#111614]) +1 similar issue
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglb2/igt@kms_big_fb@linear-32bpp-rotate-270.html

  * igt@kms_big_fb@x-tiled-16bpp-rotate-180:
    - shard-glk:          [PASS][41] -> [DMESG-FAIL][42] ([i915#118] / [i915#5138])
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-glk9/igt@kms_big_fb@x-tiled-16bpp-rotate-180.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-glk1/igt@kms_big_fb@x-tiled-16bpp-rotate-180.html

  * igt@kms_big_fb@y-tiled-8bpp-rotate-90:
    - shard-iclb:         NOTRUN -> [SKIP][43] ([fdo#110725] / [fdo#111614]) +1 similar issue
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb8/igt@kms_big_fb@y-tiled-8bpp-rotate-90.html

  * igt@kms_ccs@pipe-a-bad-pixel-format-y_tiled_gen12_mc_ccs:
    - shard-apl:          NOTRUN -> [SKIP][44] ([fdo#109271] / [i915#3886]) +1 similar issue
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-apl1/igt@kms_ccs@pipe-a-bad-pixel-format-y_tiled_gen12_mc_ccs.html

  * igt@kms_ccs@pipe-b-crc-sprite-planes-basic-4_tiled_dg2_rc_ccs_cc:
    - shard-tglb:         NOTRUN -> [SKIP][45] ([i915#3689] / [i915#6095]) +1 similar issue
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglb7/igt@kms_ccs@pipe-b-crc-sprite-planes-basic-4_tiled_dg2_rc_ccs_cc.html
    - shard-iclb:         NOTRUN -> [SKIP][46] ([fdo#109278]) +6 similar issues
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb1/igt@kms_ccs@pipe-b-crc-sprite-planes-basic-4_tiled_dg2_rc_ccs_cc.html

  * igt@kms_ccs@pipe-c-crc-primary-basic-y_tiled_gen12_mc_ccs:
    - shard-glk:          NOTRUN -> [SKIP][47] ([fdo#109271] / [i915#3886]) +4 similar issues
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-glk5/igt@kms_ccs@pipe-c-crc-primary-basic-y_tiled_gen12_mc_ccs.html

  * igt@kms_ccs@pipe-c-missing-ccs-buffer-yf_tiled_ccs:
    - shard-tglb:         NOTRUN -> [SKIP][48] ([fdo#111615] / [i915#3689])
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglb7/igt@kms_ccs@pipe-c-missing-ccs-buffer-yf_tiled_ccs.html

  * igt@kms_ccs@pipe-c-random-ccs-data-4_tiled_dg2_rc_ccs_cc:
    - shard-tglb:         NOTRUN -> [SKIP][49] ([i915#6095])
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglb3/igt@kms_ccs@pipe-c-random-ccs-data-4_tiled_dg2_rc_ccs_cc.html

  * igt@kms_ccs@pipe-d-bad-rotation-90-4_tiled_dg2_rc_ccs_cc:
    - shard-tglb:         NOTRUN -> [SKIP][50] ([i915#3689])
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglb1/igt@kms_ccs@pipe-d-bad-rotation-90-4_tiled_dg2_rc_ccs_cc.html

  * igt@kms_chamelium@dp-frame-dump:
    - shard-apl:          NOTRUN -> [SKIP][51] ([fdo#109271] / [fdo#111827]) +5 similar issues
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-apl8/igt@kms_chamelium@dp-frame-dump.html

  * igt@kms_chamelium@dp-hpd-for-each-pipe:
    - shard-glk:          NOTRUN -> [SKIP][52] ([fdo#109271] / [fdo#111827]) +6 similar issues
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-glk8/igt@kms_chamelium@dp-hpd-for-each-pipe.html

  * igt@kms_chamelium@hdmi-audio-edid:
    - shard-tglb:         NOTRUN -> [SKIP][53] ([fdo#109284] / [fdo#111827]) +2 similar issues
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglb6/igt@kms_chamelium@hdmi-audio-edid.html
    - shard-iclb:         NOTRUN -> [SKIP][54] ([fdo#109284] / [fdo#111827]) +2 similar issues
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb1/igt@kms_chamelium@hdmi-audio-edid.html

  * igt@kms_chamelium@hdmi-hpd-fast:
    - shard-snb:          NOTRUN -> [SKIP][55] ([fdo#109271] / [fdo#111827]) +6 similar issues
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-snb4/igt@kms_chamelium@hdmi-hpd-fast.html

  * igt@kms_content_protection@lic@pipe-a-dp-1:
    - shard-apl:          NOTRUN -> [TIMEOUT][56] ([i915#7173])
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-apl2/igt@kms_content_protection@lic@pipe-a-dp-1.html

  * igt@kms_content_protection@mei_interface:
    - shard-tglb:         NOTRUN -> [SKIP][57] ([i915#7118])
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglb3/igt@kms_content_protection@mei_interface.html
    - shard-iclb:         NOTRUN -> [SKIP][58] ([i915#7118])
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb5/igt@kms_content_protection@mei_interface.html

  * igt@kms_cursor_crc@cursor-offscreen-512x170:
    - shard-tglb:         NOTRUN -> [SKIP][59] ([fdo#109279] / [i915#3359])
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglb2/igt@kms_cursor_crc@cursor-offscreen-512x170.html
    - shard-iclb:         NOTRUN -> [SKIP][60] ([fdo#109279] / [i915#3359])
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb2/igt@kms_cursor_crc@cursor-offscreen-512x170.html

  * igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions:
    - shard-tglb:         [PASS][61] -> [FAIL][62] ([i915#2346]) +1 similar issue
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-tglb3/igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions.html
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglb6/igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions.html

  * igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions-varying-size:
    - shard-glk:          [PASS][63] -> [FAIL][64] ([i915#2346])
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-glk6/igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions-varying-size.html
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-glk6/igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions-varying-size.html

  * igt@kms_dither@fb-8bpc-vs-panel-8bpc:
    - shard-tglb:         NOTRUN -> [SKIP][65] ([i915#1769] / [i915#3555])
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglb2/igt@kms_dither@fb-8bpc-vs-panel-8bpc.html

  * igt@kms_flip@flip-vs-expired-vblank-interruptible@a-dp1:
    - shard-apl:          [PASS][66] -> [FAIL][67] ([i915#79])
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-apl3/igt@kms_flip@flip-vs-expired-vblank-interruptible@a-dp1.html
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-apl1/igt@kms_flip@flip-vs-expired-vblank-interruptible@a-dp1.html

  * igt@kms_flip@flip-vs-expired-vblank-interruptible@a-hdmi-a2:
    - shard-glk:          NOTRUN -> [FAIL][68] ([i915#79])
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-glk7/igt@kms_flip@flip-vs-expired-vblank-interruptible@a-hdmi-a2.html

  * igt@kms_flip@flip-vs-suspend-interruptible@d-edp1:
    - shard-tglb:         [PASS][69] -> [INCOMPLETE][70] ([i915#2411])
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-tglb7/igt@kms_flip@flip-vs-suspend-interruptible@d-edp1.html
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglb5/igt@kms_flip@flip-vs-suspend-interruptible@d-edp1.html

  * igt@kms_flip_scaled_crc@flip-32bpp-4tile-to-32bpp-4tiledg2rcccs-downscaling@pipe-a-default-mode:
    - shard-iclb:         NOTRUN -> [SKIP][71] ([i915#2672]) +1 similar issue
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb3/igt@kms_flip_scaled_crc@flip-32bpp-4tile-to-32bpp-4tiledg2rcccs-downscaling@pipe-a-default-mode.html

  * igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytilegen12rcccs-downscaling@pipe-a-default-mode:
    - shard-iclb:         NOTRUN -> [SKIP][72] ([i915#2672] / [i915#3555])
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb2/igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytilegen12rcccs-downscaling@pipe-a-default-mode.html

  * igt@kms_flip_scaled_crc@flip-64bpp-linear-to-32bpp-linear-downscaling@pipe-a-default-mode:
    - shard-iclb:         NOTRUN -> [SKIP][73] ([i915#3555])
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb2/igt@kms_flip_scaled_crc@flip-64bpp-linear-to-32bpp-linear-downscaling@pipe-a-default-mode.html

  * igt@kms_flip_scaled_crc@flip-64bpp-yftile-to-16bpp-yftile-upscaling@pipe-a-valid-mode:
    - shard-iclb:         NOTRUN -> [SKIP][74] ([i915#2587] / [i915#2672]) +4 similar issues
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb1/igt@kms_flip_scaled_crc@flip-64bpp-yftile-to-16bpp-yftile-upscaling@pipe-a-valid-mode.html

  * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-pri-shrfb-draw-blt:
    - shard-tglb:         NOTRUN -> [SKIP][75] ([fdo#109280] / [fdo#111825]) +7 similar issues
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglb1/igt@kms_frontbuffer_tracking@fbc-2p-primscrn-pri-shrfb-draw-blt.html

  * igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-pri-indfb-draw-render:
    - shard-iclb:         NOTRUN -> [SKIP][76] ([fdo#109280]) +6 similar issues
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb5/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-pri-indfb-draw-render.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-shrfb-pgflip-blt:
    - shard-tglb:         NOTRUN -> [SKIP][77] ([i915#6497]) +1 similar issue
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglb7/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-shrfb-pgflip-blt.html

  * igt@kms_frontbuffer_tracking@psr-2p-scndscrn-spr-indfb-draw-mmap-cpu:
    - shard-glk:          NOTRUN -> [SKIP][78] ([fdo#109271]) +106 similar issues
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-glk1/igt@kms_frontbuffer_tracking@psr-2p-scndscrn-spr-indfb-draw-mmap-cpu.html

  * igt@kms_plane_alpha_blend@alpha-basic@pipe-c-dp-1:
    - shard-apl:          NOTRUN -> [FAIL][79] ([i915#4573]) +2 similar issues
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-apl1/igt@kms_plane_alpha_blend@alpha-basic@pipe-c-dp-1.html

  * igt@kms_plane_scaling@planes-downscale-factor-0-5@pipe-a-edp-1:
    - shard-iclb:         [PASS][80] -> [SKIP][81] ([i915#5235]) +2 similar issues
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-iclb6/igt@kms_plane_scaling@planes-downscale-factor-0-5@pipe-a-edp-1.html
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb2/igt@kms_plane_scaling@planes-downscale-factor-0-5@pipe-a-edp-1.html

  * igt@kms_psr2_sf@overlay-plane-move-continuous-sf:
    - shard-glk:          NOTRUN -> [SKIP][82] ([fdo#109271] / [i915#658]) +1 similar issue
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-glk5/igt@kms_psr2_sf@overlay-plane-move-continuous-sf.html

  * igt@kms_psr2_sf@overlay-plane-update-continuous-sf:
    - shard-apl:          NOTRUN -> [SKIP][83] ([fdo#109271] / [i915#658])
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-apl8/igt@kms_psr2_sf@overlay-plane-update-continuous-sf.html
    - shard-tglb:         NOTRUN -> [SKIP][84] ([i915#2920])
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglb5/igt@kms_psr2_sf@overlay-plane-update-continuous-sf.html
    - shard-iclb:         NOTRUN -> [SKIP][85] ([fdo#111068] / [i915#658])
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb8/igt@kms_psr2_sf@overlay-plane-update-continuous-sf.html

  * igt@kms_psr2_su@frontbuffer-xrgb8888:
    - shard-iclb:         NOTRUN -> [SKIP][86] ([fdo#109642] / [fdo#111068] / [i915#658])
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb7/igt@kms_psr2_su@frontbuffer-xrgb8888.html

  * igt@kms_psr2_su@page_flip-p010@pipe-b-edp-1:
    - shard-iclb:         NOTRUN -> [FAIL][87] ([i915#5939]) +2 similar issues
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb2/igt@kms_psr2_su@page_flip-p010@pipe-b-edp-1.html

  * igt@kms_psr@psr2_suspend:
    - shard-iclb:         [PASS][88] -> [SKIP][89] ([fdo#109441]) +1 similar issue
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-iclb2/igt@kms_psr@psr2_suspend.html
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb8/igt@kms_psr@psr2_suspend.html

  * igt@kms_psr_stress_test@flip-primary-invalidate-overlay:
    - shard-tglb:         [PASS][90] -> [SKIP][91] ([i915#5519])
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-tglb3/igt@kms_psr_stress_test@flip-primary-invalidate-overlay.html
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglb1/igt@kms_psr_stress_test@flip-primary-invalidate-overlay.html

  * igt@kms_psr_stress_test@invalidate-primary-flip-overlay:
    - shard-iclb:         [PASS][92] -> [SKIP][93] ([i915#5519])
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-iclb3/igt@kms_psr_stress_test@invalidate-primary-flip-overlay.html
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb8/igt@kms_psr_stress_test@invalidate-primary-flip-overlay.html

  * igt@kms_rotation_crc@bad-pixel-format:
    - shard-snb:          NOTRUN -> [SKIP][94] ([fdo#109271]) +126 similar issues
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-snb4/igt@kms_rotation_crc@bad-pixel-format.html

  * igt@kms_vblank@pipe-d-wait-idle:
    - shard-glk:          NOTRUN -> [SKIP][95] ([fdo#109271] / [i915#533])
   [95]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-glk4/igt@kms_vblank@pipe-d-wait-idle.html

  * igt@perf@gen12-oa-tlb-invalidate:
    - shard-iclb:         NOTRUN -> [SKIP][96] ([fdo#109289])
   [96]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb7/igt@perf@gen12-oa-tlb-invalidate.html

  * igt@sysfs_clients@recycle-many:
    - shard-glk:          NOTRUN -> [SKIP][97] ([fdo#109271] / [i915#2994])
   [97]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-glk6/igt@sysfs_clients@recycle-many.html

  
#### Possible fixes ####

  * igt@gem_exec_balancer@parallel-balancer:
    - shard-iclb:         [SKIP][98] ([i915#4525]) -> [PASS][99]
   [98]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-iclb3/igt@gem_exec_balancer@parallel-balancer.html
   [99]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb1/igt@gem_exec_balancer@parallel-balancer.html

  * igt@gem_exec_fair@basic-none-share@rcs0:
    - shard-glk:          [FAIL][100] ([i915#2842]) -> [PASS][101]
   [100]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-glk3/igt@gem_exec_fair@basic-none-share@rcs0.html
   [101]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-glk6/igt@gem_exec_fair@basic-none-share@rcs0.html

  * igt@gem_exec_fair@basic-pace-share@rcs0:
    - shard-tglb:         [FAIL][102] ([i915#2842]) -> [PASS][103]
   [102]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-tglb3/igt@gem_exec_fair@basic-pace-share@rcs0.html
   [103]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglb7/igt@gem_exec_fair@basic-pace-share@rcs0.html

  * igt@i915_pm_dc@dc6-dpms:
    - shard-iclb:         [FAIL][104] ([i915#3989] / [i915#454]) -> [PASS][105]
   [104]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-iclb3/igt@i915_pm_dc@dc6-dpms.html
   [105]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb7/igt@i915_pm_dc@dc6-dpms.html

  * igt@i915_pm_dc@dc9-dpms:
    - {shard-tglu}:       [SKIP][106] ([i915#4281]) -> [PASS][107]
   [106]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-tglu-7/igt@i915_pm_dc@dc9-dpms.html
   [107]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglu-4/igt@i915_pm_dc@dc9-dpms.html

  * igt@i915_selftest@live@hangcheck:
    - shard-tglb:         [DMESG-WARN][108] ([i915#5591]) -> [PASS][109]
   [108]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-tglb1/igt@i915_selftest@live@hangcheck.html
   [109]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-tglb7/igt@i915_selftest@live@hangcheck.html

  * igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions:
    - shard-glk:          [FAIL][110] ([i915#2346]) -> [PASS][111]
   [110]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-glk6/igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions.html
   [111]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-glk6/igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions.html

  * igt@kms_flip@flip-vs-suspend@a-dp1:
    - shard-apl:          [DMESG-WARN][112] ([i915#180]) -> [PASS][113] +2 similar issues
   [112]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-apl8/igt@kms_flip@flip-vs-suspend@a-dp1.html
   [113]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-apl3/igt@kms_flip@flip-vs-suspend@a-dp1.html

  * igt@kms_psr@psr2_cursor_plane_onoff:
    - shard-iclb:         [SKIP][114] ([fdo#109441]) -> [PASS][115]
   [114]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-iclb5/igt@kms_psr@psr2_cursor_plane_onoff.html
   [115]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb2/igt@kms_psr@psr2_cursor_plane_onoff.html

  * igt@kms_vblank@pipe-b-wait-idle-hang:
    - shard-apl:          [SKIP][116] ([fdo#109271]) -> [PASS][117]
   [116]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-apl6/igt@kms_vblank@pipe-b-wait-idle-hang.html
   [117]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-apl1/igt@kms_vblank@pipe-b-wait-idle-hang.html

  
#### Warnings ####

  * igt@kms_psr2_sf@cursor-plane-move-continuous-exceed-sf:
    - shard-iclb:         [SKIP][118] ([i915#658]) -> [SKIP][119] ([i915#2920]) +1 similar issue
   [118]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-iclb7/igt@kms_psr2_sf@cursor-plane-move-continuous-exceed-sf.html
   [119]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb2/igt@kms_psr2_sf@cursor-plane-move-continuous-exceed-sf.html

  * igt@kms_psr2_sf@overlay-plane-move-continuous-exceed-fully-sf:
    - shard-iclb:         [SKIP][120] ([i915#2920]) -> [SKIP][121] ([i915#658])
   [120]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-iclb2/igt@kms_psr2_sf@overlay-plane-move-continuous-exceed-fully-sf.html
   [121]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb7/igt@kms_psr2_sf@overlay-plane-move-continuous-exceed-fully-sf.html

  * igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area:
    - shard-iclb:         [SKIP][122] ([fdo#111068] / [i915#658]) -> [SKIP][123] ([i915#2920])
   [122]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-iclb5/igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area.html
   [123]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-iclb2/igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area.html

  * igt@runner@aborted:
    - shard-apl:          ([FAIL][124], [FAIL][125], [FAIL][126], [FAIL][127]) ([i915#180] / [i915#3002] / [i915#4312]) -> ([FAIL][128], [FAIL][129]) ([i915#3002] / [i915#4312])
   [124]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-apl8/igt@runner@aborted.html
   [125]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-apl2/igt@runner@aborted.html
   [126]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-apl8/igt@runner@aborted.html
   [127]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12469/shard-apl2/igt@runner@aborted.html
   [128]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-apl2/igt@runner@aborted.html
   [129]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/shard-apl2/igt@runner@aborted.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109279]: https://bugs.freedesktop.org/show_bug.cgi?id=109279
  [fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
  [fdo#109283]: https://bugs.freedesktop.org/show_bug.cgi?id=109283
  [fdo#109284]: https://bugs.freedesktop.org/show_bug.cgi?id=109284
  [fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
  [fdo#109291]: https://bugs.freedesktop.org/show_bug.cgi?id=109291
  [fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
  [fdo#109300]: https://bugs.freedesktop.org/show_bug.cgi?id=109300
  [fdo#109302]: https://bugs.freedesktop.org/show_bug.cgi?id=109302
  [fdo#109303]: https://bugs.freedesktop.org/show_bug.cgi?id=109303
  [fdo#109307]: https://bugs.freedesktop.org/show_bug.cgi?id=109307
  [fdo#109308]: https://bugs.freedesktop.org/show_bug.cgi?id=109308
  [fdo#109309]: https://bugs.freedesktop.org/show_bug.cgi?id=109309
  [fdo#109312]: https://bugs.freedesktop.org/show_bug.cgi?id=109312
  [fdo#109313]: https://bugs.freedesktop.org/show_bug.cgi?id=109313
  [fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#109506]: https://bugs.freedesktop.org/show_bug.cgi?id=109506
  [fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
  [fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
  [fdo#110542]: https://bugs.freedesktop.org/show_bug.cgi?id=110542
  [fdo#110723]: https://bugs.freedesktop.org/show_bug.cgi?id=110723
  [fdo#110725]: https://bugs.freedesktop.org/show_bug.cgi?id=110725
  [fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
  [fdo#111614]: https://bugs.freedesktop.org/show_bug.cgi?id=111614
  [fdo#111615]: https://bugs.freedesktop.org/show_bug.cgi?id=111615
  [fdo#111644]: https://bugs.freedesktop.org/show_bug.cgi?id=111644
  [fdo#111656]: https://bugs.freedesktop.org/show_bug.cgi?id=111656
  [fdo#111825]: https://bugs.freedesktop.org/show_bug.cgi?id=111825
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [fdo#112283]: https://bugs.freedesktop.org/show_bug.cgi?id=112283
  [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
  [i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
  [i915#1257]: https://gitlab.freedesktop.org/drm/intel/issues/1257
  [i915#132]: https://gitlab.freedesktop.org/drm/intel/issues/132
  [i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
  [i915#1755]: https://gitlab.freedesktop.org/drm/intel/issues/1755
  [i915#1769]: https://gitlab.freedesktop.org/drm/intel/issues/1769
  [i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
  [i915#1825]: https://gitlab.freedesktop.org/drm/intel/issues/1825
  [i915#1839]: https://gitlab.freedesktop.org/drm/intel/issues/1839
  [i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
  [i915#1849]: https://gitlab.freedesktop.org/drm/intel/issues/1849
  [i915#1850]: https://gitlab.freedesktop.org/drm/intel/issues/1850
  [i915#1902]: https://gitlab.freedesktop.org/drm/intel/issues/1902
  [i915#1937]: https://gitlab.freedesktop.org/drm/intel/issues/1937
  [i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
  [i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
  [i915#2410]: https://gitlab.freedesktop.org/drm/intel/issues/2410
  [i915#2411]: https://gitlab.freedesktop.org/drm/intel/issues/2411
  [i915#2433]: https://gitlab.freedesktop.org/drm/intel/issues/2433
  [i915#2434]: https://gitlab.freedesktop.org/drm/intel/issues/2434
  [i915#2435]: https://gitlab.freedesktop.org/drm/intel/issues/2435
  [i915#2437]: https://gitlab.freedesktop.org/drm/intel/issues/2437
  [i915#2527]: https://gitlab.freedesktop.org/drm/intel/issues/2527
  [i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
  [i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
  [i915#2587]: https://gitlab.freedesktop.org/drm/intel/issues/2587
  [i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
  [i915#2681]: https://gitlab.freedesktop.org/drm/intel/issues/2681
  [i915#2705]: https://gitlab.freedesktop.org/drm/intel/issues/2705
  [i915#280]: https://gitlab.freedesktop.org/drm/intel/issues/280
  [i915#284]: https://gitlab.freedesktop.org/drm/intel/issues/284
  [i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
  [i915#2846]: https://gitlab.freedesktop.org/drm/intel/issues/2846
  [i915#2856]: https://gitlab.freedesktop.org/drm/intel/issues/2856
  [i915#2920]: https://gitlab.freedesktop.org/drm/intel/issues/2920
  [i915#2994]: https://gitlab.freedesktop.org/drm/intel/issues/2994
  [i915#3002]: https://gitlab.freedesktop.org/drm/intel/issues/3002
  [i915#3116]: https://gitlab.freedesktop.org/drm/intel/issues/3116
  [i915#315]: https://gitlab.freedesktop.org/drm/intel/issues/315
  [i915#3281]: https://gitlab.freedesktop.org/drm/intel/issues/3281
  [i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
  [i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
  [i915#3297]: https://gitlab.freedesktop.org/drm/intel/issues/3297
  [i915#3299]: https://gitlab.freedesktop.org/drm/intel/issues/3299
  [i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
  [i915#3318]: https://gitlab.freedesktop.org/drm/intel/issues/3318
  [i915#3323]: https://gitlab.freedesktop.org/drm/intel/issues/3323
  [i915#3359]: https://gitlab.freedesktop.org/drm/intel/issues/3359
  [i915#3361]: https://gitlab.freedesktop.org/drm/intel/issues/3361
  [i915#3458]: https://gitlab.freedesktop.org/drm/intel/issues/3458
  [i915#3469]: https://gitlab.freedesktop.org/drm/intel/issues/3469
  [i915#3528]: https://gitlab.freedesktop.org/drm/intel/issues/3528
  [i915#3539]: https://gitlab.freedesktop.org/drm/intel/issues/3539
  [i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546
  [i915#3547]: https://gitlab.freedesktop.org/drm/intel/issues/3547
  [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
  [i915#3558]: https://gitlab.freedesktop.org/drm/intel/issues/3558
  [i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
  [i915#3638]: https://gitlab.freedesktop.org/drm/intel/issues/3638
  [i915#3689]: https://gitlab.freedesktop.org/drm/intel/issues/3689
  [i915#3692]: https://gitlab.freedesktop.org/drm/intel/issues/3692
  [i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
  [i915#3734]: https://gitlab.freedesktop.org/drm/intel/issues/3734
  [i915#3742]: https://gitlab.freedesktop.org/drm/intel/issues/3742
  [i915#3743]: https://gitlab.freedesktop.org/drm/intel/issues/3743
  [i915#3826]: https://gitlab.freedesktop.org/drm/intel/issues/3826
  [i915#3840]: https://gitlab.freedesktop.org/drm/intel/issues/3840
  [i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
  [i915#3936]: https://gitlab.freedesktop.org/drm/intel/issues/3936
  [i915#3938]: https://gitlab.freedesktop.org/drm/intel/issues/3938
  [i915#3952]: https://gitlab.freedesktop.org/drm/intel/issues/3952
  [i915#3955]: https://gitlab.freedesktop.org/drm/intel/issues/3955
  [i915#3989]: https://gitlab.freedesktop.org/drm/intel/issues/3989
  [i915#404]: https://gitlab.freedesktop.org/drm/intel/issues/404
  [i915#4070]: https://gitlab.freedesktop.org/drm/intel/issues/4070
  [i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
  [i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078
  [i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
  [i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
  [i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
  [i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
  [i915#4171]: https://gitlab.freedesktop.org/drm/intel/issues/4171
  [i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212
  [i915#4213]: https://gitlab.freedesktop.org/drm/intel/issues/4213
  [i915#4215]: https://gitlab.freedesktop.org/drm/intel/issues/4215
  [i915#4258]: https://gitlab.freedesktop.org/drm/intel/issues/4258
  [i915#426]: https://gitlab.freedesktop.org/drm/intel/issues/426
  [i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
  [i915#4281]: https://gitlab.freedesktop.org/drm/intel/issues/4281
  [i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
  [i915#4349]: https://gitlab.freedesktop.org/drm/intel/issues/4349
  [i915#4387]: https://gitlab.freedesktop.org/drm/intel/issues/4387
  [i915#4525]: https://gitlab.freedesktop.org/drm/intel/issues/4525
  [i915#4528]: https://gitlab.freedesktop.org/drm/intel/issues/4528
  [i915#4538]: https://gitlab.freedesktop.org/drm/intel/issues/4538
  [i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
  [i915#4565]: https://gitlab.freedesktop.org/drm/intel/issues/4565
  [i915#4573]: https://gitlab.freedesktop.org/drm/intel/issues/4573
  [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
  [i915#4765]: https://gitlab.freedesktop.org/drm/intel/issues/4765
  [i915#4767]: https://gitlab.freedesktop.org/drm/intel/issues/4767
  [i915#4771]: https://gitlab.freedesktop.org/drm/intel/issues/4771
  [i915#4812]: https://gitlab.freedesktop.org/drm/intel/issues/4812
  [i915#4817]: https://gitlab.freedesktop.org/drm/intel/issues/4817
  [i915#4818]: https://gitlab.freedesktop.org/drm/intel/issues/4818
  [i915#4833]: https://gitlab.freedesktop.org/drm/intel/issues/4833
  [i915#4852]: https://gitlab.freedesktop.org/drm/intel/issues/4852
  [i915#4855]: https://gitlab.freedesktop.org/drm/intel/issues/4855
  [i915#4859]: https://gitlab.freedesktop.org/drm/intel/issues/4859
  [i915#4860]: https://gitlab.freedesktop.org/drm/intel/issues/4860
  [i915#4873]: https://gitlab.freedesktop.org/drm/intel/issues/4873
  [i915#4877]: https://gitlab.freedesktop.org/drm/intel/issues/4877
  [i915#4879]: https://gitlab.freedesktop.org/drm/intel/issues/4879
  [i915#4880]: https://gitlab.freedesktop.org/drm/intel/issues/4880
  [i915#4881]: https://gitlab.freedesktop.org/drm/intel/issues/4881
  [i915#4884]: https://gitlab.freedesktop.org/drm/intel/issues/4884
  [i915#4958]: https://gitlab.freedesktop.org/drm/intel/issues/4958
  [i915#4991]: https://gitlab.freedesktop.org/drm/intel/issues/4991
  [i915#4998]: https://gitlab.freedesktop.org/drm/intel/issues/4998
  [i915#5099]: https://gitlab.freedesktop.org/drm/intel/issues/5099
  [i915#5138]: https://gitlab.freedesktop.org/drm/intel/issues/5138
  [i915#5153]: https://gitlab.freedesktop.org/drm/intel/issues/5153
  [i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
  [i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
  [i915#5286]: https://gitlab.freedesktop.org/drm/intel/issues/5286
  [i915#5289]: https://gitlab.freedesktop.org/drm/intel/issues/5289
  [i915#5325]: https://gitlab.freedesktop.org/drm/intel/issues/5325
  [i915#5327]: https://gitlab.freedesktop.org/drm/intel/issues/5327
  [i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
  [i915#5439]: https://gitlab.freedesktop.org/drm/intel/issues/5439
  [i915#5461]: https://gitlab.freedesktop.org/drm/intel/issues/5461
  [i915#5519]: https://gitlab.freedesktop.org/drm/intel/issues/5519
  [i915#5563]: https://gitlab.freedesktop.org/drm/intel/issues/5563
  [i915#5591]: https://gitlab.freedesktop.org/drm/intel/issues/5591
  [i915#5723]: https://gitlab.freedesktop.org/drm/intel/issues/5723
  [i915#5784]: https://gitlab.freedesktop.org/drm/intel/issues/5784
  [i915#5939]: https://gitlab.freedesktop.org/drm/intel/issues/5939
  [i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
  [i915#6106]: https://gitlab.freedesktop.org/drm/intel/issues/6106
  [i915#6117]: https://gitlab.freedesktop.org/drm/intel/issues/6117
  [i915#6227]: https://gitlab.freedesktop.org/drm/intel/issues/6227
  [i915#6245]: https://gitlab.freedesktop.org/drm/intel/issues/6245
  [i915#6247]: https://gitlab.freedesktop.org/drm/intel/issues/6247
  [i915#6248]: https://gitlab.freedesktop.org/drm/intel/issues/6248
  [i915#6258]: https://gitlab.freedesktop.org/drm/intel/issues/6258
  [i915#6268]: https://gitlab.freedesktop.org/drm/intel/issues/6268
  [i915#6301]: https://gitlab.freedesktop.org/drm/intel/issues/6301
  [i915#6334]: https://gitlab.freedesktop.org/drm/intel/issues/6334
  [i915#6335]: https://gitlab.freedesktop.org/drm/intel/issues/6335
  [i915#6344]: https://gitlab.freedesktop.org/drm/intel/issues/6344
  [i915#6433]: https://gitlab.freedesktop.org/drm/intel/issues/6433
  [i915#6493]: https://gitlab.freedesktop.org/drm/intel/issues/6493
  [i915#6497]: https://gitlab.freedesktop.org/drm/intel/issues/6497
  [i915#6524]: https://gitlab.freedesktop.org/drm/intel/issues/6524
  [i915#6537]: https://gitlab.freedesktop.org/drm/intel/issues/6537
  [i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
  [i915#6590]: https://gitlab.freedesktop.org/drm/intel/issues/6590
  [i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
  [i915#6768]: https://gitlab.freedesktop.org/drm/intel/issues/6768
  [i915#6944]: https://gitlab.freedesktop.org/drm/intel/issues/6944
  [i915#6946]: https://gitlab.freedesktop.org/drm/intel/issues/6946
  [i915#7116]: https://gitlab.freedesktop.org/drm/intel/issues/7116
  [i915#7118]: https://gitlab.freedesktop.org/drm/intel/issues/7118
  [i915#7128]: https://gitlab.freedesktop.org/drm/intel/issues/7128
  [i915#7173]: https://gitlab.freedesktop.org/drm/intel/issues/7173
  [i915#7456]: https://gitlab.freedesktop.org/drm/intel/issues/7456
  [i915#7561]: https://gitlab.freedesktop.org/drm/intel/issues/7561
  [i915#7582]: https://gitlab.freedesktop.org/drm/intel/issues/7582
  [i915#768]: https://gitlab.freedesktop.org/drm/intel/issues/768
  [i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_7083 -> IGTPW_8195
  * Piglit: piglit_4509 -> None

  CI-20190529: 20190529
  CI_DRM_12469: 886c7f9510ce20f099d27d9e7d9de32402c9e5e6 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_8195: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/index.html
  IGT_7083: c001793d5f22deb01918b6ba52af829794582df1 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8195/index.html

[-- Attachment #2: Type: text/html, Size: 41320 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2 1/5] lib/intel_allocator: Remove RANDOM allocator
  2022-12-05 20:27 ` [igt-dev] [PATCH i-g-t v2 1/5] lib/intel_allocator: Remove RANDOM allocator Zbigniew Kempczyński
@ 2022-12-06 15:56   ` Kamil Konieczny
  0 siblings, 0 replies; 14+ messages in thread
From: Kamil Konieczny @ 2022-12-06 15:56 UTC (permalink / raw)
  To: igt-dev

On 2022-12-05 at 21:27:04 +0100, Zbigniew Kempczyński wrote:
> It was added in first allocator series as modification of previously
> existing offset provider. As it is randomizing offsets there's a risk
> they can overlap and during exec we can get ENOSPC in softpin mode.
> Another thing is nobody is using it, so it is good idea to remove it
> and prevent to have incidental failures in case of use.
> 
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>

I do see some value of having random allocations but I agree with
you that in current state it either needs improvement or should be
removed.

Changes lgtm,
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>

> ---
>  lib/intel_allocator.c            |   3 -
>  lib/intel_allocator.h            |   3 +-
>  lib/intel_allocator_random.c     | 191 -------------------------------
>  lib/meson.build                  |   1 -
>  tests/i915/api_intel_allocator.c |   8 +-
>  tests/i915/api_intel_bb.c        |  12 --
>  6 files changed, 3 insertions(+), 215 deletions(-)
>  delete mode 100644 lib/intel_allocator_random.c
> 
> diff --git a/lib/intel_allocator.c b/lib/intel_allocator.c
> index 717d7fc56b..3004f15ae1 100644
> --- a/lib/intel_allocator.c
> +++ b/lib/intel_allocator.c
> @@ -305,9 +305,6 @@ static struct intel_allocator *intel_allocator_create(int fd,
>  	case INTEL_ALLOCATOR_RELOC:
>  		ial = intel_allocator_reloc_create(fd, start, end);
>  		break;
> -	case INTEL_ALLOCATOR_RANDOM:
> -		ial = intel_allocator_random_create(fd, start, end);
> -		break;
>  	case INTEL_ALLOCATOR_SIMPLE:
>  		ial = intel_allocator_simple_create(fd, start, end,
>  						    allocator_strategy);
> diff --git a/lib/intel_allocator.h b/lib/intel_allocator.h
> index c237e8e442..28e1165540 100644
> --- a/lib/intel_allocator.h
> +++ b/lib/intel_allocator.h
> @@ -213,8 +213,7 @@ void intel_allocator_print(uint64_t allocator_handle);
>  #define ALLOC_INVALID_ADDRESS (-1ull)
>  #define INTEL_ALLOCATOR_NONE   0
>  #define INTEL_ALLOCATOR_RELOC  1
> -#define INTEL_ALLOCATOR_RANDOM 2
> -#define INTEL_ALLOCATOR_SIMPLE 3
> +#define INTEL_ALLOCATOR_SIMPLE 2
>  
>  #define GEN8_GTT_ADDRESS_WIDTH 48
>  
> diff --git a/lib/intel_allocator_random.c b/lib/intel_allocator_random.c
> deleted file mode 100644
> index d22f817670..0000000000
> --- a/lib/intel_allocator_random.c
> +++ /dev/null
> @@ -1,191 +0,0 @@
> -// SPDX-License-Identifier: MIT
> -/*
> - * Copyright © 2021 Intel Corporation
> - */
> -
> -#include <sys/ioctl.h>
> -#include <stdlib.h>
> -#include "igt.h"
> -#include "igt_x86.h"
> -#include "igt_rand.h"
> -#include "intel_allocator.h"
> -
> -struct intel_allocator *
> -intel_allocator_random_create(int fd, uint64_t start, uint64_t end);
> -
> -struct intel_allocator_random {
> -	uint32_t prng;
> -	uint64_t start;
> -	uint64_t end;
> -
> -	/* statistics */
> -	uint64_t allocated_objects;
> -};
> -
> -/* Keep the low 256k clear, for negative deltas */
> -#define BIAS (256 << 10)
> -#define RETRIES 8
> -
> -static void intel_allocator_random_get_address_range(struct intel_allocator *ial,
> -						     uint64_t *startp,
> -						     uint64_t *endp)
> -{
> -	struct intel_allocator_random *ialr = ial->priv;
> -
> -	if (startp)
> -		*startp = ialr->start;
> -
> -	if (endp)
> -		*endp = ialr->end;
> -}
> -
> -static uint64_t intel_allocator_random_alloc(struct intel_allocator *ial,
> -					     uint32_t handle, uint64_t size,
> -					     uint64_t alignment,
> -					     enum allocator_strategy strategy)
> -{
> -	struct intel_allocator_random *ialr = ial->priv;
> -	uint64_t offset;
> -	int cnt = RETRIES;
> -
> -	(void) handle;
> -	(void) strategy;
> -
> -	/* randomize the address, we try to avoid relocations */
> -	do {
> -		offset = hars_petruska_f54_1_random64(&ialr->prng);
> -		/* maximize the chances of fitting in the last iteration */
> -		if (cnt == 1)
> -			offset = 0;
> -
> -		offset %= ialr->end - ialr->start;
> -		offset += ialr->start;
> -		offset = ALIGN(offset, alignment);
> -	} while (offset + size > ialr->end && --cnt);
> -
> -	if (!cnt)
> -		return ALLOC_INVALID_ADDRESS;
> -
> -	ialr->allocated_objects++;
> -
> -	return offset;
> -}
> -
> -static bool intel_allocator_random_free(struct intel_allocator *ial,
> -					uint32_t handle)
> -{
> -	struct intel_allocator_random *ialr = ial->priv;
> -
> -	(void) handle;
> -
> -	ialr->allocated_objects--;
> -
> -	return false;
> -}
> -
> -static bool intel_allocator_random_is_allocated(struct intel_allocator *ial,
> -						uint32_t handle, uint64_t size,
> -						uint64_t offset)
> -{
> -	(void) ial;
> -	(void) handle;
> -	(void) size;
> -	(void) offset;
> -
> -	return false;
> -}
> -
> -static void intel_allocator_random_destroy(struct intel_allocator *ial)
> -{
> -	igt_assert(ial);
> -
> -	free(ial->priv);
> -	free(ial);
> -}
> -
> -static bool intel_allocator_random_reserve(struct intel_allocator *ial,
> -					   uint32_t handle,
> -					   uint64_t start, uint64_t end)
> -{
> -	(void) ial;
> -	(void) handle;
> -	(void) start;
> -	(void) end;
> -
> -	return false;
> -}
> -
> -static bool intel_allocator_random_unreserve(struct intel_allocator *ial,
> -					     uint32_t handle,
> -					     uint64_t start, uint64_t end)
> -{
> -	(void) ial;
> -	(void) handle;
> -	(void) start;
> -	(void) end;
> -
> -	return false;
> -}
> -
> -static bool intel_allocator_random_is_reserved(struct intel_allocator *ial,
> -					       uint64_t start, uint64_t end)
> -{
> -	(void) ial;
> -	(void) start;
> -	(void) end;
> -
> -	return false;
> -}
> -
> -static void intel_allocator_random_print(struct intel_allocator *ial, bool full)
> -{
> -	struct intel_allocator_random *ialr = ial->priv;
> -
> -	(void) full;
> -
> -	igt_info("<ial: %p, fd: %d> allocated objects: %" PRIx64 "\n",
> -		 ial, ial->fd, ialr->allocated_objects);
> -}
> -
> -static bool intel_allocator_random_is_empty(struct intel_allocator *ial)
> -{
> -	struct intel_allocator_random *ialr = ial->priv;
> -
> -	return !ialr->allocated_objects;
> -}
> -
> -struct intel_allocator *
> -intel_allocator_random_create(int fd, uint64_t start, uint64_t end)
> -{
> -	struct intel_allocator *ial;
> -	struct intel_allocator_random *ialr;
> -
> -	igt_debug("Using random allocator\n");
> -	ial = calloc(1, sizeof(*ial));
> -	igt_assert(ial);
> -
> -	ial->fd = fd;
> -	ial->get_address_range = intel_allocator_random_get_address_range;
> -	ial->alloc = intel_allocator_random_alloc;
> -	ial->free = intel_allocator_random_free;
> -	ial->is_allocated = intel_allocator_random_is_allocated;
> -	ial->reserve = intel_allocator_random_reserve;
> -	ial->unreserve = intel_allocator_random_unreserve;
> -	ial->is_reserved = intel_allocator_random_is_reserved;
> -	ial->destroy = intel_allocator_random_destroy;
> -	ial->print = intel_allocator_random_print;
> -	ial->is_empty = intel_allocator_random_is_empty;
> -
> -	ialr = ial->priv = calloc(1, sizeof(*ialr));
> -	igt_assert(ial->priv);
> -	ialr->prng = (uint32_t) to_user_pointer(ial);
> -
> -	start = max_t(uint64_t, start, BIAS);
> -	igt_assert(start < end);
> -	ialr->start = start;
> -	ialr->end = end;
> -
> -	ialr->allocated_objects = 0;
> -
> -	return ial;
> -}
> diff --git a/lib/meson.build b/lib/meson.build
> index 8ae9fe13d1..2c6ebce7b6 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -47,7 +47,6 @@ lib_sources = [
>  	'instdone.c',
>  	'intel_allocator.c',
>  	'intel_allocator_msgchannel.c',
> -	'intel_allocator_random.c',
>  	'intel_allocator_reloc.c',
>  	'intel_allocator_simple.c',
>  	'intel_batchbuffer.c',
> diff --git a/tests/i915/api_intel_allocator.c b/tests/i915/api_intel_allocator.c
> index a7929e9b13..098b9e6960 100644
> --- a/tests/i915/api_intel_allocator.c
> +++ b/tests/i915/api_intel_allocator.c
> @@ -179,9 +179,6 @@ static void basic_alloc(int fd, int cnt, uint8_t type)
>  	for (i = 0; i < cnt; i++) {
>  		igt_progress("check overlapping: ", i, cnt);
>  
> -		if (type == INTEL_ALLOCATOR_RANDOM)
> -			continue;
> -
>  		for (j = 0; j < cnt; j++) {
>  			if (j == i)
>  				continue;
> @@ -307,8 +304,8 @@ static void parallel_one(int fd, uint8_t type)
>  
>  	/* Check if all objects are allocated */
>  	for (i = 0; i < count; i++) {
> -		/* Reloc + random allocators don't have state. */
> -		if (type == INTEL_ALLOCATOR_RELOC || type == INTEL_ALLOCATOR_RANDOM)
> +		/* Reloc don't have state. */
> +		if (type == INTEL_ALLOCATOR_RELOC)
>  			break;
>  
>  		igt_assert_eq(offsets[i],
> @@ -752,7 +749,6 @@ struct allocators {
>  } als[] = {
>  	{"simple", INTEL_ALLOCATOR_SIMPLE},
>  	{"reloc",  INTEL_ALLOCATOR_RELOC},
> -	{"random", INTEL_ALLOCATOR_RANDOM},
>  	{NULL, 0},
>  };
>  
> diff --git a/tests/i915/api_intel_bb.c b/tests/i915/api_intel_bb.c
> index 4c8ca6ab36..980906f4ed 100644
> --- a/tests/i915/api_intel_bb.c
> +++ b/tests/i915/api_intel_bb.c
> @@ -1620,24 +1620,12 @@ igt_main_args("dpibc:", NULL, help_str, opt_handler, NULL)
>  	igt_subtest("object-noreloc-keep-cache-simple")
>  		object_noreloc(bops, KEEP_CACHE, INTEL_ALLOCATOR_SIMPLE);
>  
> -	igt_subtest("object-noreloc-purge-cache-random")
> -		object_noreloc(bops, PURGE_CACHE, INTEL_ALLOCATOR_RANDOM);
> -
> -	igt_subtest("object-noreloc-keep-cache-random")
> -		object_noreloc(bops, KEEP_CACHE, INTEL_ALLOCATOR_RANDOM);
> -
>  	igt_subtest("blit-reloc-purge-cache")
>  		blit(bops, RELOC, PURGE_CACHE, INTEL_ALLOCATOR_SIMPLE);
>  
>  	igt_subtest("blit-reloc-keep-cache")
>  		blit(bops, RELOC, KEEP_CACHE, INTEL_ALLOCATOR_SIMPLE);
>  
> -	igt_subtest("blit-noreloc-keep-cache-random")
> -		blit(bops, NORELOC, KEEP_CACHE, INTEL_ALLOCATOR_RANDOM);
> -
> -	igt_subtest("blit-noreloc-purge-cache-random")
> -		blit(bops, NORELOC, PURGE_CACHE, INTEL_ALLOCATOR_RANDOM);
> -
>  	igt_subtest("blit-noreloc-keep-cache")
>  		blit(bops, NORELOC, KEEP_CACHE, INTEL_ALLOCATOR_SIMPLE);
>  
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2 2/5] tests/api_intel_allocator: Remove duplicated reuse and reserve subtests
  2022-12-05 20:27 ` [igt-dev] [PATCH i-g-t v2 2/5] tests/api_intel_allocator: Remove duplicated reuse and reserve subtests Zbigniew Kempczyński
@ 2022-12-06 15:58   ` Kamil Konieczny
  0 siblings, 0 replies; 14+ messages in thread
From: Kamil Konieczny @ 2022-12-06 15:58 UTC (permalink / raw)
  To: igt-dev

On 2022-12-05 at 21:27:05 +0100, Zbigniew Kempczyński wrote:
> For SIMPLE allocator those subtest are duplicated outside loop which
> exercises all defined allocators. Lets remove it and not waste time
> for double run.
> 
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>

Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>

> ---
>  tests/i915/api_intel_allocator.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/tests/i915/api_intel_allocator.c b/tests/i915/api_intel_allocator.c
> index 098b9e6960..b55587e549 100644
> --- a/tests/i915/api_intel_allocator.c
> +++ b/tests/i915/api_intel_allocator.c
> @@ -769,12 +769,6 @@ igt_main
>  	igt_subtest_f("reserve-simple")
>  		reserve_simple(fd);
>  
> -	igt_subtest_f("reuse")
> -		reuse(fd, INTEL_ALLOCATOR_SIMPLE);
> -
> -	igt_subtest_f("reserve")
> -		reserve(fd, INTEL_ALLOCATOR_SIMPLE);
> -
>  	igt_describe("For simple allocator check does default alignment is "
>  		     "properly handled in open and alloc functions");
>  	igt_subtest_f("default-alignment")
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2 4/5] tests/gem_ctx_shared: Remove necessity of passing offset to function call
  2022-12-05 20:27 ` [igt-dev] [PATCH i-g-t v2 4/5] tests/gem_ctx_shared: Remove necessity of passing offset to function call Zbigniew Kempczyński
@ 2022-12-06 16:31   ` Kamil Konieczny
  0 siblings, 0 replies; 14+ messages in thread
From: Kamil Konieczny @ 2022-12-06 16:31 UTC (permalink / raw)
  To: igt-dev

On 2022-12-05 at 21:27:07 +0100, Zbigniew Kempczyński wrote:
> Previously reloc allocator wasn't stateful for allocations thus alloc()
> had to be done in single place. Now this limitation is removed so
> dependent function can call allocator alloc() function again without
> worrying about offset change.
> 
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> ---

lgtm
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>

>  tests/i915/gem_ctx_shared.c | 45 ++++++++++++++++---------------------
>  1 file changed, 19 insertions(+), 26 deletions(-)
> 
> diff --git a/tests/i915/gem_ctx_shared.c b/tests/i915/gem_ctx_shared.c
> index d6b56b72ab..55d3d5a975 100644
> --- a/tests/i915/gem_ctx_shared.c
> +++ b/tests/i915/gem_ctx_shared.c
> @@ -512,9 +512,9 @@ static void exec_single_timeline(int i915, const intel_ctx_cfg_t *cfg,
>  }
>  
>  static void store_dword(int i915, uint64_t ahnd, const intel_ctx_t *ctx,
> -			unsigned ring, uint32_t target, uint64_t target_offset,
> +			unsigned int ring, uint32_t target, uint64_t target_size,
>  			uint32_t offset, uint32_t value,
> -			uint32_t cork, uint64_t cork_offset,
> +			uint32_t cork, uint64_t cork_size,
>  			unsigned write_domain)
>  {
>  	const unsigned int gen = intel_gen(intel_get_drm_devid(i915));
> @@ -537,9 +537,9 @@ static void store_dword(int i915, uint64_t ahnd, const intel_ctx_t *ctx,
>  	obj[1].handle = target;
>  	obj[2].handle = gem_create(i915, 4096);
>  	if (ahnd) {
> -		obj[0].offset = cork_offset;
> +		obj[0].offset = get_offset(ahnd, cork, cork_size, 0);
>  		obj[0].flags |= EXEC_OBJECT_PINNED;
> -		obj[1].offset = target_offset;
> +		obj[1].offset = get_offset(ahnd, target, target_size, 0);
>  		obj[1].flags |= EXEC_OBJECT_PINNED;
>  		if (write_domain)
>  			obj[1].flags |= EXEC_OBJECT_WRITE;
> @@ -768,7 +768,7 @@ static void reorder(int i915, const intel_ctx_cfg_t *cfg,
>  	intel_ctx_cfg_t q_cfg;
>  	const intel_ctx_t *ctx[2];
>  	uint32_t plug;
> -	uint64_t ahnd = get_reloc_ahnd(i915, 0), scratch_offset, plug_offset;
> +	uint64_t ahnd = get_reloc_ahnd(i915, 0);
>  
>  	q_cfg = *cfg;
>  	q_cfg.vm = gem_vm_create(i915);
> @@ -781,17 +781,15 @@ static void reorder(int i915, const intel_ctx_cfg_t *cfg,
>  	gem_context_set_priority(i915, ctx[HI]->id, flags & EQUAL ? MIN_PRIO : 0);
>  
>  	scratch = gem_create(i915, 4096);
> -	scratch_offset = get_offset(ahnd, scratch, 4096, 0);
>  	plug = igt_cork_plug(&cork, i915);
> -	plug_offset = get_offset(ahnd, plug, 4096, 0);
>  
>  	/* We expect the high priority context to be executed first, and
>  	 * so the final result will be value from the low priority context.
>  	 */
> -	store_dword(i915, ahnd, ctx[LO], ring, scratch, scratch_offset,
> -		    0, ctx[LO]->id, plug, plug_offset, 0);
> -	store_dword(i915, ahnd, ctx[HI], ring, scratch, scratch_offset,
> -		    0, ctx[HI]->id, plug, plug_offset, 0);
> +	store_dword(i915, ahnd, ctx[LO], ring, scratch, 4096,
> +		    0, ctx[LO]->id, plug, 4096, 0);
> +	store_dword(i915, ahnd, ctx[HI], ring, scratch, 4096,
> +		    0, ctx[HI]->id, plug, 4096, 0);
>  
>  	unplug_show_queue(i915, &cork, ahnd, &q_cfg, ring);
>  	gem_close(i915, plug);
> @@ -825,7 +823,6 @@ static void promotion(int i915, const intel_ctx_cfg_t *cfg, unsigned ring)
>  	const intel_ctx_t *ctx[3];
>  	uint32_t plug;
>  	uint64_t ahnd = get_reloc_ahnd(i915, 0);
> -	uint64_t result_offset, dep_offset, plug_offset;
>  
>  	q_cfg = *cfg;
>  	q_cfg.vm = gem_vm_create(i915);
> @@ -841,30 +838,27 @@ static void promotion(int i915, const intel_ctx_cfg_t *cfg, unsigned ring)
>  	gem_context_set_priority(i915, ctx[NOISE]->id, 0);
>  
>  	result = gem_create(i915, 4096);
> -	result_offset = get_offset(ahnd, result, 4096, 0);
>  	dep = gem_create(i915, 4096);
> -	dep_offset = get_offset(ahnd, dep, 4096, 0);
>  
>  	plug = igt_cork_plug(&cork, i915);
> -	plug_offset = get_offset(ahnd, plug, 4096, 0);
>  
>  	/* Expect that HI promotes LO, so the order will be LO, HI, NOISE.
>  	 *
>  	 * fifo would be NOISE, LO, HI.
>  	 * strict priority would be  HI, NOISE, LO
>  	 */
> -	store_dword(i915, ahnd, ctx[NOISE], ring, result, result_offset,
> -		    0, ctx[NOISE]->id, plug, plug_offset, 0);
> -	store_dword(i915, ahnd, ctx[LO], ring, result, result_offset,
> -		    0, ctx[LO]->id, plug, plug_offset, 0);
> +	store_dword(i915, ahnd, ctx[NOISE], ring, result, 4096,
> +		    0, ctx[NOISE]->id, plug, 4096, 0);
> +	store_dword(i915, ahnd, ctx[LO], ring, result, 4096,
> +		    0, ctx[LO]->id, plug, 4096, 0);
>  
>  	/* link LO <-> HI via a dependency on another buffer */
> -	store_dword(i915, ahnd, ctx[LO], ring, dep, dep_offset,
> +	store_dword(i915, ahnd, ctx[LO], ring, dep, 4096,
>  		    0, ctx[LO]->id, 0, 0, I915_GEM_DOMAIN_INSTRUCTION);
> -	store_dword(i915, ahnd, ctx[HI], ring, dep, dep_offset,
> +	store_dword(i915, ahnd, ctx[HI], ring, dep, 4096,
>  		    0, ctx[HI]->id, 0, 0, 0);
>  
> -	store_dword(i915, ahnd, ctx[HI], ring, result, result_offset,
> +	store_dword(i915, ahnd, ctx[HI], ring, result, 4096,
>  		    0, ctx[HI]->id, 0, 0, 0);
>  
>  	unplug_show_queue(i915, &cork, ahnd, &q_cfg, ring);
> @@ -908,7 +902,6 @@ static void smoketest(int i915, const intel_ctx_cfg_t *cfg,
>  	uint32_t scratch;
>  	uint32_t *ptr;
>  	uint64_t ahnd = get_reloc_ahnd(i915, 0); /* same vm */
> -	uint64_t scratch_offset;
>  
>  	q_cfg = *cfg;
>  	q_cfg.vm = gem_vm_create(i915);
> @@ -926,7 +919,7 @@ static void smoketest(int i915, const intel_ctx_cfg_t *cfg,
>  	igt_require(nengine);
>  
>  	scratch = gem_create(i915, 4096);
> -	scratch_offset = get_offset(ahnd, scratch, 4096, 0);
> +
>  	igt_fork(child, ncpus) {
>  		unsigned long count = 0;
>  		const intel_ctx_t *ctx;
> @@ -943,12 +936,12 @@ static void smoketest(int i915, const intel_ctx_cfg_t *cfg,
>  
>  			engine = engines[hars_petruska_f54_1_random_unsafe_max(nengine)];
>  			store_dword(i915, ahnd, ctx, engine,
> -				    scratch, scratch_offset,
> +				    scratch, 4096,
>  				    8*child + 0, ~child,
>  				    0, 0, 0);
>  			for (unsigned int step = 0; step < 8; step++)
>  				store_dword(i915, ahnd, ctx, engine,
> -					    scratch, scratch_offset,
> +					    scratch, 4096,
>  					    8*child + 4, count++,
>  					    0, 0, 0);
>  		}
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2 5/5] tests/gem_exec_parallel: Avoid acquiring offset for overlapping handle
  2022-12-05 20:27 ` [igt-dev] [PATCH i-g-t v2 5/5] tests/gem_exec_parallel: Avoid acquiring offset for overlapping handle Zbigniew Kempczyński
@ 2022-12-06 17:06   ` Kamil Konieczny
  2022-12-07 11:28     ` Zbigniew Kempczyński
  0 siblings, 1 reply; 14+ messages in thread
From: Kamil Konieczny @ 2022-12-06 17:06 UTC (permalink / raw)
  To: igt-dev

Hi Zbigniew,

On 2022-12-05 at 21:27:08 +0100, Zbigniew Kempczyński wrote:
> Subtest @fds incorporates objects created in some context in new context
-------------- ^ -------------------------------------------- ^
Looks a little unclear, maybe:
takes objects and reuse them in new context

Also try to keep in 65 chars per line in commit description.

> created on new (reopened) drm fd. This might lead to clash handles
> (same handle created over different fd,ctx) so acquiring offsets from
> stateful allocator (reloc is from now on stateful for alloc()/free()
> ops) might lead to bind same offset for two different objects. Lets

Maybe these shows some value in having incremental allocator
like old reloc ? Or using here random allocator ? Just curious.

> use some artificial (last max handle + 1) handle for bb to avoid offset
> overlapping.
> 

With that fixed

Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>

Regards,
Kamil

> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> ---
>  tests/i915/gem_exec_parallel.c | 16 ++++++++++++++--
>  1 file changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/i915/gem_exec_parallel.c b/tests/i915/gem_exec_parallel.c
> index 730fc4a672..429620884b 100644
> --- a/tests/i915/gem_exec_parallel.c
> +++ b/tests/i915/gem_exec_parallel.c
> @@ -75,7 +75,7 @@ static void *thread(void *data)
>  	struct drm_i915_gem_relocation_entry reloc;
>  	struct drm_i915_gem_execbuffer2 execbuf;
>  	const intel_ctx_t *tmp_ctx = NULL;
> -	uint64_t offset;
> +	uint64_t offset, bb_offset;
>  	uint32_t batch[16];
>  	uint16_t used;
>  	int fd, i;
> @@ -136,6 +136,18 @@ static void *thread(void *data)
>  		execbuf.rsvd1 = t->ctx->id;
>  	}
>  
> +	/*
> +	 * For FDS we have new drm fd, what means gem_create() for bb returns
> +	 * handle == 1. As we're using objects from other fd it would overlap,
> +	 * thus we need to acquire offset for bb from last handle + 1.
> +	 * Other cases are within same fd, so obj[1].handle will be distinguish
> +	 * anyway.
> +	 */
> +	if (t->flags & FDS)
> +		bb_offset = get_offset(t->ahnd, t->scratch[NUMOBJ - 1] + 1, 4096, 0);
> +	else
> +		bb_offset = get_offset(t->ahnd, obj[1].handle, 4096, 0);
> +
>  	used = 0;
>  	igt_until_timeout(1) {
>  		unsigned int x = rand() % NUMOBJ;
> @@ -154,7 +166,7 @@ static void *thread(void *data)
>  			obj[0].offset = offset;
>  			obj[0].flags |= EXEC_OBJECT_PINNED | EXEC_OBJECT_WRITE |
>  					EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
> -			obj[1].offset = get_offset(t->ahnd, obj[1].handle, 4096, 0);
> +			obj[1].offset = bb_offset;
>  			obj[1].flags |= EXEC_OBJECT_PINNED | EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
>  			gem_write(fd, obj[1].handle, 0, batch, sizeof(batch));
>  		}
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2 3/5] lib/intel_allocator_reloc: Introduce stateful allocations in reloc
  2022-12-05 20:27 ` [igt-dev] [PATCH i-g-t v2 3/5] lib/intel_allocator_reloc: Introduce stateful allocations in reloc Zbigniew Kempczyński
@ 2022-12-06 21:39   ` Kamil Konieczny
  0 siblings, 0 replies; 14+ messages in thread
From: Kamil Konieczny @ 2022-12-06 21:39 UTC (permalink / raw)
  To: igt-dev

Hi Zbigniew,

On 2022-12-05 at 21:27:06 +0100, Zbigniew Kempczyński wrote:
> Till now reloc allocator was stateless - that means if we would
> call alloc() twice for same handle + size, we would get consecutive
> offsets (according to size and alignment). This is problematic
> in library code, where we get handle and we would like to get offset
> which must be same like in the caller. It wasn't possible thus library
> instead of alloc() has to get offset from the caller instead. For
> single object it is not big problem but passing more makes prototype
> much longer and usage is inconvinient.
> 
> Introducing stateful allocations tracking in reloc solves this issue
> - alloc() can be called many times in dependent code and same offset
> will be returned until free().
> 
> Tracking was added to alloc()/free() only - reserve()/unreserve()
> are not handled by reloc allocator at the moment at all.
> 
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>

Your code should work for allocations lower than available
gpu memory as code don't track free mem but that may be added
later.

Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>

> ---
>  lib/intel_allocator_reloc.c      | 115 ++++++++++++++++++++++++++-----
>  tests/i915/api_intel_allocator.c |  21 ++++--
>  2 files changed, 111 insertions(+), 25 deletions(-)
> 
> diff --git a/lib/intel_allocator_reloc.c b/lib/intel_allocator_reloc.c
> index ee3ad43f4a..60cbb88511 100644
> --- a/lib/intel_allocator_reloc.c
> +++ b/lib/intel_allocator_reloc.c
> @@ -9,11 +9,13 @@
>  #include "igt_x86.h"
>  #include "igt_rand.h"
>  #include "intel_allocator.h"
> +#include "igt_map.h"
>  
>  struct intel_allocator *
>  intel_allocator_reloc_create(int fd, uint64_t start, uint64_t end);
>  
>  struct intel_allocator_reloc {
> +	struct igt_map *objects;
>  	uint32_t prng;
>  	uint64_t start;
>  	uint64_t end;
> @@ -23,9 +25,41 @@ struct intel_allocator_reloc {
>  	uint64_t allocated_objects;
>  };
>  
> +struct intel_allocator_record {
> +	uint32_t handle;
> +	uint64_t offset;
> +	uint64_t size;
> +};
> +
>  /* Keep the low 256k clear, for negative deltas */
>  #define BIAS (256 << 10)
>  
> +/* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */
> +#define GOLDEN_RATIO_PRIME_32 0x9e370001UL
> +
> +/*  2^63 + 2^61 - 2^57 + 2^54 - 2^51 - 2^18 + 1 */
> +#define GOLDEN_RATIO_PRIME_64 0x9e37fffffffc0001ULL
> +
> +static inline uint32_t hash_handles(const void *val)
> +{
> +	uint32_t hash = *(uint32_t *) val;
> +
> +	hash = hash * GOLDEN_RATIO_PRIME_32;
> +	return hash;
> +}
> +
> +static int equal_handles(const void *a, const void *b)
> +{
> +	uint32_t *key1 = (uint32_t *) a, *key2 = (uint32_t *) b;
> +
> +	return *key1 == *key2;
> +}
> +
> +static void map_entry_free_func(struct igt_map_entry *entry)
> +{
> +	free(entry->data);
> +}
> +
>  static void intel_allocator_reloc_get_address_range(struct intel_allocator *ial,
>  						    uint64_t *startp,
>  						    uint64_t *endp)
> @@ -44,25 +78,39 @@ static uint64_t intel_allocator_reloc_alloc(struct intel_allocator *ial,
>  					    uint64_t alignment,
>  					    enum allocator_strategy strategy)
>  {
> +	struct intel_allocator_record *rec;
>  	struct intel_allocator_reloc *ialr = ial->priv;
>  	uint64_t offset, aligned_offset;
>  
> -	(void) handle;
>  	(void) strategy;
>  
> -	aligned_offset = ALIGN(ialr->offset, alignment);
> +	rec = igt_map_search(ialr->objects, &handle);
> +	if (rec) {
> +		offset = rec->offset;
> +		igt_assert(rec->size == size);
> +	} else {
> +		aligned_offset = ALIGN(ialr->offset, alignment);
>  
> -	/* Check we won't exceed end */
> -	if (aligned_offset + size > ialr->end)
> -		aligned_offset = ALIGN(ialr->start, alignment);
> +		/* Check we won't exceed end */
> +		if (aligned_offset + size > ialr->end)
> +			aligned_offset = ALIGN(ialr->start, alignment);
>  
> -	/* Check that the object fits in the address range */
> -	if (aligned_offset + size > ialr->end)
> -		return ALLOC_INVALID_ADDRESS;
> +		/* Check that the object fits in the address range */
> +		if (aligned_offset + size > ialr->end)
> +			return ALLOC_INVALID_ADDRESS;
>  
> -	offset = aligned_offset;
> -	ialr->offset = offset + size;
> -	ialr->allocated_objects++;
> +		offset = aligned_offset;
> +
> +		rec = malloc(sizeof(*rec));
> +		rec->handle = handle;
> +		rec->offset = offset;
> +		rec->size = size;
> +
> +		igt_map_insert(ialr->objects, &rec->handle, rec);
> +
> +		ialr->offset = offset + size;
> +		ialr->allocated_objects++;
> +	}
>  
>  	return offset;
>  }
> @@ -70,30 +118,60 @@ static uint64_t intel_allocator_reloc_alloc(struct intel_allocator *ial,
>  static bool intel_allocator_reloc_free(struct intel_allocator *ial,
>  				       uint32_t handle)
>  {
> +	struct intel_allocator_record *rec = NULL;
>  	struct intel_allocator_reloc *ialr = ial->priv;
> +	struct igt_map_entry *entry;
>  
> -	(void) handle;
> +	entry = igt_map_search_entry(ialr->objects, &handle);
> +	if (entry) {
> +		igt_map_remove_entry(ialr->objects, entry);
> +		if (entry->data) {
> +			rec = (struct intel_allocator_record *) entry->data;
> +			ialr->allocated_objects--;
> +			free(rec);
>  
> -	ialr->allocated_objects--;
> +			return true;
> +		}
> +	}
>  
>  	return false;
>  }
>  
> +static inline bool __same(const struct intel_allocator_record *rec,
> +			  uint32_t handle, uint64_t size, uint64_t offset)
> +{
> +	return rec->handle == handle && rec->size == size &&
> +			DECANONICAL(rec->offset) == DECANONICAL(offset);
> +}
> +
>  static bool intel_allocator_reloc_is_allocated(struct intel_allocator *ial,
>  					       uint32_t handle, uint64_t size,
>  					       uint64_t offset)
>  {
> -	(void) ial;
> -	(void) handle;
> -	(void) size;
> -	(void) offset;
> +	struct intel_allocator_record *rec;
> +	struct intel_allocator_reloc *ialr;
> +	bool same = false;
>  
> -	return false;
> +	igt_assert(ial);
> +	ialr = (struct intel_allocator_reloc *) ial->priv;
> +	igt_assert(ialr);
> +	igt_assert(handle);
> +
> +	rec = igt_map_search(ialr->objects, &handle);
> +	if (rec && __same(rec, handle, size, offset))
> +		same = true;
> +
> +	return same;
>  }
>  
>  static void intel_allocator_reloc_destroy(struct intel_allocator *ial)
>  {
> +	struct intel_allocator_reloc *ialr;
> +
>  	igt_assert(ial);
> +	ialr = (struct intel_allocator_reloc *) ial->priv;
> +
> +	igt_map_destroy(ialr->objects, map_entry_free_func);
>  
>  	free(ial->priv);
>  	free(ial);
> @@ -174,6 +252,7 @@ intel_allocator_reloc_create(int fd, uint64_t start, uint64_t end)
>  
>  	ialr = ial->priv = calloc(1, sizeof(*ialr));
>  	igt_assert(ial->priv);
> +	ialr->objects = igt_map_create(hash_handles, equal_handles);
>  	ialr->prng = (uint32_t) to_user_pointer(ial);
>  
>  	start = max_t(uint64_t, start, BIAS);
> diff --git a/tests/i915/api_intel_allocator.c b/tests/i915/api_intel_allocator.c
> index b55587e549..87abd90084 100644
> --- a/tests/i915/api_intel_allocator.c
> +++ b/tests/i915/api_intel_allocator.c
> @@ -195,6 +195,7 @@ static void basic_alloc(int fd, int cnt, uint8_t type)
>  	igt_assert_eq(intel_allocator_close(ahnd), true);
>  }
>  
> +#define NUM_OBJS 128
>  static void reuse(int fd, uint8_t type)
>  {
>  	struct test_obj obj[128], tmp;
> @@ -204,15 +205,15 @@ static void reuse(int fd, uint8_t type)
>  
>  	ahnd = intel_allocator_open(fd, 0, type);
>  
> -	for (i = 0; i < 128; i++) {
> +	for (i = 0; i < NUM_OBJS; i++) {
>  		obj[i].handle = gem_handle_gen();
>  		obj[i].size = OBJ_SIZE;
>  		obj[i].offset = intel_allocator_alloc(ahnd, obj[i].handle,
>  						      obj[i].size, align);
>  	}
>  
> -	/* check simple reuse */
> -	for (i = 0; i < 128; i++) {
> +	/* check reuse */
> +	for (i = 0; i < NUM_OBJS; i++) {
>  		prev_offset = obj[i].offset;
>  		obj[i].offset = intel_allocator_alloc(ahnd, obj[i].handle,
>  						      obj[i].size, 0);
> @@ -225,7 +226,13 @@ static void reuse(int fd, uint8_t type)
>  	/* alloc different buffer to fill freed hole */
>  	tmp.handle = gem_handle_gen();
>  	tmp.offset = intel_allocator_alloc(ahnd, tmp.handle, OBJ_SIZE, align);
> -	igt_assert(prev_offset == tmp.offset);
> +
> +	/* Simple will return previously returned offset if fits */
> +	if (type == INTEL_ALLOCATOR_SIMPLE)
> +		igt_assert(prev_offset == tmp.offset);
> +	/* Reloc is moving forward for new allocations */
> +	else if (type == INTEL_ALLOCATOR_RELOC)
> +		igt_assert(prev_offset != tmp.offset);
>  
>  	obj[i].offset = intel_allocator_alloc(ahnd, obj[i].handle,
>  					      obj[i].size, 0);
> @@ -785,10 +792,10 @@ igt_main
>  			igt_dynamic("print")
>  				basic_alloc(fd, 1UL << 2, a->type);
>  
> -			if (a->type == INTEL_ALLOCATOR_SIMPLE) {
> -				igt_dynamic("reuse")
> -					reuse(fd, a->type);
> +			igt_dynamic("reuse")
> +				reuse(fd, a->type);
>  
> +			if (a->type == INTEL_ALLOCATOR_SIMPLE) {
>  				igt_dynamic("reserve")
>  					reserve(fd, a->type);
>  			}
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [igt-dev] [PATCH i-g-t v2 5/5] tests/gem_exec_parallel: Avoid acquiring offset for overlapping handle
  2022-12-06 17:06   ` Kamil Konieczny
@ 2022-12-07 11:28     ` Zbigniew Kempczyński
  0 siblings, 0 replies; 14+ messages in thread
From: Zbigniew Kempczyński @ 2022-12-07 11:28 UTC (permalink / raw)
  To: Kamil Konieczny, igt-dev, Zbigniew Kempczyński

On Tue, Dec 06, 2022 at 06:06:21PM +0100, Kamil Konieczny wrote:
> Hi Zbigniew,
> 
> On 2022-12-05 at 21:27:08 +0100, Zbigniew Kempczyński wrote:
> > Subtest @fds incorporates objects created in some context in new context
> -------------- ^ -------------------------------------------- ^
> Looks a little unclear, maybe:
> takes objects and reuse them in new context

Ok, this sounds better.

> 
> Also try to keep in 65 chars per line in commit description.

65 or 72?

> 
> > created on new (reopened) drm fd. This might lead to clash handles
> > (same handle created over different fd,ctx) so acquiring offsets from
> > stateful allocator (reloc is from now on stateful for alloc()/free()
> > ops) might lead to bind same offset for two different objects. Lets
> 
> Maybe these shows some value in having incremental allocator
> like old reloc ? Or using here random allocator ? Just curious.

Previously reloc ahnd returned distinguish offset each call (until wrap
around). @fds test creates handles (lets say 1 - 16), then fd = reopen()
gives you new fd, so handle creation starts from 1. As we need bb handle
will equal to 1, so it will overlap handle (not directly used here, but
via flink open) to which we acquired offsets in main thread. Previously
reloc returned not overlapped offsets, but now when reloc started tracking
alloc()/free() we need to address offset overlapping.

Thanks for the review.

--
Zbigniew

> 
> > use some artificial (last max handle + 1) handle for bb to avoid offset
> > overlapping.
> > 
> 
> With that fixed
> 
> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> 
> Regards,
> Kamil
> 
> > Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> > ---
> >  tests/i915/gem_exec_parallel.c | 16 ++++++++++++++--
> >  1 file changed, 14 insertions(+), 2 deletions(-)
> > 
> > diff --git a/tests/i915/gem_exec_parallel.c b/tests/i915/gem_exec_parallel.c
> > index 730fc4a672..429620884b 100644
> > --- a/tests/i915/gem_exec_parallel.c
> > +++ b/tests/i915/gem_exec_parallel.c
> > @@ -75,7 +75,7 @@ static void *thread(void *data)
> >  	struct drm_i915_gem_relocation_entry reloc;
> >  	struct drm_i915_gem_execbuffer2 execbuf;
> >  	const intel_ctx_t *tmp_ctx = NULL;
> > -	uint64_t offset;
> > +	uint64_t offset, bb_offset;
> >  	uint32_t batch[16];
> >  	uint16_t used;
> >  	int fd, i;
> > @@ -136,6 +136,18 @@ static void *thread(void *data)
> >  		execbuf.rsvd1 = t->ctx->id;
> >  	}
> >  
> > +	/*
> > +	 * For FDS we have new drm fd, what means gem_create() for bb returns
> > +	 * handle == 1. As we're using objects from other fd it would overlap,
> > +	 * thus we need to acquire offset for bb from last handle + 1.
> > +	 * Other cases are within same fd, so obj[1].handle will be distinguish
> > +	 * anyway.
> > +	 */
> > +	if (t->flags & FDS)
> > +		bb_offset = get_offset(t->ahnd, t->scratch[NUMOBJ - 1] + 1, 4096, 0);
> > +	else
> > +		bb_offset = get_offset(t->ahnd, obj[1].handle, 4096, 0);
> > +
> >  	used = 0;
> >  	igt_until_timeout(1) {
> >  		unsigned int x = rand() % NUMOBJ;
> > @@ -154,7 +166,7 @@ static void *thread(void *data)
> >  			obj[0].offset = offset;
> >  			obj[0].flags |= EXEC_OBJECT_PINNED | EXEC_OBJECT_WRITE |
> >  					EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
> > -			obj[1].offset = get_offset(t->ahnd, obj[1].handle, 4096, 0);
> > +			obj[1].offset = bb_offset;
> >  			obj[1].flags |= EXEC_OBJECT_PINNED | EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
> >  			gem_write(fd, obj[1].handle, 0, batch, sizeof(batch));
> >  		}
> > -- 
> > 2.34.1
> > 

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-12-07 11:28 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-05 20:27 [igt-dev] [PATCH i-g-t v2 0/5] Remove random allocator and improve reloc one Zbigniew Kempczyński
2022-12-05 20:27 ` [igt-dev] [PATCH i-g-t v2 1/5] lib/intel_allocator: Remove RANDOM allocator Zbigniew Kempczyński
2022-12-06 15:56   ` Kamil Konieczny
2022-12-05 20:27 ` [igt-dev] [PATCH i-g-t v2 2/5] tests/api_intel_allocator: Remove duplicated reuse and reserve subtests Zbigniew Kempczyński
2022-12-06 15:58   ` Kamil Konieczny
2022-12-05 20:27 ` [igt-dev] [PATCH i-g-t v2 3/5] lib/intel_allocator_reloc: Introduce stateful allocations in reloc Zbigniew Kempczyński
2022-12-06 21:39   ` Kamil Konieczny
2022-12-05 20:27 ` [igt-dev] [PATCH i-g-t v2 4/5] tests/gem_ctx_shared: Remove necessity of passing offset to function call Zbigniew Kempczyński
2022-12-06 16:31   ` Kamil Konieczny
2022-12-05 20:27 ` [igt-dev] [PATCH i-g-t v2 5/5] tests/gem_exec_parallel: Avoid acquiring offset for overlapping handle Zbigniew Kempczyński
2022-12-06 17:06   ` Kamil Konieczny
2022-12-07 11:28     ` Zbigniew Kempczyński
2022-12-05 21:06 ` [igt-dev] ✓ Fi.CI.BAT: success for Remove random allocator and improve reloc one (rev2) Patchwork
2022-12-05 22:24 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox