wok-next diff erlang/stuff/otp_src_R12B-5_OTP-7738.patch @ rev 11850
Up libcrypto (1.0.0g)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Feb 27 09:12:19 2012 +0100 (2012-02-27) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/erlang/stuff/otp_src_R12B-5_OTP-7738.patch Mon Feb 27 09:12:19 2012 +0100 1.3 @@ -0,0 +1,190 @@ 1.4 +diff -Naur otp_src_R12B-5/erts/emulator/beam/erl_gc.c otp_src_R12B-5_OTP-7738/erts/emulator/beam/erl_gc.c 1.5 +--- otp_src_R12B-5/erts/emulator/beam/erl_gc.c 2008-11-04 11:51:44.000000000 +0100 1.6 ++++ otp_src_R12B-5_OTP-7738/erts/emulator/beam/erl_gc.c 2009-01-14 10:03:47.000000000 +0100 1.7 +@@ -341,7 +341,6 @@ 1.8 + { 1.9 + Uint reclaimed_now = 0; 1.10 + int done = 0; 1.11 +- Uint saved_status = p->status; 1.12 + Uint ms1, s1, us1; 1.13 + 1.14 + if (IS_TRACED_FL(p, F_TRACE_GC)) { 1.15 +@@ -349,6 +348,7 @@ 1.16 + } 1.17 + 1.18 + erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS); 1.19 ++ p->gcstatus = p->status; 1.20 + p->status = P_GARBING; 1.21 + if (erts_system_monitor_long_gc != 0) { 1.22 + get_now(&ms1, &s1, &us1); 1.23 +@@ -384,7 +384,7 @@ 1.24 + ErtsGcQuickSanityCheck(p); 1.25 + 1.26 + erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS); 1.27 +- p->status = saved_status; 1.28 ++ p->status = p->gcstatus; 1.29 + erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS); 1.30 + if (IS_TRACED_FL(p, F_TRACE_GC)) { 1.31 + trace_gc(p, am_gc_end); 1.32 +@@ -449,7 +449,6 @@ 1.33 + void 1.34 + erts_garbage_collect_hibernate(Process* p) 1.35 + { 1.36 +- Uint saved_status = p->status; 1.37 + Uint heap_size; 1.38 + Eterm* heap; 1.39 + Eterm* htop; 1.40 +@@ -466,6 +465,7 @@ 1.41 + * Preliminaries. 1.42 + */ 1.43 + erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS); 1.44 ++ p->gcstatus = p->status; 1.45 + p->status = P_GARBING; 1.46 + erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS); 1.47 + erts_smp_locked_activity_begin(ERTS_ACTIVITY_GC); 1.48 +@@ -580,7 +580,7 @@ 1.49 + ErtsGcQuickSanityCheck(p); 1.50 + 1.51 + erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS); 1.52 +- p->status = saved_status; 1.53 ++ p->status = p->gcstatus; 1.54 + erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS); 1.55 + erts_smp_locked_activity_end(ERTS_ACTIVITY_GC); 1.56 + } 1.57 +@@ -589,7 +589,6 @@ 1.58 + void 1.59 + erts_garbage_collect_literals(Process* p, Eterm* literals, Uint lit_size) 1.60 + { 1.61 +- Uint saved_status = p->status; 1.62 + Uint byte_lit_size = sizeof(Eterm)*lit_size; 1.63 + Uint old_heap_size; 1.64 + Eterm* temp_lit; 1.65 +@@ -605,6 +604,7 @@ 1.66 + * Set GC state. 1.67 + */ 1.68 + erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS); 1.69 ++ p->gcstatus = p->status; 1.70 + p->status = P_GARBING; 1.71 + erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS); 1.72 + erts_smp_locked_activity_begin(ERTS_ACTIVITY_GC); 1.73 +@@ -708,7 +708,7 @@ 1.74 + * Restore status. 1.75 + */ 1.76 + erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS); 1.77 +- p->status = saved_status; 1.78 ++ p->status = p->gcstatus; 1.79 + erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS); 1.80 + erts_smp_locked_activity_end(ERTS_ACTIVITY_GC); 1.81 + } 1.82 +diff -Naur otp_src_R12B-5/erts/emulator/beam/erl_message.c otp_src_R12B-5_OTP-7738/erts/emulator/beam/erl_message.c 1.83 +--- otp_src_R12B-5/erts/emulator/beam/erl_message.c 2008-09-01 14:51:20.000000000 +0200 1.84 ++++ otp_src_R12B-5_OTP-7738/erts/emulator/beam/erl_message.c 2009-01-14 10:03:47.000000000 +0100 1.85 +@@ -295,10 +295,27 @@ 1.86 + 1.87 + ACTIVATE(receiver); 1.88 + 1.89 +- if (receiver->status == P_WAITING) { 1.90 +- add_to_schedule_q(receiver); 1.91 +- } else if (receiver->status == P_SUSPENDED) { 1.92 ++ switch (receiver->status) { 1.93 ++ case P_GARBING: 1.94 ++ switch (receiver->gcstatus) { 1.95 ++ case P_SUSPENDED: 1.96 ++ goto suspended; 1.97 ++ case P_WAITING: 1.98 ++ goto waiting; 1.99 ++ default: 1.100 ++ break; 1.101 ++ } 1.102 ++ break; 1.103 ++ case P_SUSPENDED: 1.104 ++ suspended: 1.105 + receiver->rstatus = P_RUNABLE; 1.106 ++ break; 1.107 ++ case P_WAITING: 1.108 ++ waiting: 1.109 ++ add_to_schedule_q(receiver); 1.110 ++ break; 1.111 ++ default: 1.112 ++ break; 1.113 + } 1.114 + 1.115 + if (IS_TRACED_FL(receiver, F_TRACE_RECEIVE)) { 1.116 +diff -Naur otp_src_R12B-5/erts/emulator/beam/erl_process.c otp_src_R12B-5_OTP-7738/erts/emulator/beam/erl_process.c 1.117 +--- otp_src_R12B-5/erts/emulator/beam/erl_process.c 2008-11-04 11:51:10.000000000 +0100 1.118 ++++ otp_src_R12B-5_OTP-7738/erts/emulator/beam/erl_process.c 2009-01-14 10:03:47.000000000 +0100 1.119 +@@ -473,21 +473,33 @@ 1.120 + static ERTS_INLINE void 1.121 + resume_process(Process *p) 1.122 + { 1.123 ++ Uint32 *statusp; 1.124 + ERTS_SMP_LC_ASSERT(ERTS_PROC_LOCK_STATUS & erts_proc_lc_my_proc_locks(p)); 1.125 +- /* We may get called from trace([suspend], false) */ 1.126 +- if (p->status != P_SUSPENDED) 1.127 ++ switch (p->status) { 1.128 ++ case P_SUSPENDED: 1.129 ++ statusp = &p->status; 1.130 ++ break; 1.131 ++ case P_GARBING: 1.132 ++ if (p->gcstatus == P_SUSPENDED) { 1.133 ++ statusp = &p->gcstatus; 1.134 ++ break; 1.135 ++ } 1.136 ++ /* Fall through */ 1.137 ++ default: 1.138 + return; 1.139 ++ } 1.140 ++ 1.141 + ASSERT(p->rcount > 0); 1.142 + 1.143 + if (--p->rcount > 0) /* multiple suspend i.e trace and busy port */ 1.144 + return; 1.145 + switch(p->rstatus) { 1.146 + case P_RUNABLE: 1.147 +- p->status = P_WAITING; /* make add_to_schedule_q work */ 1.148 ++ *statusp = P_WAITING; /* make add_to_schedule_q work */ 1.149 + add_to_schedule_q(p); 1.150 + break; 1.151 + case P_WAITING: 1.152 +- p->status = P_WAITING; 1.153 ++ *statusp = P_WAITING; 1.154 + break; 1.155 + default: 1.156 + erl_exit(1, "bad state in resume_process()\n"); 1.157 +@@ -1548,8 +1560,16 @@ 1.158 + else 1.159 + sq->last->next = p; 1.160 + sq->last = p; 1.161 +- if (p->status != P_EXITING) { 1.162 ++ 1.163 ++ switch (p->status) { 1.164 ++ case P_EXITING: 1.165 ++ break; 1.166 ++ case P_GARBING: 1.167 ++ p->gcstatus = P_RUNABLE; 1.168 ++ break; 1.169 ++ default: 1.170 + p->status = P_RUNABLE; 1.171 ++ break; 1.172 + } 1.173 + 1.174 + runq_len++; 1.175 +@@ -2925,6 +2945,7 @@ 1.176 + p->max_gen_gcs = 0; 1.177 + p->min_heap_size = 0; 1.178 + p->status = P_RUNABLE; 1.179 ++ p->gcstatus = P_RUNABLE; 1.180 + p->rstatus = P_RUNABLE; 1.181 + p->rcount = 0; 1.182 + p->id = ERTS_INVALID_PID; 1.183 +diff -Naur otp_src_R12B-5/erts/emulator/beam/erl_process.h otp_src_R12B-5_OTP-7738/erts/emulator/beam/erl_process.h 1.184 +--- otp_src_R12B-5/erts/emulator/beam/erl_process.h 2008-11-04 11:51:11.000000000 +0100 1.185 ++++ otp_src_R12B-5_OTP-7738/erts/emulator/beam/erl_process.h 2009-01-14 10:03:47.000000000 +0100 1.186 +@@ -207,6 +207,7 @@ 1.187 + * Only valid for the current process. 1.188 + */ 1.189 + Uint32 status; /* process STATE */ 1.190 ++ Uint32 gcstatus; /* process gc STATE */ 1.191 + Uint32 rstatus; /* process resume STATE */ 1.192 + Uint32 rcount; /* suspend count */ 1.193 + Eterm id; /* The pid of this process */