From: Lukasz Skalski Date: Fri, 13 May 2016 14:08:36 +0000 (+0200) Subject: kdbus: increase kdbus receive pool size to 16M X-Git-Tag: accepted/tizen/common/20160517.173904^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d753908d1b49eb7caea63d738268966218fd7b7e;p=platform%2Fupstream%2Fdbus.git kdbus: increase kdbus receive pool size to 16M Current kdbus receive pool size is too small (only 2MB - in GLib we have 16MB). Due to quite specific 'pool layout' in kdbus module, 2MB was not enough for 512kB messages - according to kdbus docs: "50% of a pool is always owned by the connection. It is reserved for kernel queries, handling received messages and other tasks that are under control of the pool owner. The other 50% of the pool are used as incoming queue. As we optionally support user-space based policies, we need fair allocation schemes. Furthermore, resource utilization should be maximized, so only minimal resources stay reserved. However, we need to adapt to a dynamic number of users, as we cannot know how many users will talk to a connection. Therefore, the current allocation works like this: We limit the number of bytes in a destination's pool per sending user. The space available for a user is 33% of the unused pool space (whereas the space used by the user itself is also treated as 'unused'). This way, we favor users coming first, but keep enough pool space available for any following users. Given that messages are dequeued in FIFO order, this should balance nicely if the number of users grows. At the same time, this algorithm guarantees that the space available to a connection is reduced dynamically, the more concurrent users talk to a connection." Change-Id: Iffddc018f0d8bf08451d12d305c8d392ed3e1f55 --- diff --git a/dbus/dbus-transport-kdbus.c b/dbus/dbus-transport-kdbus.c index 8fb53ae..0b57753 100644 --- a/dbus/dbus-transport-kdbus.c +++ b/dbus/dbus-transport-kdbus.c @@ -113,7 +113,7 @@ int debug = -1; */ /** Default Size of the memory area for received non-memfd messages. */ -#define RECEIVE_POOL_SIZE_DEFAULT_SIZE (2 * 1024LU * 1024LU) +#define RECEIVE_POOL_SIZE_DEFAULT_SIZE (16 * 1024LU * 1024LU) /** Name of environmental variable to define receive pool size*/ #define RECEIVE_POOL_SIZE_ENV_VAR_NAME "KDBUS_MEMORY_POOL_SIZE" /** Max size of pool size in megabytes*/