aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/dist.h
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2018-09-19 16:37:55 +0200
committerLukas Larsson <[email protected]>2019-02-21 16:38:04 +0100
commit9a7df41a9e5361049a17c8aa971b52599fba2632 (patch)
tree9084706715fd064a1011753e2e72fe49e05875ba /erts/emulator/beam/dist.h
parent0184c2e0438ac42c44d14e92b13e2807e0a670b3 (diff)
downloadotp-9a7df41a9e5361049a17c8aa971b52599fba2632.tar.gz
otp-9a7df41a9e5361049a17c8aa971b52599fba2632.tar.bz2
otp-9a7df41a9e5361049a17c8aa971b52599fba2632.zip
erts: Move reason in dist messages to payload
The dist messages EXIT, EXIT2 and MONITOR_DOWN have been updated with new versions that send the reason term as part of the payload of the message instead of as part of the control message. This allows the decode of the reason to be done by the receiving process instead of the dist entry which in turn makes it possible for multiple decodes to be done in parallel. This change is done in order to make it easier to fragment the potentially large payload of EXIT, EXIT2 and MONITOR_DOWN into multiple distribution messages. OTP-15611
Diffstat (limited to 'erts/emulator/beam/dist.h')
-rw-r--r--erts/emulator/beam/dist.h52
1 files changed, 32 insertions, 20 deletions
diff --git a/erts/emulator/beam/dist.h b/erts/emulator/beam/dist.h
index a8ccd1eaec..81a09bc69c 100644
--- a/erts/emulator/beam/dist.h
+++ b/erts/emulator/beam/dist.h
@@ -47,6 +47,7 @@
#define DFLAG_SEND_SENDER 0x80000
#define DFLAG_BIG_SEQTRACE_LABELS 0x100000
#define DFLAG_NO_MAGIC 0x200000 /* internal for pending connection */
+#define DFLAG_EXIT_PAYLOAD 0x400000
/* Mandatory flags for distribution */
#define DFLAG_DIST_MANDATORY (DFLAG_EXTENDED_REFERENCES \
@@ -75,7 +76,8 @@
| DFLAG_MAP_TAG \
| DFLAG_BIG_CREATION \
| DFLAG_SEND_SENDER \
- | DFLAG_BIG_SEQTRACE_LABELS)
+ | DFLAG_BIG_SEQTRACE_LABELS \
+ | DFLAG_EXIT_PAYLOAD)
/* Flags addable by local distr implementations */
#define DFLAG_DIST_ADDABLE DFLAG_DIST_DEFAULT
@@ -99,26 +101,35 @@
| DFLAG_BIG_CREATION)
/* opcodes used in distribution messages */
-#define DOP_LINK 1
-#define DOP_SEND 2
-#define DOP_EXIT 3
-#define DOP_UNLINK 4
+enum {
+ DOP_LINK = 1,
+ DOP_SEND = 2,
+ DOP_EXIT = 3,
+ DOP_UNLINK = 4,
/* Ancient DOP_NODE_LINK (5) was here, can be reused */
-#define DOP_REG_SEND 6
-#define DOP_GROUP_LEADER 7
-#define DOP_EXIT2 8
-
-#define DOP_SEND_TT 12
-#define DOP_EXIT_TT 13
-#define DOP_REG_SEND_TT 16
-#define DOP_EXIT2_TT 18
-
-#define DOP_MONITOR_P 19
-#define DOP_DEMONITOR_P 20
-#define DOP_MONITOR_P_EXIT 21
-
-#define DOP_SEND_SENDER 22
-#define DOP_SEND_SENDER_TT 23
+ DOP_REG_SEND = 6,
+ DOP_GROUP_LEADER = 7,
+ DOP_EXIT2 = 8,
+
+ DOP_SEND_TT = 12,
+ DOP_EXIT_TT = 13,
+ DOP_REG_SEND_TT = 16,
+ DOP_EXIT2_TT = 18,
+
+ DOP_MONITOR_P = 19,
+ DOP_DEMONITOR_P = 20,
+ DOP_MONITOR_P_EXIT = 21,
+
+ DOP_SEND_SENDER = 22,
+ DOP_SEND_SENDER_TT = 23,
+
+ /* These are used when DFLAG_EXIT_PAYLOAD is detected */
+ DOP_PAYLOAD_EXIT = 24,
+ DOP_PAYLOAD_EXIT_TT = 25,
+ DOP_PAYLOAD_EXIT2 = 26,
+ DOP_PAYLOAD_EXIT2_TT = 27,
+ DOP_PAYLOAD_MONITOR_P_EXIT = 28
+};
/* distribution trap functions */
extern Export* dmonitor_node_trap;
@@ -346,6 +357,7 @@ struct erts_dsig_send_context {
Eterm ctl;
Eterm msg;
int force_busy;
+ int force_encode;
Uint32 max_finalize_prepend;
Uint data_size, dhdr_ext_size;
ErtsAtomCacheMap *acmp;