sbcl Log


Commit Date  
[4e815e] (8.1 kB) by Douglas Katzman Douglas Katzman

Assign thread-local storage indices at load-time on x86-64

This also includes a disassembler enhancement.

2014-04-03 05:31:54 View
Download
[e2327c] (7.9 kB) by Stas Boukarev Stas Boukarev

Remove unnecessary package qualifiers.

2014-03-21 04:09:39 View
Download
[ff2ddc] (7.9 kB) by Stas Boukarev Stas Boukarev

Better error when calling an undefined alien function on x86-64.

(sb-alien:alien-funcall
(sb-alien:extern-alien "nnnn" (function sb-alien:void)))
now says "The alien function "nnnn" is undefined." instead of
"Attempt to call an undefined alien function."

This is achieved by storing the address of the linkage table entry in
RBX before the call. Should be trivial to port to other platforms.

2013-10-01 17:03:00 View
Download
[37d382] (7.8 kB) by David Lichteblau David Lichteblau

Support building without PSEUDO-ATOMIC on POSIX safepoints

- Mark Lisp signal handlers with a flag `synchronous' to indicate
whether we can (and must) handle them immediately. Conversely,
we understand this flag to imply a guarantee that the signal
does not occur during allocation.

- Any signal with a Lisp handler that is not synchronous is
implemented in the runtime using a trampoline, which (instead of
invoking Lisp code directly) first spawns a new pthread, which
only then calls back into Lisp to invoke the handler function
(with a fake signal context).

- Used in particular for SIGINT.

- For SIGPROF, introduce a second per-thread allocation region,
which gets swapped with the usual region around the call into
SIGPROF-HANDLER. This handler is a special case, because it is
careful not to trigger GC nor non-local unwinds, and we can
safely return to the original region afterwards.

- Add a new subclass SIGNAL-HANDLER-THREAD for this purpose,
making it easy to identify these threads (e.g. in the test
driver).

- Run sprof tests while building the contrib. Add a test stressing
time profiling of allocation sequences.

Enable using :SB-SAFEPOINT-STRICTLY on features.

Quite usable already on x86 and x86-64; PPC still has more prominent
issues, e.g. in threads.impure.lisp.

2012-12-21 19:30:48 View
Download
[daa6f0] (7.8 kB) by David Lichteblau David Lichteblau

Foreign callbacks

Allow alien callbacks to be invoked in pthreads created outside of
the Lisp runtime:

Add new runtime functions attach_os_thread, detach_os_thread
allowing such threads to acquire a `struct thread' temporarily,
turning them into Lisp threads.

In a main deviation from the Windows branch (which has a similar
feature), this mechanism does not involve user-land thread (fiber)
mechanisms to switch between stacks. Instead, Lisp code merely runs
on the existing pthread's stack.

Currently a safepoint-only feature, because only safepoint-based
builds already go through a convenient trampoline function for
callbacks, but a backport of this feature to non-safepoint builds
might be straightforward.

2012-12-21 19:28:09 View
Download
[8ede17] (7.7 kB) by David Lichteblau David Lichteblau

Safepoint protocol upgrade

Upgrade to the new stop-the-world protocol from the Windows branch,
dating back to late 2011, an all-in-one readability and correctness
improvement.

Replace per-thread qrl locks with one process-wide lock for all
operations relating to GC state and the threads' CSP area. Use
condition variables for notifications on GC state changes.

Thanks to Anton Kovalenko.

2012-11-02 20:52:04 View
Download
[f05756] (7.7 kB) by David Lichteblau David Lichteblau

Extend use of the linkage table to static symbols

- Formerly static symbols are static no more:

- Always use the linkage table, even in cross compilation. The
runtime retrieves the resulting list of foreign symbols and installs
linkage table entries before calling into Lisp for the first time.

- Simplify/remove various win32 foreign symbol special cases.

- Almost remove scratch().

Conditional on feature SB-DYNAMIC-CORE; required on Windows and optional
on other platforms supporting the linkage table.

With this feature, changes to src/runtime can be built using make,
without requiring a slam.sh step to update core files.

For LINKAGE-TABLE platforms only. Currently supported on x86 and
x86-64. (PowerPC does not yet work.) In the interest of simplicity,
disable this feature permanently on non-SB-THREAD platforms, because
these would require unpleasant changes to allocation macros.

Thanks to Anton Kovalenko.

2012-11-02 19:43:05 View
Download
[3ea89b] (7.6 kB) by David Lichteblau David Lichteblau

Move the global safepoint to one page before static space

New attempt at finding an optimal location for the global safepoint
page. Hopefully this solution will cover all our use cases for
the foreseeable future.

- Relative to static space for architectures with small immediates.

- Also addresses the requirements of sb-dynamic-core, which needs
the safepoint to have an absolute address on x86(-64).

Hence, a new macro !gencgc-space-setup -- tweaks space parameters to
squeeze in the safepoint page, while also simplifying parms.lisp for
some platforms.

2012-11-02 12:23:19 View
Download
[dd54f9] (4.1 kB) by David Lichteblau David Lichteblau

Use safepoints for INTERRUPT-THREAD

* In INTERRUPT-THREAD, stop threads using safepoints instead of
signals.

* Currently not used by default. Users need to set feature
SB-THRUPTION to enable this code. SB-THRUPTION should only be set
when SB-SAFEPOINT is also enabled.

* This feature should ultimately be rolled into SB-SAFEPOINT, but
remains as a separate build option until both versions are equally
well-tested, and until other avoidable uses of signals have also
been replaced by safepoints.

* On the term "thruption": Earlier work on this feature sometimes
used "interrupt" to refer to INTERRUPT-THREAD, causing confusion
with the traditional meaning of "interrupt" as POSIX signal or WIN32
exception. To avoid such confusion, the runtime now refers to
INTERRUPT-THREAD as a "thruption", short for th(read) (inter)ruption.

* SIGPIPE is not used for threads running Lisp code, but a low-level
handler for SIGPIPE still exists which arranges for threads running
FFI code (in particular, threads blocked in poll, select,
futex_wait) to be interrupted.

* OS support: Minor changes to signal handling required, currently
implemented for Linux and Solaris.

Credits: This is a POSIX backport of Windows threading changes by
Anton Kovalenko and Dmitry Kalyanov.

2012-08-10 18:54:28 View
Download
[e6f4c7] (4.0 kB) by David Lichteblau David Lichteblau

Add safepoint mechanism

* Stop threads for GC at safepoints only.

* Replaces use of SIG_STOP_FOR_GC.

* Currently not used by default. Users need to set feature
SB-SAFEPOINT to enable this code. SB-SAFEPOINT should only be set
when SB-THREAD is also enabled.

* ISA support: Each architecture needs VOP support, and changes to
foreign call-out assembly; only x86 and x86-64 implemented at this
point.

* OS support: Minor changes to signal handling required, currently
implemented for Linux and Solaris.

* Performance note: Does not currently replace pseudo-atomic entirely,
except on Windows. Only once further work has been done to reduce
use of signals will pseudo-atomic become truly redundant. Therefore
use of safepoints on POSIX currently still implies the combined
performance overhead of both mechanisms.

* Design alternatives exist for some choices made here. In particular,
this commit places the safepoint trap page into the SBCL binary for
simplicity. It is likely that future changes to allow slam-free
runtime changes will have to go back to a hand-crafted address
parameter.

* This feature has been extracted from work related to Windows
support and backported to POSIX.

Credits: Uses the CSP-based stop-the-world protocol by Anton Kovalenko,
based on the safepoint and threading work by Dmitry Kalyanov. Use of
safepoints for SBCL originally researched by Paul Khuong.

2012-08-10 12:51:45 View
Download
[035264] (3.9 kB) by Manfred Gahr Manfred Gahr , pushed by Nikodemus Siivola Nikodemus Siivola

fix make.sh --dynamic-space-size option handling

!CONFIGURE-DYNAMIC-SPACE-END actually ignored the number it read.

2011-12-05 21:42:48 View
Download
[aadc83] (3.9 kB) by Nikodemus Siivola Nikodemus Siivola

smaller default dynamic-space size on GENCGC

512Mb for 32-bit platforms, 1Gb for 64-bit ones.

(OpenBSD/x86-64 is the exception using 444Mb to fit under default ulimits.)

2011-11-21 16:40:17 View
Download
[27b74e] (3.7 kB) by Nathan Froyd Nathan Froyd

1.0.43.17: fix static symbols for array dispatch tables

The array dispatch tables have gone through several renamings. Unfortunately,
the references to the names in compiler/generic/parms.lisp have not been
renamed as well. Do so, and micro-optimize generic array access slightly.

(Optimizing SYMBOL-VALUE on static/global symbols would help as well...)

2010-10-04 02:12:53 View
Download
[fc6722] (3.7 kB) by Nikodemus Siivola Nikodemus Siivola

1.0.43.10: make.sh now accepts --dynamic-space-size=<size> option

...so users can build SBCL with the right default without
touching source.

Fixes lp#383222.

2010-09-30 08:36:38 View
Download
[46c787] (2.9 kB) by Alastair Bridgewater Alastair Bridgewater

1.0.42.34: threads: Consolidate thread-specific static symbols

* The x86, x86-64 and ppc backends all had the same three static
symbols used for threading. Rather than having each backend add
the same symbols to the static symbol list, add them to the list
of common static symbols. In the unlikely(?) event that we commit
a threaded port to mainline that doesn't use these symbols, we can
revisit this change.

2010-09-08 01:04:41 View
Download
[2aa6e7] (2.8 kB) by Alastair Bridgewater Alastair Bridgewater

1.0.41.15: gencgc: Implement object pinning for non-x86oids.

* Add a new static symbol for all non-x86oid gencgc targets,
*pinned-objects*.

* Bind *pinned-objects* to NIL during thread creation if it is
defined.

* During garbage collection, where x86oids preserve pointers on
the various thread stacks, use the same mechanism to preserve
pointers linked on *pinned-objects* for each thread.

* Change the PPC version of with-pinned-objects to rebind
*pinned-objects* with the new objects to pin prepended when using
gencgc.

2010-08-06 18:49:42 View
Download
[4ec0d7] (2.7 kB) by Nikodemus Siivola Nikodemus Siivola

1.0.32.33: GENCGC tuning parameters

* Define +HIGHEST-NORMAL-GENERATION+ and +PSEUDO-STATIC-GENERATION+
in lisp, and let genesis tell C about them.

* Make various generations[gen].foo tweakable from lisp, give them
nice interface functions and document the same.

* Bits of manual prettification in related parts.

2009-11-19 16:08:37 View
Download
[cf4908] (2.6 kB) by Nathan Froyd Nathan Froyd

1.0.28.31: remove :PREFIX/:SUFFIX from DEFENUM for MORE GREPPABILITY

Searching for useful things like even-fixnum-lowtag in the source won't
find the actual definition due to cleverness with DEFENUM. This cleverness
is the source of several FIXMEs throughout the code. I can personally
remember being baffled at the magic of even-fixnum-lowtag and friends
magically springing into existence when I could not easily grep for their
definitions. In the interest of clarity, remove the cleverness and update
all relevent DEFENUMs.

In the interest of OAOO, move TRACE-TABLE-* constants to generic code while
we're at it, too. Doing the same thing for the *-TRAP constants is left
as an exercise for another day.

2009-05-08 20:58:23 View
Download
[e5d969] (2.5 kB) by Gabor Melis Gabor Melis

1.0.25.50: detect binding and alien stack exhaustion

Alien stack exhaustion machinery only works on x86oids.

2009-02-16 22:23:08 View
Download
[ae09f8] (2.4 kB) by Gabor Melis Gabor Melis

1.0.25.44: INTERRUPT-THREAD and timer improvements

The main thing accomplished by this commit is that it's finally
possible to use INTERRUPT-THREAD and TIMERS sanely:

- there is a per thread interruption queue, interruption are executed
in order of arrival

- the interruption has to explicitly enable interrupts with
WITH-INTERRUPTS if needed. In the absence of WITH-INTERRUPTS the
interruption itself is not interrupted and running out of stack is
not a problem.

- timers have an improved repeat mechanism

Implementation notes:

- INTERRUPT-THREAD is implemented on all platforms and builds (that
is, even without :SB-THREAD) by sending a signal to the current
thread (or process without thread). This allows us to hook into the
normal, interrupt deferral mechanism without having to commit OAOO
violations on the Lisp side. And it makes threaded, non-threaded
builds closer, hopefully easing testing.

- SIG_INTERRUPT_THREAD is SIGPIPE on all platforms. SIGPIPE is not
used in SBCL for its original purpose, instead it's for signalling a
thread that it should look at its interruption queue. The handler
(RUN_INTERRUPTION) just returns if there is nothing to do so it's
safe to receive spurious SIGPIPEs coming from the kernel.

- IN-INTERRUPTION does not unblock deferrables anymore, but arranges
for them to be unblocked when interrupts are enabled (see
*UNBLOCK-DEFERRABLES-ON-ENABLING-INTERRUPTS-P*).

- Thread interruption run wrapped in a (WITHOUT-INTERRUPTS
(ALLOW-WITH-INTERRUPTS ...)).

- Repeating timers reschedule themselves when they finished to the
current expiry time + repeat interval even if that's in the past.
Hence, a timer's schedule does not get shifted if it takes a long
time to run. If it takes more time than the repeat interval then it
may catch up on later invokations.

- Timers run wrapped in a (WITHOUT-INTERRUPTS (ALLOW-WITH-INTERRUPTS
...)) even in run in a new thread.

- Enable previously failing tests.

- Add more tests.

- Automatically unschedule repeating timers if they take up all the
CPU.

2009-02-16 22:16:20 View
Download
[4f9b5c] (2.4 kB) by Gabor Melis Gabor Melis

1.0.25.34: gc trigger improvements

- Make sure that gc never runs user code (after gc hooks and
finalizers) if interrupts are disabled and they cannot be enabled
(i.e. *ALLOW-WITH-INTERRUPTS* is NIL).

- clean up maybe_gc: we know that in the interrupted context gc
signals are unblocked (see "check that gc signals are unblocked"
commit) so it's safe to simply enable them and call SUB-GC

2009-02-16 21:53:25 View
Download
[edb227] (2.4 kB) by Gabor Melis Gabor Melis

1.0.25.32: improvements to WITHOUT-GCING

- implement it with only one UNWIND-PROTECT (about 30% faster)
- add *IN-WITHOUT-GCING*
- in maybe_defer_handler defer interrupts if we are in the racy part
of WITHOUT-GCING, that is with interrupts enabled, gc allowed but
still *IN-WITHOUT-GCING*
- check more invariants

2009-02-16 21:49:30 View
Download
[269873] (2.4 kB) by Nikodemus Siivola Nikodemus Siivola

1.0.24.21: call stub needed to switch between hpux heap-spaces

* Patch by Larry Valkama.

2009-01-04 07:35:53 View
Download
[0bb093] (2.4 kB) by Gabor Melis Gabor Melis

1.0.16.21: lose informatively when the tls is full

Instead of eventually producing a segv or some random corruption:

(progv (loop for i below 5000
collect (make-symbol (format nil "xxx~D" i)))
(loop for i below 5000 collect i))

2008-05-08 07:14:01 View
Download
[c548f7] (2.2 kB) by Nikodemus Siivola Nikodemus Siivola

1.0.6.36: ALLOW-WITH-INTERRUPTS and interrupt safe WITH-MUTEX &co

* Remove the *IN-INTERRUPTION* kludge, and replace it with a
general-purpose mechanism.

* New variable: *ALLOW-WITH-INTERRRUPTS*. WITH-INTERRUPTS is a no-op
unless it is true and interrupts are inhibited.

* WITHOUT-INTERRUPTS binds *ALLOW-WITH-INTERRUPTS* to NIL, and
establishes ALLOW-WITH-INTERRUPTS and WITH-LOCAL-INTERRUPTS as
local macros.

ALLOW-WITH-INTERRUPTS binds *ALLOW-WITH-INTERRUPTS* to the value it
held before entry to WITHOUT-INTERRUPTS.

WITH-LOCAL-INTERRUPTS is equivalent to
(allow-with-interrups (with-interrupts ...))
but somewhat more efficient.

* Use the above to make WITH-MUTEX &co interrupt-safe, but still
interruptible: WITH-FOO becomes
(without-interrupts
(unwind-protect
(when (setf foo (allow-with-interrupts (get-foo)))
(with-local-interrupts ...))
(when foo
(release-foo foo))))
and GET-FOO wraps it's waiting section inside a WITH-INTERRUPTS.

* While at it, rewrite WITH-MUTEX &co to use CALL-WITH-FOO style
expansions.

* Write CALL-WITH-SYSTEM-MUTEX as a more efficient alternative to:

(without-interrupt (with-mutex ...)) ; and
(without-gcing (with-mutex ...))

Similarly for CALL-WITH-RECURSIVE-SYSTEM-SPINLOCK, for the benefit
of PCL.

* No need to signal a WARNING for WITH-INTERRUPTS inside a WITHOUT-GCING,
as *ALLOW-WITH-INTERRUPTS* is always false there, so interrupts will
not be enabled.

2007-06-08 12:15:44 View
Download
Older >