Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang
erlang
3341-kernel-Reduce-memory-usage-for-volatile-se...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 3341-kernel-Reduce-memory-usage-for-volatile-send-in-glob.patch of Package erlang
From ef8925c9e5136e8a3f6f6067e0b280c96cbae906 Mon Sep 17 00:00:00 2001 From: Rickard Green <rickard@erlang.org> Date: Thu, 16 Mar 2023 12:55:25 +0100 Subject: [PATCH] [kernel] Reduce memory usage for volatile send in global --- lib/kernel/src/global.erl | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/lib/kernel/src/global.erl b/lib/kernel/src/global.erl index 4854ed2900..dce0c71b28 100644 --- a/lib/kernel/src/global.erl +++ b/lib/kernel/src/global.erl @@ -2760,19 +2760,12 @@ inform_connection_loss(_Node, #state{}) -> %% Volatile send (does not bring up connections and does not %% preserve signal order) of Msg to global name server at Node... %% + gns_volatile_send(Node, Msg) -> - To = {global_name_server, Node}, - case erlang:send(To, Msg, [nosuspend, noconnect]) of - ok -> - ok; - noconnect -> - ok; - nosuspend -> - _ = spawn(fun () -> - _ = erlang:send(To, Msg, [noconnect]) - end), - ok - end. + OldAsyncDist = process_flag(async_dist, true), + _ = erlang:send({global_name_server, Node}, Msg, [noconnect]), + _ = process_flag(async_dist, OldAsyncDist), + ok. %% %% Volatile multicast of Msg to all global name servers on known nodes @@ -2781,17 +2774,22 @@ gns_volatile_send(Node, Msg) -> %% gns_volatile_multicast(Msg, IgnoreNode, MinVer, AlsoPend, #state{known = Known}) -> + OldAsyncDist = process_flag(async_dist, true), maps:foreach(fun (Node, Ver) when is_atom(Node), Node =/= IgnoreNode, Ver >= MinVer -> - gns_volatile_send(Node, Msg); + _ = erlang:send({global_name_server, Node}, Msg, + [noconnect]); ({pending, Node}, Ver) when AlsoPend == true, Node =/= IgnoreNode, Ver >= MinVer -> - gns_volatile_send(Node, Msg); + _ = erlang:send({global_name_server, Node}, Msg, + [noconnect]); (_, _) -> ok - end, Known). + end, Known), + _ = process_flag(async_dist, OldAsyncDist), + ok. is_node_potentially_known(Node, #state{known = Known}) -> maps:is_key(Node, Known) orelse maps:is_key({pending, Node}, Known). -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor