[PATCH 5/5] staging: vchiq_arm: Avoid premature message stalls

Stefan Wahren stefan.wahren at i2se.com
Tue Jan 17 20:56:15 UTC 2017


From: Phil Elwell <phil at raspberrypi.org>

The constants MAX_COMPLETIONS and MSG_QUEUE_SIZE control
the number of messages that can be outstanding to each client
before the system as a whole stalls. If the numbers are too
small then unnecessary thread switching will occur while
waiting for a (potentially low priority) client thread to
consume some data; badly written clients can even lead to
deadlock.

For services that carry many short messages, 16 messages can
represent a very small amount of data. Since the resources
are small - 16 bytes for a completion, 4 bytes for a message
pointer - increase the limits so they are unlikely to be hit
except in exceptional circumstances.

Signed-off-by: Phil Elwell <phil at raspberrypi.org>
Signed-off-by: Stefan Wahren <stefan.wahren at i2se.com>
---
 .../vc04_services/interface/vchiq_arm/vchiq_arm.c  |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index b02dc4b..1dc8627 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -64,10 +64,10 @@
 #define VCHIQ_MINOR 0
 
 /* Some per-instance constants */
-#define MAX_COMPLETIONS 16
+#define MAX_COMPLETIONS 128
 #define MAX_SERVICES 64
 #define MAX_ELEMENTS 8
-#define MSG_QUEUE_SIZE 64
+#define MSG_QUEUE_SIZE 128
 
 #define KEEPALIVE_VER 1
 #define KEEPALIVE_VER_MIN KEEPALIVE_VER
-- 
1.7.9.5



More information about the devel mailing list