[PATCH i-g-t v3 08/22] lib/intel_allocator_msgchannel: scale to 4k of parallel clients

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Wed Oct 14 11:05:28 UTC 2020


Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
Cc: Dominik Grzegorzek <dominik.grzegorzek at intel.com>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
---
 lib/intel_allocator_msgchannel.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lib/intel_allocator_msgchannel.c b/lib/intel_allocator_msgchannel.c
index 084a977d..8c9fb35b 100644
--- a/lib/intel_allocator_msgchannel.c
+++ b/lib/intel_allocator_msgchannel.c
@@ -12,6 +12,7 @@ extern __thread pid_t child_tid;
 
 #define FTOK_IGT_ALLOCATOR_KEY "/tmp/igt.allocator.key"
 #define FTOK_IGT_ALLOCATOR_PROJID 2020
+#define MAXQLEN 4096
 
 #define ALLOCATOR_REQUEST 1
 
@@ -57,6 +58,13 @@ static void msgqueue_init(struct msg_channel *channel)
 	queue = msgget(key, IPC_CREAT);
 	igt_debug("msg queue: %d\n", queue);
 
+	igt_assert(msgctl(queue, IPC_STAT, &qstat) == 0);
+	igt_debug("msg size in bytes: %lu\n", qstat.msg_qbytes);
+	qstat.msg_qbytes = MAXQLEN * sizeof(struct msgqueue_buf);
+	igt_info("resizing queue to support %d requests\n", MAXQLEN);
+	igt_assert_f(msgctl(queue, IPC_SET, &qstat) == 0,
+		     "Couldn't change queue size to %lu\n", qstat.msg_qbytes);
+
 	msgdata = calloc(1, sizeof(*msgdata));
 	igt_assert(msgdata);
 	msgdata->key = key;
-- 
2.26.0



More information about the Intel-gfx-trybot mailing list