Update of /cvsroot/sbcl/sbcl/src/runtime
In directory sc8-pr-cvs1:/tmp/cvs-serv12078/src/runtime
Modified Files:
Tag: stop_the_world_branch
gencgc.c interrupt.c linux-os.c thread.c
Log Message:
0.8.2.38.stop_the_world.3
Lisp-level changes for new style of GC, which are
approximately a reversion to old-style (or single-threaded) GC
Haven't actually added the gc hooks back in yet, but now
there's at least a place for them to go.
Delete ptrace remnants in gencgc.c: stack scavenging now looks
for esp in the most recent interrupt context for each thread
Fix bug that causes SBCL to die if stopped and resumed from
the tty (^Z/fg). This needs to go into HEAD as well.
Spinlocks work better if released after use.
Note that maybe_gc_pending is broken in this version: alloc()
is still setting it, but interrupt_handle_pending is not
paying attention. alloc() should use maybe_defer... instead
Index: gencgc.c
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/gencgc.c,v
retrieving revision 1.35.2.1
retrieving revision 1.35.2.2
diff -u -d -r1.35.2.1 -r1.35.2.2
--- gencgc.c 18 Aug 2003 11:06:19 -0000 1.35.2.1
+++ gencgc.c 20 Aug 2003 10:59:42 -0000 1.35.2.2
@@ -3661,28 +3661,15 @@
/* Scavenge the stacks' conservative roots. */
for_each_thread(th) {
void **ptr;
+ void **esp= (void **) &raise;
#ifdef LISP_FEATURE_SB_THREAD
- struct user_regs_struct regs;
- if(ptrace(PTRACE_GETREGS,th->pid,0,®s)){
- /* probably doesn't exist any more. */
- fprintf(stderr,"child pid %d, %s\n",th->pid,strerror(errno));
- perror("PTRACE_GETREGS");
+ if(th!=arch_os_get_current_thread()) {
+ os_context_t *last_context=th->interrupt_contexts
+ [fixnum_value(SymbolValue(FREE_INTERRUPT_CONTEXT_INDEX,th))];
+ esp = *os_context_register_addr(last_context,reg_ESP);
}
- preserve_pointer(regs.ebx);
- preserve_pointer(regs.ecx);
- preserve_pointer(regs.edx);
- preserve_pointer(regs.esi);
- preserve_pointer(regs.edi);
- preserve_pointer(regs.ebp);
- preserve_pointer(regs.eax);
#endif
- for (ptr = th->control_stack_end;
-#ifdef LISP_FEATURE_SB_THREAD
- ptr > regs.esp;
-#else
- ptr > (void **)&raise;
-#endif
- ptr--) {
+ for (ptr = th->control_stack_end; ptr > esp; ptr--) {
preserve_pointer(*ptr);
}
}
@@ -4167,7 +4154,7 @@
-extern boolean maybe_gc_pending ;
+boolean maybe_gc_pending ;
/* alloc(..) is the external interface for memory allocation. It
* allocates to generation 0. It is not called from within the garbage
* collector as it is only external uses that need the check for heap
Index: interrupt.c
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/interrupt.c,v
retrieving revision 1.41.2.1
retrieving revision 1.41.2.2
diff -u -d -r1.41.2.1 -r1.41.2.2
--- interrupt.c 18 Aug 2003 11:06:19 -0000 1.41.2.1
+++ interrupt.c 20 Aug 2003 10:59:42 -0000 1.41.2.2
@@ -104,7 +104,6 @@
struct interrupt_data * global_interrupt_data;
-boolean maybe_gc_pending = 0;
/*
* utility routines used by various signal handlers
@@ -280,7 +279,9 @@
4 /* sizeof(sigset_t) */ );
#endif
sigemptyset(&data->pending_mask);
- run_deferred_handler(data,(void *)context); /* XXX */
+ /* This will break on sparc linux: the deferred handler really wants
+ * to be called with a void_context */
+ run_deferred_handler(data,(void *)context);
}
/*
Index: linux-os.c
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/linux-os.c,v
retrieving revision 1.25.2.1
retrieving revision 1.25.2.2
diff -u -d -r1.25.2.1 -r1.25.2.2
--- linux-os.c 18 Aug 2003 11:06:19 -0000 1.25.2.1
+++ linux-os.c 20 Aug 2003 10:59:42 -0000 1.25.2.2
@@ -27,10 +27,10 @@
#include "os.h"
#include "arch.h"
#include "globals.h"
+#include "sbcl.h"
#include "interrupt.h"
#include "interr.h"
#include "lispregs.h"
-#include "sbcl.h"
#include <sys/socket.h>
#include <sys/utsname.h>
@@ -251,8 +251,7 @@
/* we need to have a handler installed for this signal so that
* sigwaitinfo() for it actually returns at the appropriate time
*/
- fprintf(stderr, "Thread %d received stray SIGCONT\n",
- arch_os_get_current_thread()->pid);
+ fprintf(stderr, "Thread %d received stray SIGCONT\n", getpid());
}
void
Index: thread.c
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/thread.c,v
retrieving revision 1.11.2.2
retrieving revision 1.11.2.3
diff -u -d -r1.11.2.2 -r1.11.2.3
--- thread.c 18 Aug 2003 11:06:19 -0000 1.11.2.2
+++ thread.c 20 Aug 2003 10:59:42 -0000 1.11.2.3
@@ -298,7 +298,6 @@
{
/* stop all other threads by sending them SIG_STOP_FOR_GC */
struct thread *p,*th=arch_os_get_current_thread();
- int countdown_to_gc=0;
struct thread *tail=0;
int finished=0;
do {
@@ -330,6 +329,6 @@
if(p==th) continue;
kill(p->pid,SIGCONT);
}
+ release_spinlock(&all_threads_lock);
}
-
#endif
|