[erlang-patches] [PATCH] erts: reduce smp locking time range in erts_garbage_collect

Henrik Nord henrik@REDACTED
Tue Dec 20 12:14:49 CET 2011


Thank you for the contribution!

patch included in 'pu' for testing

On 12/16/2011 11:13 AM, Jovi Zhang wrote:
> > From f8bb268d962808c6e64545afbbd0d2b0257afdb7 Mon Sep 17 00:00:00 2001
> From: Jovi Zhang<bookjovi@REDACTED>
> Date: Fri, 9 Dec 2011 05:46:45 +0800
> Subject: [PATCH] erts: reduce smp locking time range in erts_garbage_collect
>
> get_now should be use out of process status locking, then
> it can reduce smp locking time range in here.
> ---
> erts/emulator/beam/erl_gc.c |    3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/erts/emulator/beam/erl_gc.c b/erts/emulator/beam/erl_gc.c
> index eb2b945..bcda3bf 100644
> --- a/erts/emulator/beam/erl_gc.c
> +++ b/erts/emulator/beam/erl_gc.c
> @@ -357,10 +357,11 @@ erts_garbage_collect(Process* p, int need,
> Eterm* objv, int nobj)
>      erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS);
>      p->gcstatus = p->status;
>      p->status = P_GARBING;
> +    erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS);
> +
>      if (erts_system_monitor_long_gc != 0) {
>         get_now(&ms1,&s1,&us1);
>      }
> -    erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS);
>
>      ERTS_CHK_OFFHEAP(p);
>
> --
> 1.7.2.3
>
>
> _______________________________________________
> erlang-patches mailing list
> erlang-patches@REDACTED
> http://erlang.org/mailman/listinfo/erlang-patches

-- 
/Henrik Nord Erlang/OTP

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-patches/attachments/20111220/7b14e77e/attachment.htm>


More information about the erlang-patches mailing list