wok-stable rev 9289
erlang: I added the patch need for erlang in stuff folder. This will help make local builds with local tank easier.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Wed Mar 16 19:02:27 2011 +0000 (2011-03-16) |
parents | 3c70f38c14f2 |
children | dda28a460f9a |
files | erlang/receipt erlang/stuff/otp_src_R12B-5_OTP-7738.patch |
line diff
1.1 --- a/erlang/receipt Wed Mar 16 21:28:31 2011 +0100 1.2 +++ b/erlang/receipt Wed Mar 16 19:02:27 2011 +0000 1.3 @@ -17,13 +17,8 @@ 1.4 { 1.5 patch=${SOURCE}_${VERSION}_OTP-7738.patch 1.6 cd $src 1.7 - [ -f $SOURCES_REPOSITORY/$patch ] && cp $SOURCES_REPOSITORY/$patch . 1.8 - if [ ! -f $patch ]; then 1.9 - wget http://mirror.slitaz.org/sources/packages/${patch:0:1}/$patch 1.10 - cp $patch $SOURCES_REPOSITORY 1.11 - fi 1.12 if [ ! -f done.$patch ]; then 1.13 - patch -p1 < $patch || return 1 1.14 + patch -p1 < $stuff/$patch || return 1 1.15 touch done.$patch 1.16 fi 1.17 export LANG=C
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/erlang/stuff/otp_src_R12B-5_OTP-7738.patch Wed Mar 16 19:02:27 2011 +0000 2.3 @@ -0,0 +1,190 @@ 2.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 2.5 +--- otp_src_R12B-5/erts/emulator/beam/erl_gc.c 2008-11-04 11:51:44.000000000 +0100 2.6 ++++ otp_src_R12B-5_OTP-7738/erts/emulator/beam/erl_gc.c 2009-01-14 10:03:47.000000000 +0100 2.7 +@@ -341,7 +341,6 @@ 2.8 + { 2.9 + Uint reclaimed_now = 0; 2.10 + int done = 0; 2.11 +- Uint saved_status = p->status; 2.12 + Uint ms1, s1, us1; 2.13 + 2.14 + if (IS_TRACED_FL(p, F_TRACE_GC)) { 2.15 +@@ -349,6 +348,7 @@ 2.16 + } 2.17 + 2.18 + erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS); 2.19 ++ p->gcstatus = p->status; 2.20 + p->status = P_GARBING; 2.21 + if (erts_system_monitor_long_gc != 0) { 2.22 + get_now(&ms1, &s1, &us1); 2.23 +@@ -384,7 +384,7 @@ 2.24 + ErtsGcQuickSanityCheck(p); 2.25 + 2.26 + erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS); 2.27 +- p->status = saved_status; 2.28 ++ p->status = p->gcstatus; 2.29 + erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS); 2.30 + if (IS_TRACED_FL(p, F_TRACE_GC)) { 2.31 + trace_gc(p, am_gc_end); 2.32 +@@ -449,7 +449,6 @@ 2.33 + void 2.34 + erts_garbage_collect_hibernate(Process* p) 2.35 + { 2.36 +- Uint saved_status = p->status; 2.37 + Uint heap_size; 2.38 + Eterm* heap; 2.39 + Eterm* htop; 2.40 +@@ -466,6 +465,7 @@ 2.41 + * Preliminaries. 2.42 + */ 2.43 + erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS); 2.44 ++ p->gcstatus = p->status; 2.45 + p->status = P_GARBING; 2.46 + erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS); 2.47 + erts_smp_locked_activity_begin(ERTS_ACTIVITY_GC); 2.48 +@@ -580,7 +580,7 @@ 2.49 + ErtsGcQuickSanityCheck(p); 2.50 + 2.51 + erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS); 2.52 +- p->status = saved_status; 2.53 ++ p->status = p->gcstatus; 2.54 + erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS); 2.55 + erts_smp_locked_activity_end(ERTS_ACTIVITY_GC); 2.56 + } 2.57 +@@ -589,7 +589,6 @@ 2.58 + void 2.59 + erts_garbage_collect_literals(Process* p, Eterm* literals, Uint lit_size) 2.60 + { 2.61 +- Uint saved_status = p->status; 2.62 + Uint byte_lit_size = sizeof(Eterm)*lit_size; 2.63 + Uint old_heap_size; 2.64 + Eterm* temp_lit; 2.65 +@@ -605,6 +604,7 @@ 2.66 + * Set GC state. 2.67 + */ 2.68 + erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS); 2.69 ++ p->gcstatus = p->status; 2.70 + p->status = P_GARBING; 2.71 + erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS); 2.72 + erts_smp_locked_activity_begin(ERTS_ACTIVITY_GC); 2.73 +@@ -708,7 +708,7 @@ 2.74 + * Restore status. 2.75 + */ 2.76 + erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS); 2.77 +- p->status = saved_status; 2.78 ++ p->status = p->gcstatus; 2.79 + erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS); 2.80 + erts_smp_locked_activity_end(ERTS_ACTIVITY_GC); 2.81 + } 2.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 2.83 +--- otp_src_R12B-5/erts/emulator/beam/erl_message.c 2008-09-01 14:51:20.000000000 +0200 2.84 ++++ otp_src_R12B-5_OTP-7738/erts/emulator/beam/erl_message.c 2009-01-14 10:03:47.000000000 +0100 2.85 +@@ -295,10 +295,27 @@ 2.86 + 2.87 + ACTIVATE(receiver); 2.88 + 2.89 +- if (receiver->status == P_WAITING) { 2.90 +- add_to_schedule_q(receiver); 2.91 +- } else if (receiver->status == P_SUSPENDED) { 2.92 ++ switch (receiver->status) { 2.93 ++ case P_GARBING: 2.94 ++ switch (receiver->gcstatus) { 2.95 ++ case P_SUSPENDED: 2.96 ++ goto suspended; 2.97 ++ case P_WAITING: 2.98 ++ goto waiting; 2.99 ++ default: 2.100 ++ break; 2.101 ++ } 2.102 ++ break; 2.103 ++ case P_SUSPENDED: 2.104 ++ suspended: 2.105 + receiver->rstatus = P_RUNABLE; 2.106 ++ break; 2.107 ++ case P_WAITING: 2.108 ++ waiting: 2.109 ++ add_to_schedule_q(receiver); 2.110 ++ break; 2.111 ++ default: 2.112 ++ break; 2.113 + } 2.114 + 2.115 + if (IS_TRACED_FL(receiver, F_TRACE_RECEIVE)) { 2.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 2.117 +--- otp_src_R12B-5/erts/emulator/beam/erl_process.c 2008-11-04 11:51:10.000000000 +0100 2.118 ++++ otp_src_R12B-5_OTP-7738/erts/emulator/beam/erl_process.c 2009-01-14 10:03:47.000000000 +0100 2.119 +@@ -473,21 +473,33 @@ 2.120 + static ERTS_INLINE void 2.121 + resume_process(Process *p) 2.122 + { 2.123 ++ Uint32 *statusp; 2.124 + ERTS_SMP_LC_ASSERT(ERTS_PROC_LOCK_STATUS & erts_proc_lc_my_proc_locks(p)); 2.125 +- /* We may get called from trace([suspend], false) */ 2.126 +- if (p->status != P_SUSPENDED) 2.127 ++ switch (p->status) { 2.128 ++ case P_SUSPENDED: 2.129 ++ statusp = &p->status; 2.130 ++ break; 2.131 ++ case P_GARBING: 2.132 ++ if (p->gcstatus == P_SUSPENDED) { 2.133 ++ statusp = &p->gcstatus; 2.134 ++ break; 2.135 ++ } 2.136 ++ /* Fall through */ 2.137 ++ default: 2.138 + return; 2.139 ++ } 2.140 ++ 2.141 + ASSERT(p->rcount > 0); 2.142 + 2.143 + if (--p->rcount > 0) /* multiple suspend i.e trace and busy port */ 2.144 + return; 2.145 + switch(p->rstatus) { 2.146 + case P_RUNABLE: 2.147 +- p->status = P_WAITING; /* make add_to_schedule_q work */ 2.148 ++ *statusp = P_WAITING; /* make add_to_schedule_q work */ 2.149 + add_to_schedule_q(p); 2.150 + break; 2.151 + case P_WAITING: 2.152 +- p->status = P_WAITING; 2.153 ++ *statusp = P_WAITING; 2.154 + break; 2.155 + default: 2.156 + erl_exit(1, "bad state in resume_process()\n"); 2.157 +@@ -1548,8 +1560,16 @@ 2.158 + else 2.159 + sq->last->next = p; 2.160 + sq->last = p; 2.161 +- if (p->status != P_EXITING) { 2.162 ++ 2.163 ++ switch (p->status) { 2.164 ++ case P_EXITING: 2.165 ++ break; 2.166 ++ case P_GARBING: 2.167 ++ p->gcstatus = P_RUNABLE; 2.168 ++ break; 2.169 ++ default: 2.170 + p->status = P_RUNABLE; 2.171 ++ break; 2.172 + } 2.173 + 2.174 + runq_len++; 2.175 +@@ -2925,6 +2945,7 @@ 2.176 + p->max_gen_gcs = 0; 2.177 + p->min_heap_size = 0; 2.178 + p->status = P_RUNABLE; 2.179 ++ p->gcstatus = P_RUNABLE; 2.180 + p->rstatus = P_RUNABLE; 2.181 + p->rcount = 0; 2.182 + p->id = ERTS_INVALID_PID; 2.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 2.184 +--- otp_src_R12B-5/erts/emulator/beam/erl_process.h 2008-11-04 11:51:11.000000000 +0100 2.185 ++++ otp_src_R12B-5_OTP-7738/erts/emulator/beam/erl_process.h 2009-01-14 10:03:47.000000000 +0100 2.186 +@@ -207,6 +207,7 @@ 2.187 + * Only valid for the current process. 2.188 + */ 2.189 + Uint32 status; /* process STATE */ 2.190 ++ Uint32 gcstatus; /* process gc STATE */ 2.191 + Uint32 rstatus; /* process resume STATE */ 2.192 + Uint32 rcount; /* suspend count */ 2.193 + Eterm id; /* The pid of this process */