Punt gc_space_needed when SMPing. The local heap is empty after GC.
authorMatt Birkholz <puck@birchwood-abbey.net>
Sat, 25 Jul 2015 21:46:13 +0000 (14:46 -0700)
committerMatt Birkholz <puck@birchwood-abbey.net>
Thu, 26 Nov 2015 08:09:45 +0000 (01:09 -0700)
src/microcode/extern.h
src/microcode/interp.c
src/microcode/memmag.c
src/microcode/memmag.h
src/microcode/purify.c
src/microcode/storage.c
src/microcode/term.c

index b3f5eca2e56573371d54e5e607ff568b2de2ccc2..7ea08cdd14079b3f2ed633ac53890c3596de86b0 100644 (file)
@@ -197,7 +197,9 @@ extern SCHEME_OBJECT * memory_block_end;
 extern unsigned long heap_reserved;
 
 /* Amount of space needed when GC requested */
+#ifndef ENABLE_SMP
 extern unsigned long gc_space_needed;
+#endif
 
 /* Number of new ephemerons requested from the GC.  */
 extern unsigned long n_ephemerons_requested;
@@ -363,7 +365,9 @@ extern void termination_init_error (void) NORETURN;
 extern void termination_end_of_computation (void) NORETURN;
 extern void termination_trap (void) NORETURN;
 extern void termination_no_error_handler (void) NORETURN;
+#ifndef ENABLE_SMP
 extern void termination_gc_out_of_space (void) NORETURN;
+#endif
 extern void termination_eof (void) NORETURN;
 extern void termination_signal (const char * signal_name) NORETURN;
 
index ceed11d135299c0cb7a51eb6af8daefc3e1c5e36..420bb0d12000ca56d762c293c9b06d6906feaa19 100644 (file)
@@ -1076,10 +1076,12 @@ Interpret (int pop_return_p)
 
     case RC_NORMAL_GC_DONE:
       SET_VAL (GET_EXP);
+#ifndef ENABLE_SMP
       /* Paranoia */
       if (GC_NEEDED_P (gc_space_needed))
        termination_gc_out_of_space ();
       gc_space_needed = 0;
+#endif
       EXIT_CRITICAL_SECTION ({ SAVE_CONT (); });
       break;
 
index 7a7a56bb052b344cabdcececa3946809d542b679..963565e2b03b212697abef6c436480f7e1dd8714 100644 (file)
@@ -486,9 +486,13 @@ the primitive GC daemons before returning.")
 
   Will_Push (CONTINUATION_SIZE);
   SET_RC (RC_NORMAL_GC_DONE);
+#ifndef ENABLE_SMP
   SET_EXP (ULONG_TO_FIXNUM ((HEAP_AVAILABLE > gc_space_needed)
                            ? (HEAP_AVAILABLE - gc_space_needed)
                            : 0));
+#else
+  SET_EXP (ULONG_TO_FIXNUM (HEAP_AVAILABLE));
+#endif
   SAVE_CONT ();
   Pushed ();
 
@@ -597,8 +601,10 @@ std_gc_pt2 (void)
         (ephemeron_count + n_ephemerons_requested));
     if (EPHEMERON_GC_NEEDED (length, n_ephemerons_requested))
       {
+#ifndef ENABLE_SMP
        if (ephemeron_request_hard_p)
          gc_space_needed += (VECTOR_DATA + length);
+#endif
        length = (compute_ephemeron_array_length (ephemeron_count));
 #ifdef ENABLE_GC_DEBUGGING_TOOLS
        /* This should never trigger, because we discard the previous
index ebe2866b4afd6d5be03ba15908f63dfa8c0fc99c..c4c6653cfeb4ff9e7116b0195f2d8d78c816d0e6 100644 (file)
@@ -61,11 +61,18 @@ USA.
    ? ((unsigned long) (heap_end - Free))                               \
    : 0)
 
+#ifndef ENABLE_SMP
 #define REQUEST_GC(n_words) do                                         \
 {                                                                      \
   REQUEST_INTERRUPT (INT_GC);                                          \
   gc_space_needed = (n_words);                                         \
 } while (0)
+#else
+#define REQUEST_GC(n_words) do                                         \
+{                                                                      \
+  REQUEST_INTERRUPT (INT_GC);                                          \
+} while (0)
+#endif
 
 #define RESET_HEAP_ALLOC_LIMIT() do                                    \
 {                                                                      \
index 3aba0e697433494a912cd84b33d4cadcf535cfa9..e1c88867e706255cb42776cf8f314deb857b91d2 100644 (file)
@@ -75,11 +75,15 @@ PURE? is ignored.")
 
  Will_Push (CONTINUATION_SIZE);
   SET_RC (RC_NORMAL_GC_DONE);
+#ifndef ENABLE_SMP
   SET_EXP
     (cons (SHARP_T,
           (ULONG_TO_FIXNUM ((HEAP_AVAILABLE > gc_space_needed)
                             ? (HEAP_AVAILABLE - gc_space_needed)
                             : 0))));
+#else
+  SET_EXP (cons (SHARP_T, (ULONG_TO_FIXNUM (HEAP_AVAILABLE))));
+#endif
   SAVE_CONT ();
  Pushed ();
 
index ab97ddd77c5a110f9a3075df8e40d171095e86b6..dec79782c1cd096f818a2393effc4b0f1836e469 100644 (file)
@@ -94,8 +94,10 @@ SCHEME_OBJECT * memory_block_end;
 
 unsigned long heap_reserved;
 
+#ifndef ENABLE_SMP
 /* Amount of space needed when GC requested */
 unsigned long gc_space_needed;
+#endif
 
 /* Number of new ephemerons requested from the GC.  */
 unsigned long n_ephemerons_requested;
index 5af7fc6c08e780d79b32f85f2e8fa75a38d890be..53a1be12096a9d19ce5fdffddcf4d508bf2acf50 100644 (file)
@@ -232,6 +232,7 @@ termination_no_error_handler (void)
   termination_suffix (TERM_NO_ERROR_HANDLER, 1, true);
 }
 
+#ifndef ENABLE_SMP
 void
 termination_gc_out_of_space (void)
 {
@@ -246,6 +247,7 @@ termination_gc_out_of_space (void)
              gc_space_needed, HEAP_AVAILABLE);
   termination_suffix_trace (TERM_GC_OUT_OF_SPACE);
 }
+#endif
 
 void
 termination_eof (void)