-
Notifications
You must be signed in to change notification settings - Fork 1
/
otp_src_R13B04-erts_de_busy_limit.patch
61 lines (54 loc) · 2.03 KB
/
otp_src_R13B04-erts_de_busy_limit.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
diff -ur ./otp_src_R13B04.orig/erts/emulator/beam/dist.c ./otp_src_R13B04/erts/emulator/beam/dist.c
--- ./otp_src_R13B04.orig/erts/emulator/beam/dist.c 2009-11-20 05:29:24.000000000 -0800
+++ ./otp_src_R13B04/erts/emulator/beam/dist.c 2010-02-14 15:06:32.000000000 -0800
@@ -97,6 +97,9 @@
#define PASS_THROUGH 'p' /* This code should go */
int erts_is_alive; /* System must be blocked on change */
+#define ERTS_DE_BUSY_LIMIT (128*1024)
+int erts_de_busy_limit = ERTS_DE_BUSY_LIMIT;
+
/* distribution trap functions */
Export* dsend2_trap = NULL;
@@ -1407,8 +1410,6 @@
return -1;
}
-#define ERTS_DE_BUSY_LIMIT (128*1024)
-
static int
dsig_send(ErtsDSigData *dsdp, Eterm ctl, Eterm msg, int force_busy)
{
@@ -1560,7 +1561,7 @@
ErtsProcList *plp = NULL;
erts_smp_spin_lock(&dep->qlock);
dep->qsize += size_obuf(obuf);
- if (dep->qsize >= ERTS_DE_BUSY_LIMIT)
+ if (dep->qsize >= erts_de_busy_limit)
dep->qflgs |= ERTS_DE_QFLG_BUSY;
if (!force_busy && (dep->qflgs & ERTS_DE_QFLG_BUSY)) {
erts_smp_spin_unlock(&dep->qlock);
@@ -1931,7 +1932,7 @@
ASSERT(dep->qsize >= obufsize);
dep->qsize -= obufsize;
obufsize = 0;
- if (de_busy && !prt_busy && dep->qsize < ERTS_DE_BUSY_LIMIT) {
+ if (de_busy && !prt_busy && dep->qsize < erts_de_busy_limit) {
ErtsProcList *suspendees;
int resumed;
suspendees = get_suspended_on_de(dep, ERTS_DE_QFLG_BUSY);
--- ./otp_src_R13B04/erts/emulator/beam/erl_init.c.orig 2010-02-20 03:03:48.000000000 +0900
+++ ./otp_src_R13B04/erts/emulator/beam/erl_init.c 2010-11-05 23:47:43.830249097 +0900
@@ -800,6 +800,7 @@
char envbuf[21]; /* enough for any 64-bit integer */
size_t envbufsz;
int async_max_threads = erts_async_max_threads;
+ extern int erts_de_busy_limit;
early_init(&argc, argv);
@@ -820,6 +821,10 @@
async_max_threads = atoi(envbuf);
}
+ envbufsz = sizeof(envbuf);
+ if (erts_sys_getenv("ERTS_DE_BUSY_LIMIT", envbuf, &envbufsz) == 0) {
+ erts_de_busy_limit = atoi(envbuf);
+ }
#ifdef DEBUG
verbose = DEBUG_DEFAULT;