From e45db930e7fb9980dfd774c64401cf0dda965c58 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 24 Apr 2019 16:02:55 +0200 Subject: erts: Fix another bug in process_info(reductions) to disregard consumed virtual reductions which are not aggregated into p->reds and if included may cause reduction count go backwards. --- erts/emulator/beam/beam_emu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index ce986fdd7a..370f39431a 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -3247,7 +3247,7 @@ erts_current_reductions(Process *c_p, Process *p) } else { reds_left = c_p->fcalls; } - return REDS_IN(c_p) - reds_left; + return REDS_IN(c_p) - reds_left - erts_proc_sched_data(p)->virtual_reds; } int -- cgit v1.2.3 From 70dbf671a8196110d2aee2e7507afc2c2c75183f Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Thu, 18 Apr 2019 16:43:36 +0200 Subject: erts: Force process_info(reductions) as signal Not 100% sure this is needed to get correct reductions as the direct query is not done if process is RUNNING anyway. --- erts/emulator/beam/erl_bif_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c index 7fada0d548..7e9c04d158 100644 --- a/erts/emulator/beam/erl_bif_info.c +++ b/erts/emulator/beam/erl_bif_info.c @@ -761,7 +761,7 @@ static ErtsProcessInfoArgs pi_args[] = { {am_memory, 0, ERTS_PI_FLAG_NEED_MSGQ_LEN|ERTS_PI_FLAG_FORCE_SIG_SEND, ERTS_PROC_LOCK_MAIN}, {am_garbage_collection, 3+2 + 3+2 + 3+2 + 3+2 + 3+2 + ERTS_MAX_HEAP_SIZE_MAP_SZ, 0, ERTS_PROC_LOCK_MAIN}, {am_group_leader, 0, 0, ERTS_PROC_LOCK_MAIN}, - {am_reductions, 0, 0, ERTS_PROC_LOCK_MAIN}, + {am_reductions, 0, ERTS_PI_FLAG_FORCE_SIG_SEND, ERTS_PROC_LOCK_MAIN}, {am_priority, 0, 0, 0}, {am_trace, 0, 0, ERTS_PROC_LOCK_MAIN}, {am_binary, 0, ERTS_PI_FLAG_FORCE_SIG_SEND, ERTS_PROC_LOCK_MAIN}, -- cgit v1.2.3