Skip to contentSkip to conversation

Fix the multiprocess mode of intel allocator

PATCH Superseded Andrzej Turko 3 participants 4 messages May 26, 2021 – May 27, 2021 Library code

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v2 cover Fix the multiprocess mode of intel allocator

In the multiprocess mode all requests to the allocator are processed in the parent. However, in certain scenarios (for example gem_exec_capture@pi), a child process may want to create an allocator instance using its own private file desriptor. Thus all ioctls used to determine available gtt size must be called in the child process and not in the parent.

This patch implements the above change.

v2: Test allocators for private and shared contexts in
multiprocess mode.

Cc Zbigniew Kempczyński <[email protected]>

Andrzej Turko (1):
lib/intel_allocator: Move the ioctl calls to client processes

 lib/intel_allocator.c            | 51 +++++++++++++++++++++++---------
 lib/intel_allocator_random.c     | 27 +++++++----------
 lib/intel_allocator_reloc.c      | 20 ++++---------
 lib/intel_allocator_simple.c     | 44 ++++-----------------------
 tests/i915/api_intel_allocator.c | 47 +++++++++++++++++++++++++++++
 5 files changed, 104 insertions(+), 85 deletions(-)
Signature · 6 lines
2.25.1

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

PATCH v2 1/1 lib/intel_allocator: Move the ioctl calls to client processes

When running the allocator in multiprocess mode, all queries are processed in a designated thread in the parent process. However, a child process may request opening the allocator for a gpu using a file descriptor absent in the parent process. Hence, querying available gtt size must be done in the child instead of the parent process.

This modification has triggered slight changes to the creation of random and reloc allocators.

Cc Zbigniew Kempczyński <[email protected]>
---
 lib/intel_allocator.c            | 51 +++++++++++++++++++++++---------
 lib/intel_allocator_random.c     | 27 +++++++----------
 lib/intel_allocator_reloc.c      | 20 ++++---------
 lib/intel_allocator_simple.c     | 44 ++++-----------------------
 tests/i915/api_intel_allocator.c | 47 +++++++++++++++++++++++++++++
 5 files changed, 104 insertions(+), 85 deletions(-)
lib/intel_allocator.c +37 -14
index 96f839d4b..5313af174 100644
@@ -45,6 +45,12 @@ static inline const char *reqstr(enum reqtype request_type)
 #define alloc_debug(...) {}
 #endif
 
+/*
+ * We limit allocator space to avoid hang when batch would be
+ * pinned in the last page.
+ */
+#define RESERVED 4096
+
 struct allocator {
 	int fd;
 	uint32_t ctx;
@@ -58,12 +64,11 @@ struct handle_entry {
 	struct allocator *al;
 };
 
-struct intel_allocator *intel_allocator_reloc_create(int fd);
-struct intel_allocator *intel_allocator_random_create(int fd);
-struct intel_allocator *intel_allocator_simple_create(int fd);
+struct intel_allocator *intel_allocator_reloc_create(int fd, uint64_t end);
+struct intel_allocator *intel_allocator_random_create(int fd, uint64_t end);
 struct intel_allocator *
-intel_allocator_simple_create_full(int fd, uint64_t start, uint64_t end,
-				   enum allocator_strategy strategy);
+intel_allocator_simple_create(int fd, uint64_t start, uint64_t end,
+			      enum allocator_strategy strategy);
 
 /*
  * Instead of trying to find first empty handle just get new one. Assuming
@@ -286,17 +291,14 @@ static struct intel_allocator *intel_allocator_create(int fd,
 			     "We cannot use NONE allocator\n");
 		break;
 	case INTEL_ALLOCATOR_RELOC:
-		ial = intel_allocator_reloc_create(fd);
+		ial = intel_allocator_reloc_create(fd, end);
 		break;
 	case INTEL_ALLOCATOR_RANDOM:
-		ial = intel_allocator_random_create(fd);
+		ial = intel_allocator_random_create(fd, end);
 		break;
 	case INTEL_ALLOCATOR_SIMPLE:
-		if (!start && !end)
-			ial = intel_allocator_simple_create(fd);
-		else
-			ial = intel_allocator_simple_create_full(fd, start, end,
-								 allocator_strategy);
+		ial = intel_allocator_simple_create(fd, start, end,
+						    allocator_strategy);
 		break;
 	default:
 		igt_assert_f(ial, "Allocator type %d not implemented\n",
@@ -877,6 +879,13 @@ static uint64_t __intel_allocator_open_full(int fd, uint32_t ctx,
 				 .open.allocator_type = allocator_type,
 				 .open.allocator_strategy = strategy };
 	struct alloc_resp resp;
+	uint64_t gtt_size = gem_aperture_size(fd);
+
+	igt_assert(end <= gtt_size);
+	if (!gem_uses_full_ppgtt(fd))
+		gtt_size /= 2;
+	igt_assert(end - start <= gtt_size);
+
 
 	/* Get child_tid only once at open() */
 	if (child_tid == -1)
@@ -954,13 +963,27 @@ uint64_t intel_allocator_open_vm_full(int fd, uint32_t vm,
  */
 uint64_t intel_allocator_open(int fd, uint32_t ctx, uint8_t allocator_type)
 {
-	return intel_allocator_open_full(fd, ctx, 0, 0, allocator_type,
+	uint64_t gtt_size = gem_aperture_size(fd);
+
+	if (!gem_uses_full_ppgtt(fd))
+		gtt_size /= 2;
+	else
+		gtt_size -= RESERVED;
+
+	return intel_allocator_open_full(fd, ctx, 0, gtt_size, allocator_type,
 					 ALLOC_STRATEGY_HIGH_TO_LOW);
 }
 
 uint64_t intel_allocator_open_vm(int fd, uint32_t vm, uint8_t allocator_type)
 {
-	return intel_allocator_open_vm_full(fd, vm, 0, 0, allocator_type,
+	uint64_t gtt_size = gem_aperture_size(fd);
+
+	if (!gem_uses_full_ppgtt(fd))
+		gtt_size /= 2;
+	else
+		gtt_size -= RESERVED;
+
+	return intel_allocator_open_vm_full(fd, vm, 0, gtt_size, allocator_type,
 					    ALLOC_STRATEGY_HIGH_TO_LOW);
 }
 
lib/intel_allocator_random.c +10 -17
index 3d9a78f17..901a301a2 100644
@@ -10,12 +10,12 @@
 #include "igt_rand.h"
 #include "intel_allocator.h"
 
-struct intel_allocator *intel_allocator_random_create(int fd);
+struct intel_allocator *intel_allocator_random_create(int fd, uint64_t end);
 
 struct intel_allocator_random {
 	uint64_t bias;
 	uint32_t prng;
-	uint64_t gtt_size;
+	uint64_t address_mask;
 	uint64_t start;
 	uint64_t end;
 
@@ -23,12 +23,8 @@ struct intel_allocator_random {
 	uint64_t allocated_objects;
 };
 
-static uint64_t get_bias(int fd)
-{
-	(void) fd;
+#define BIAS 256 << 10;
 
-	return 256 << 10;
-}
 
 static void intel_allocator_random_get_address_range(struct intel_allocator *ial,
 						     uint64_t *startp,
@@ -57,8 +53,8 @@ static uint64_t intel_allocator_random_alloc(struct intel_allocator *ial,
 	/* randomize the address, we try to avoid relocations */
 	do {
 		offset = hars_petruska_f54_1_random64(&ialr->prng);
-		offset += ialr->bias; /* Keep the low 256k clear, for negative deltas */
-		offset &= ialr->gtt_size - 1;
+		offset |= ialr->bias; /* Keep the low 256k clear, for negative deltas */
+		offset &= ialr->address_mask;
 		offset &= ~(alignment - 1);
 	} while (offset + size > ialr->end);
 
@@ -150,8 +146,7 @@ static bool intel_allocator_random_is_empty(struct intel_allocator *ial)
 	return !ialr->allocated_objects;
 }
 
-#define RESERVED 4096
-struct intel_allocator *intel_allocator_random_create(int fd)
+struct intel_allocator *intel_allocator_random_create(int fd, uint64_t end)
 {
 	struct intel_allocator *ial;
 	struct intel_allocator_random *ialr;
@@ -175,14 +170,12 @@ struct intel_allocator *intel_allocator_random_create(int fd)
 	ialr = ial->priv = calloc(1, sizeof(*ialr));
 	igt_assert(ial->priv);
 	ialr->prng = (uint32_t) to_user_pointer(ial);
-	ialr->gtt_size = gem_aperture_size(fd);
-	igt_debug("Gtt size: %" PRId64 "\n", ialr->gtt_size);
-	if (!gem_uses_full_ppgtt(fd))
-		ialr->gtt_size /= 2;
+	igt_assert(end > 0);
+	ialr->address_mask = (1ULL << (igt_fls(end) - 1)) - 1;
 
-	ialr->bias = get_bias(fd);
+	ialr->bias = BIAS;
 	ialr->start = ialr->bias;
-	ialr->end = ialr->gtt_size - RESERVED;
+	ialr->end = end;
 
 	ialr->allocated_objects = 0;
 
lib/intel_allocator_reloc.c +5 -15
index e8af787b0..e856132a7 100644
@@ -10,12 +10,11 @@
 #include "igt_rand.h"
 #include "intel_allocator.h"
 
-struct intel_allocator *intel_allocator_reloc_create(int fd);
+struct intel_allocator *intel_allocator_reloc_create(int fd, uint64_t end);
 
 struct intel_allocator_reloc {
 	uint64_t bias;
 	uint32_t prng;
-	uint64_t gtt_size;
 	uint64_t start;
 	uint64_t end;
 	uint64_t offset;
@@ -24,12 +23,8 @@ struct intel_allocator_reloc {
 	uint64_t allocated_objects;
 };
 
-static uint64_t get_bias(int fd)
-{
-	(void) fd;
+#define BIAS 256 << 10;
 
-	return 256 << 10;
-}
 
 static void intel_allocator_reloc_get_address_range(struct intel_allocator *ial,
 						    uint64_t *startp,
@@ -152,8 +147,7 @@ static bool intel_allocator_reloc_is_empty(struct intel_allocator *ial)
 	return !ialr->allocated_objects;
 }
 
-#define RESERVED 4096
-struct intel_allocator *intel_allocator_reloc_create(int fd)
+struct intel_allocator *intel_allocator_reloc_create(int fd, uint64_t end)
 {
 	struct intel_allocator *ial;
 	struct intel_allocator_reloc *ialr;
@@ -177,14 +171,10 @@ struct intel_allocator *intel_allocator_reloc_create(int fd)
 	ialr = ial->priv = calloc(1, sizeof(*ialr));
 	igt_assert(ial->priv);
 	ialr->prng = (uint32_t) to_user_pointer(ial);
-	ialr->gtt_size = gem_aperture_size(fd);
-	igt_debug("Gtt size: %" PRId64 "\n", ialr->gtt_size);
-	if (!gem_uses_full_ppgtt(fd))
-		ialr->gtt_size /= 2;
 
-	ialr->bias = ialr->offset = get_bias(fd);
+	ialr->bias = ialr->offset = BIAS;
 	ialr->start = ialr->bias;
-	ialr->end = ialr->gtt_size - RESERVED;
+	ialr->end = end;
 
 	ialr->allocated_objects = 0;
 
lib/intel_allocator_simple.c +5 -39

62 lines not on this page · raw message

tests/i915/api_intel_allocator.c +47 -0

59 lines not on this page · raw message

Signature · 6 lines
2.25.1

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#2 lore raw

Re: [igt-dev] [PATCH i-g-t 1/1] lib/intel_allocator: Move the ioctl calls to client processes

Quoted 226 lines · Andrzej Turko

When running the allocator in multiprocess mode, all queries are processed in a designated thread in the parent process. However, a child process may request opening the allocator for a gpu using a file descriptor absent in the parent process. Hence, querying available gtt size must be done in the child instead of the parent process.

This modification has triggered slight changes to the creation of random and reloc allocators.

Cc Zbigniew Kempczyński <[email protected]>
---
 lib/intel_allocator.c            | 51 +++++++++++++++++++++++---------
 lib/intel_allocator_random.c     | 27 +++++++----------
 lib/intel_allocator_reloc.c      | 20 ++++---------
 lib/intel_allocator_simple.c     | 44 ++++-----------------------
 tests/i915/api_intel_allocator.c | 47 +++++++++++++++++++++++++++++
 5 files changed, 104 insertions(+), 85 deletions(-)
lib/intel_allocator.c +37 -14
index 96f839d4b..5313af174 100644
@@ -45,6 +45,12 @@ static inline const char *reqstr(enum reqtype request_type)
 #define alloc_debug(...) {}
 #endif
 
+/*
+ * We limit allocator space to avoid hang when batch would be
+ * pinned in the last page.
+ */
+#define RESERVED 4096
+
 struct allocator {
 	int fd;
 	uint32_t ctx;
@@ -58,12 +64,11 @@ struct handle_entry {
 	struct allocator *al;
 };
 
-struct intel_allocator *intel_allocator_reloc_create(int fd);
-struct intel_allocator *intel_allocator_random_create(int fd);
-struct intel_allocator *intel_allocator_simple_create(int fd);
+struct intel_allocator *intel_allocator_reloc_create(int fd, uint64_t end);
+struct intel_allocator *intel_allocator_random_create(int fd, uint64_t end);
 struct intel_allocator *
-intel_allocator_simple_create_full(int fd, uint64_t start, uint64_t end,
-				   enum allocator_strategy strategy);
+intel_allocator_simple_create(int fd, uint64_t start, uint64_t end,
+			      enum allocator_strategy strategy);
 
 /*
  * Instead of trying to find first empty handle just get new one. Assuming
@@ -286,17 +291,14 @@ static struct intel_allocator *intel_allocator_create(int fd,
 			     "We cannot use NONE allocator\n");
 		break;
 	case INTEL_ALLOCATOR_RELOC:
-		ial = intel_allocator_reloc_create(fd);
+		ial = intel_allocator_reloc_create(fd, end);
 		break;
 	case INTEL_ALLOCATOR_RANDOM:
-		ial = intel_allocator_random_create(fd);
+		ial = intel_allocator_random_create(fd, end);
 		break;
 	case INTEL_ALLOCATOR_SIMPLE:
-		if (!start && !end)
-			ial = intel_allocator_simple_create(fd);
-		else
-			ial = intel_allocator_simple_create_full(fd, start, end,
-								 allocator_strategy);
+		ial = intel_allocator_simple_create(fd, start, end,
+						    allocator_strategy);
 		break;
 	default:
 		igt_assert_f(ial, "Allocator type %d not implemented\n",
@@ -877,6 +879,13 @@ static uint64_t __intel_allocator_open_full(int fd, uint32_t ctx,
 				 .open.allocator_type = allocator_type,
 				 .open.allocator_strategy = strategy };
 	struct alloc_resp resp;
+	uint64_t gtt_size = gem_aperture_size(fd);
+
+	igt_assert(end <= gtt_size);
+	if (!gem_uses_full_ppgtt(fd))
+		gtt_size /= 2;
+	igt_assert(end - start <= gtt_size);
+
 
 	/* Get child_tid only once at open() */
 	if (child_tid == -1)
@@ -954,13 +963,27 @@ uint64_t intel_allocator_open_vm_full(int fd, uint32_t vm,
  */
 uint64_t intel_allocator_open(int fd, uint32_t ctx, uint8_t allocator_type)
 {
-	return intel_allocator_open_full(fd, ctx, 0, 0, allocator_type,
+	uint64_t gtt_size = gem_aperture_size(fd);
+
+	if (!gem_uses_full_ppgtt(fd))
+		gtt_size /= 2;
+	else
+		gtt_size -= RESERVED;
+
+	return intel_allocator_open_full(fd, ctx, 0, gtt_size, allocator_type,
 					 ALLOC_STRATEGY_HIGH_TO_LOW);
 }
 
 uint64_t intel_allocator_open_vm(int fd, uint32_t vm, uint8_t allocator_type)
 {
-	return intel_allocator_open_vm_full(fd, vm, 0, 0, allocator_type,
+	uint64_t gtt_size = gem_aperture_size(fd);
+
+	if (!gem_uses_full_ppgtt(fd))
+		gtt_size /= 2;
+	else
+		gtt_size -= RESERVED;
+
+	return intel_allocator_open_vm_full(fd, vm, 0, gtt_size, allocator_type,
 					    ALLOC_STRATEGY_HIGH_TO_LOW);
 }
 
lib/intel_allocator_random.c +10 -17
index 3d9a78f17..901a301a2 100644
@@ -10,12 +10,12 @@
 #include "igt_rand.h"
 #include "intel_allocator.h"
 
-struct intel_allocator *intel_allocator_random_create(int fd);
+struct intel_allocator *intel_allocator_random_create(int fd, uint64_t end);
 
 struct intel_allocator_random {
 	uint64_t bias;
 	uint32_t prng;
-	uint64_t gtt_size;
+	uint64_t address_mask;
 	uint64_t start;
 	uint64_t end;
 
@@ -23,12 +23,8 @@ struct intel_allocator_random {
 	uint64_t allocated_objects;
 };
 
-static uint64_t get_bias(int fd)
-{
-	(void) fd;
+#define BIAS 256 << 10;
 
-	return 256 << 10;
-}
 
 static void intel_allocator_random_get_address_range(struct intel_allocator *ial,
 						     uint64_t *startp,
@@ -57,8 +53,8 @@ static uint64_t intel_allocator_random_alloc(struct intel_allocator *ial,
 	/* randomize the address, we try to avoid relocations */
 	do {
 		offset = hars_petruska_f54_1_random64(&ialr->prng);
-		offset += ialr->bias; /* Keep the low 256k clear, for negative deltas */
-		offset &= ialr->gtt_size - 1;
+		offset |= ialr->bias; /* Keep the low 256k clear, for negative deltas */
+		offset &= ialr->address_mask;
 		offset &= ~(alignment - 1);
 	} while (offset + size > ialr->end);
 
@@ -150,8 +146,7 @@ static bool intel_allocator_random_is_empty(struct intel_allocator *ial)
 	return !ialr->allocated_objects;
 }
 
-#define RESERVED 4096
-struct intel_allocator *intel_allocator_random_create(int fd)
+struct intel_allocator *intel_allocator_random_create(int fd, uint64_t end)
 {
 	struct intel_allocator *ial;
 	struct intel_allocator_random *ialr;
@@ -175,14 +170,12 @@ struct intel_allocator *intel_allocator_random_create(int fd)
 	ialr = ial->priv = calloc(1, sizeof(*ialr));
 	igt_assert(ial->priv);
 	ialr->prng = (uint32_t) to_user_pointer(ial);
-	ialr->gtt_size = gem_aperture_size(fd);
-	igt_debug("Gtt size: %" PRId64 "\n", ialr->gtt_size);
-	if (!gem_uses_full_ppgtt(fd))
-		ialr->gtt_size /= 2;
+	igt_assert(end > 0);
+	ialr->address_mask = (1ULL << (igt_fls(end) - 1)) - 1;
 
-	ialr->bias = get_bias(fd);
+	ialr->bias = BIAS;
 	ialr->start = ialr->bias;
-	ialr->end = ialr->gtt_size - RESERVED;
+	ialr->end = end;
 
 	ialr->allocated_objects = 0;
 
lib/intel_allocator_reloc.c +2 -7
index e8af787b0..e856132a7 100644
@@ -10,12 +10,11 @@
 #include "igt_rand.h"
 #include "intel_allocator.h"
 
-struct intel_allocator *intel_allocator_reloc_create(int fd);
+struct intel_allocator *intel_allocator_reloc_create(int fd, uint64_t end);
 
 struct intel_allocator_reloc {
 	uint64_t bias;
 	uint32_t prng;
-	uint64_t gtt_size;
 	uint64_t start;
 	uint64_t end;
 	uint64_t offset;
@@ -24,12 +23,8 @@ struct intel_allocator_reloc {
 	uint64_t allocated_objects;
 };
 
-static uint64_t get_bias(int fd)
-{
-	(void) fd;
+#define BIAS 256 << 10;
 
-	return 256 << 10;
-}
 
 static void intel_allocator_reloc_get_address_range(struct intel_allocator *ial,
 						    uint64_t *startp,

lib/intel_allocator_reloc.c static bool intel_allocator_reloc_is_empty(struct intel_allocator *ial) · line 150

Quoted 6 lines
lib/intel_allocator_reloc.c +1 -2
@@ -152,8 +147,7 @@ static bool intel_allocator_reloc_is_empty(struct intel_allocator *ial)
 	return !ialr->allocated_objects;
 }
 
-#define RESERVED 4096
-struct intel_allocator *intel_allocator_reloc_create(int fd)
+struct intel_allocator *intel_allocator_reloc_create(int fd, uint64_t end)

We don't need fd too, we can just get rid of them from allocator implementation (it must be set in intel_allocator.c).

Quoted 94 lines
lib/intel_allocator_reloc.c +2 -6
 {
 	struct intel_allocator *ial;
 	struct intel_allocator_reloc *ialr;
@@ -177,14 +171,10 @@ struct intel_allocator *intel_allocator_reloc_create(int fd)
 	ialr = ial->priv = calloc(1, sizeof(*ialr));
 	igt_assert(ial->priv);
 	ialr->prng = (uint32_t) to_user_pointer(ial);
-	ialr->gtt_size = gem_aperture_size(fd);
-	igt_debug("Gtt size: %" PRId64 "\n", ialr->gtt_size);
-	if (!gem_uses_full_ppgtt(fd))
-		ialr->gtt_size /= 2;
 
-	ialr->bias = ialr->offset = get_bias(fd);
+	ialr->bias = ialr->offset = BIAS;
 	ialr->start = ialr->bias;
-	ialr->end = ialr->gtt_size - RESERVED;
+	ialr->end = end;
 
 	ialr->allocated_objects = 0;
 
lib/intel_allocator_simple.c +5 -39
index 963d8d257..6022e832b 100644
@@ -11,17 +11,11 @@
 #include "intel_bufops.h"
 #include "igt_map.h"
 
-/*
- * We limit allocator space to avoid hang when batch would be
- * pinned in the last page.
- */
-#define RESERVED 4096
 
 /* Avoid compilation warning */
-struct intel_allocator *intel_allocator_simple_create(int fd);
 struct intel_allocator *
-intel_allocator_simple_create_full(int fd, uint64_t start, uint64_t end,
-				   enum allocator_strategy strategy);
+intel_allocator_simple_create(int fd, uint64_t start, uint64_t end,
+			      enum allocator_strategy strategy);
 
 struct simple_vma_heap {
 	struct igt_list_head holes;
@@ -734,9 +728,9 @@ static void intel_allocator_simple_print(struct intel_allocator *ial, bool full)
 		 ials->allocated_objects, ials->reserved_areas);
 }
 
-static struct intel_allocator *
-__intel_allocator_simple_create(int fd, uint64_t start, uint64_t end,
-				enum allocator_strategy strategy)
+struct intel_allocator *
+intel_allocator_simple_create(int fd, uint64_t start, uint64_t end,
+			      enum allocator_strategy strategy)
 {
 	struct intel_allocator *ial;
 	struct intel_allocator_simple *ials;
@@ -777,31 +771,3 @@ __intel_allocator_simple_create(int fd, uint64_t start, uint64_t end,
 
 	return ial;
 }
-
-struct intel_allocator *
-intel_allocator_simple_create(int fd)
-{
-	uint64_t gtt_size = gem_aperture_size(fd);
-
-	if (!gem_uses_full_ppgtt(fd))
-		gtt_size /= 2;
-	else
-		gtt_size -= RESERVED;
-
-	return __intel_allocator_simple_create(fd, 0, gtt_size,
-					       ALLOC_STRATEGY_HIGH_TO_LOW);
-}
-
-struct intel_allocator *
-intel_allocator_simple_create_full(int fd, uint64_t start, uint64_t end,
-				   enum allocator_strategy strategy)
-{
-	uint64_t gtt_size = gem_aperture_size(fd);
-
-	igt_assert(end <= gtt_size);
-	if (!gem_uses_full_ppgtt(fd))
-		gtt_size /= 2;
-	igt_assert(end - start <= gtt_size);
-
-	return __intel_allocator_simple_create(fd, start, end, strategy);
-}
tests/i915/api_intel_allocator.c +0 -0
index 182d9ba79..b4f7799e7 100644

tests/i915/api_intel_allocator.c static void execbuf_with_allocator(int fd) · line 623

Quoted 4 lines
tests/i915/api_intel_allocator.c +1 -0
@@ -620,6 +620,50 @@ static void execbuf_with_allocator(int fd)
 	igt_assert(intel_allocator_close(ahnd) == true);
 }
 
+static void multiprocess(int fd, uint8_t type) {

Reopen would be better name than multiprocess imo.

tests/i915/api_intel_allocator.c static void execbuf_with_allocator(int fd) · line 636

Quoted 13 lines
tests/i915/api_intel_allocator.c +13 -0
+	uint64_t p_ahnd, sh_ahnd, fd_ahnd, ctx_ahnd;
+	uint64_t sh_left, sh_right, fd_left, fd_right;
+	uint64_t offset;
+
+	intel_allocator_multiprocess_start();
+
+	p_ahnd = intel_allocator_open(fd, 0, type);
+	offset = intel_allocator_alloc(p_ahnd, 1, 123, 0);
+	if (type == INTEL_ALLOCATOR_SIMPLE)
+		igt_assert(intel_allocator_is_allocated(p_ahnd, 1, 123, offset));
+
+	igt_fork(child, 1) {
+

Extra space.

Quoted 4 lines
tests/i915/api_intel_allocator.c +4 -0
+		sh_ahnd = intel_allocator_open(fd, 0, type);
+		if (type == INTEL_ALLOCATOR_SIMPLE)
+			igt_assert(intel_allocator_is_allocated(sh_ahnd, 1, 123, offset));
+

tests/i915/api_intel_allocator.c static void execbuf_with_allocator(int fd) · line 650

Quoted 10 lines
tests/i915/api_intel_allocator.c +10 -0
+		ctx_ahnd = intel_allocator_open(fd, 1, type);
+		igt_assert(!intel_allocator_is_allocated(ctx_ahnd, 1, 123, offset));
+		intel_allocator_alloc(ctx_ahnd, 2, 123, 0);
+
+		fd = gem_reopen_driver(fd);
+		fd_ahnd = intel_allocator_open(fd, 0, type);
+		igt_assert(!intel_allocator_is_allocated(fd_ahnd, 1, 123, offset));
+		intel_allocator_alloc(fd_ahnd, 2, 123, 0);
+
+

Same.

--
Zbigniew

Quoted 32 lines
tests/i915/api_intel_allocator.c +19 -0
+		intel_allocator_get_address_range(sh_ahnd, &sh_left, &sh_right);
+		intel_allocator_get_address_range(fd_ahnd, &fd_left, &fd_right);
+		igt_assert(sh_left == fd_left && sh_right == fd_right);
+
+		intel_allocator_close(sh_ahnd);
+		intel_allocator_close(ctx_ahnd);
+		intel_allocator_close(fd_ahnd);
+
+	}
+
+	igt_waitchildren();
+	intel_allocator_close(p_ahnd);
+
+	intel_allocator_multiprocess_stop();
+}
+
 struct allocators {
 	const char *name;
 	uint8_t type;
@@ -671,6 +715,9 @@ igt_main
 				igt_dynamic("reserve")
 					reserve(fd, a->type);
 			}
+
+			igt_dynamic("multiprocess")
+					multiprocess(fd, a->type);
 		}
 	}
 
Signature · 1 line
2.25.1

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#3 lore raw

[igt-dev] ✗ Fi.CI.BAT: failure for Fix the multiprocess mode of intel allocator (rev2)

In reply to Andrzej Turko
== Series Details ==

== Series Details ==

Series: Fix the multiprocess mode of intel allocator (rev2)
URL : https://patchwork.freedesktop.org/series/90481/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_10135 -> IGTPW_5853
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with IGTPW_5853 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in IGTPW_5853, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

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

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

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

### IGT changes ###

#### Possible regressions ####

* igt@gem_tiled_blits@basic:
- fi-tgl-y: [PASS][1] -> [FAIL][2] +3 similar issues
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/fi-tgl-y/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5853/fi-tgl-y/igt@[email protected]

* igt@kms_frontbuffer_tracking@basic:
- fi-tgl-u2: [PASS][3] -> [FAIL][4] +3 similar issues
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/fi-tgl-u2/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5853/fi-tgl-u2/igt@[email protected]

#### Suppressed ####

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

* igt@gem_tiled_blits@basic:
- {fi-rkl-11500t}: NOTRUN -> [FAIL][5] +3 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5853/fi-rkl-11500t/igt@[email protected]

* igt@kms_frontbuffer_tracking@basic:
- {fi-tgl-dsi}: [PASS][6] -> [FAIL][7] +3 similar issues
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/fi-tgl-dsi/igt@[email protected]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5853/fi-tgl-dsi/igt@[email protected]

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

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

### IGT changes ###

#### Issues hit ####

* igt@i915_selftest@live@execlists:
- fi-bsw-kefka: NOTRUN -> [INCOMPLETE][8] ([i915#2782] / [i915#2940] / [i915#3462])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5853/fi-bsw-kefka/igt@i915_selftest@[email protected]

* igt@kms_chamelium@hdmi-edid-read:
- fi-bsw-kefka: NOTRUN -> [SKIP][9] ([fdo#109271] / [fdo#111827]) +8 similar issues
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5853/fi-bsw-kefka/igt@[email protected]

* igt@kms_psr@cursor_plane_move:
- fi-bsw-kefka: NOTRUN -> [SKIP][10] ([fdo#109271]) +14 similar issues
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5853/fi-bsw-kefka/igt@kms_psr@cursor_plane_move.html

* igt@runner@aborted:
- fi-bsw-kefka: NOTRUN -> [FAIL][11] ([fdo#109271] / [i915#1436])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5853/fi-bsw-kefka/igt@[email protected]

#### Warnings ####

* igt@i915_selftest@live@execlists:
- fi-cfl-8109u: [INCOMPLETE][12] ([i915#3462]) -> [DMESG-FAIL][13] ([i915#3462])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/fi-cfl-8109u/igt@i915_selftest@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5853/fi-cfl-8109u/igt@i915_selftest@[email protected]
- fi-tgl-u2: [DMESG-FAIL][14] ([i915#3462]) -> [INCOMPLETE][15] ([i915#3462])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/fi-tgl-u2/igt@i915_selftest@[email protected]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5853/fi-tgl-u2/igt@i915_selftest@[email protected]

* igt@runner@aborted:
- fi-cfl-8700k: [FAIL][16] ([i915#2426] / [i915#3363]) -> [FAIL][17] ([i915#3363])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/fi-cfl-8700k/igt@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5853/fi-cfl-8700k/igt@[email protected]
- fi-skl-6600u: [FAIL][18] ([i915#1436] / [i915#2426] / [i915#3363]) -> [FAIL][19] ([i915#1436] / [i915#3363])
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/fi-skl-6600u/igt@[email protected]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5853/fi-skl-6600u/igt@[email protected]
- fi-cfl-8109u: [FAIL][20] ([i915#3363]) -> [FAIL][21] ([i915#2426] / [i915#3363])
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/fi-cfl-8109u/igt@[email protected]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5853/fi-cfl-8109u/igt@[email protected]
- fi-glk-dsi: [FAIL][22] ([i915#3363] / [k.org#202321]) -> [FAIL][23] ([i915#2426] / [i915#3363] / [k.org#202321])
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/fi-glk-dsi/igt@[email protected]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5853/fi-glk-dsi/igt@[email protected]
- fi-kbl-soraka: [FAIL][24] ([i915#1436] / [i915#2426] / [i915#3363]) -> [FAIL][25] ([i915#1436] / [i915#3363])
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/fi-kbl-soraka/igt@[email protected]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5853/fi-kbl-soraka/igt@[email protected]
- fi-kbl-7567u: [FAIL][26] ([i915#1436] / [i915#2426] / [i915#3363]) -> [FAIL][27] ([i915#1436] / [i915#3363])
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/fi-kbl-7567u/igt@[email protected]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5853/fi-kbl-7567u/igt@[email protected]
- fi-skl-6700k2: [FAIL][28] ([i915#1436] / [i915#2426] / [i915#3363]) -> [FAIL][29] ([i915#1436] / [i915#3363])
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10135/fi-skl-6700k2/igt@[email protected]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5853/fi-skl-6700k2/igt@[email protected]

{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#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#2426]: https://gitlab.freedesktop.org/drm/intel/issues/2426
[i915#2782]: https://gitlab.freedesktop.org/drm/intel/issues/2782
[i915#2940]: https://gitlab.freedesktop.org/drm/intel/issues/2940
[i915#3012]: https://gitlab.freedesktop.org/drm/intel/issues/3012
[i915#3276]: https://gitlab.freedesktop.org/drm/intel/issues/3276
[i915#3277]: https://gitlab.freedesktop.org/drm/intel/issues/3277
[i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
[i915#3283]: https://gitlab.freedesktop.org/drm/intel/issues/3283
[i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
[i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
[i915#3363]: https://gitlab.freedesktop.org/drm/intel/issues/3363
[i915#3462]: https://gitlab.freedesktop.org/drm/intel/issues/3462
[i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
[k.org#202321]: https://bugzilla.kernel.org/show_bug.cgi?id=202321

Participating hosts (43 -> 40)
------------------------------

Additional (2): fi-bsw-kefka fi-rkl-11500t
Missing (5): fi-ilk-m540 fi-hsw-4200u fi-bsw-cyan fi-dg1-1 fi-bdw-samus

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

* CI: CI-20190529 -> None
* IGT: IGT_6094 -> IGTPW_5853

CI-20190529: 20190529
CI_DRM_10135: 3471adc5883339a844d766db0f8d859009387094 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_5853: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5853/index.html
IGT_6094: f62d8953c0bc5ed68ea978662e62f9dbb46cf101 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

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

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev