From: Josh E. <jo...@el...> - 2013-12-15 05:46:11
|
On Sat, Dec 14, 2013 at 10:52:47PM +0200, Timo Myyrä wrote: > Hi, > > Seems that the thread support for OpenBSD isn't that far. I've applied included > patches to 1.1.14 version of SBCL and compiled the project with threading > support. I played with this a bit recently too. I pushed it to github at https://github.com/jre/sbcl/tree/openbsd-threads if anyone is interested. x86-64 and x86 look pretty good, powerpc is untested as the build fails for me on master currently. > I got few failures in normal tests but those seemed to be caused by > lack of memory. Little ulimit tweaking and test passed with one unexpected > success. I also reduced the iterations in symbol-value-in-thread.3 in > threads.pure tests to same amount as win32. The test seemed to work but it is > pretty slow. I didn't see any memory failures, but I seem to be running with higher then default ulimits. Thanks for the reminder that I have to watch out for that when testing. My results on x86-64 were similar to yours, although I'm not sure if I recall that unexpected success. The slowness of some of the tests is due to assumptions made about timer resolution, openbsd's sleep times are much much courser than other modern systems. Tests which repeatedly sleep for very small amounts in tight loops can end up orders of magnitude slower. I played a bit with using clock_getres(CLOCK_REALTIME, ...) to get the system clock granularity and using that to automatically adjust the iteration count of tests which do loop with very small sleeps, but I'm not convinced it's worth the extra complexity. > Finished running tests. > Status: > Unexpected success: threads.pure.lisp / (SEMAPHORE-NOTIFICATION WAIT-ON-SEMAPHORE LP-1038034) > Expected failure: float.impure.lisp / (RANGE-REDUCTION PRECISE-PI) > Expected failure: packages.impure.lisp / USE-PACKAGE-CONFLICT-SET > Expected failure: packages.impure.lisp / IMPORT-SINGLE-CONFLICT > Expected failure: walk.impure.lisp / (WALK-LET* HAIRY-SPECIALS) > Expected failure: walk.impure.lisp / (WALK-LET* HAIRY-SPECIALS) > (3 tests skipped for this combination of platform and features) > > There are still few issues left. Sb-concurrency contrib has few test failures. > I also noticed some warnings "Timer <> failed to interrupt thread <>." when > running thread.pure tests. That frlock test failure in sb-concurrency is sleep granularity again. The test takes so long that it times out. If you fiddle with the numbers then it passes just fine. I don't see the other two sb-concurrency failures on my system. I believe the "failed to interrupt thread" messages are normal for the test in question, much like the alarming "deadlock detected" messages in another. > Timo > > --- src/runtime/Config.generic-openbsd.orig Sat Nov 30 16:28:19 2013 > +++ src/runtime/Config.generic-openbsd Fri Dec 13 20:17:43 2013 > @@ -19,3 +19,7 @@ CFLAGS += -fno-pie > LINKFLAGS += -nopie > LDFLAGS += -nopie > endif > + > +ifdef LISP_FEATURE_SB_THREAD > + OS_LIBS += -lpthread > +endif > > --- src/runtime/bsd-os.h.orig Fri Dec 13 20:13:22 2013 > +++ src/runtime/bsd-os.h Fri Dec 13 20:13:33 2013 > @@ -63,6 +63,8 @@ extern int sig_memory_fault; > > #elif defined __OpenBSD__ > > +#define SIG_STOP_FOR_GC (SIGUSR2) > + > typedef struct sigcontext os_context_t; > #define SIG_MEMORY_FAULT SIGSEGV > #if defined(LISP_FEATURE_X86) > > > ---- > here's the failed test output: > > Test SB-CONCURRENCY-TEST::FRLOCK.1 failed > Form: (HANDLER-CASE > (WITH-TIMEOUT 60 > (SB-CONCURRENCY-TEST::TEST-FRLOCKS)) > (TIMEOUT (SB-CONCURRENCY-TEST::C) (ERROR "~A" SB-CONCURRENCY-TEST::C))) > Expected values: NIL > NIL > Actual value: #<SIMPLE-ERROR "~A" {10041ABB53}>. > SB-CONCURRENCY-TEST::QUEUE.1 SB-CONCURRENCY-TEST::QUEUE.2 > SB-CONCURRENCY-TEST::QUEUE.3 SB-CONCURRENCY-TEST::QUEUE.4 > SB-CONCURRENCY-TEST::QUEUE.5 SB-CONCURRENCY-TEST::QUEUE.T.1 > SB-CONCURRENCY-TEST::QUEUE.T.2 SB-CONCURRENCY-TEST::QUEUE.T.3 > SB-CONCURRENCY-TEST::MAILBOX-TRIVIA.1 SB-CONCURRENCY-TEST::MAILBOX-TRIVIA.2 > SB-CONCURRENCY-TEST::MAILBOX-TRIVIA.3 SB-CONCURRENCY-TEST::MAILBOX-TIMEOUTS > SB-CONCURRENCY-TEST::MAILBOX.SINGLE-PRODUCER-SINGLE-CONSUMER > SB-CONCURRENCY-TEST::MAILBOX.SINGLE-PRODUCER-MULTIPLE-CONSUMERS > SB-CONCURRENCY-TEST::MAILBOX.MULTIPLE-PRODUCERS-SINGLE-CONSUMER > Test SB-CONCURRENCY-TEST::MAILBOX.MULTIPLE-PRODUCERS-MULTIPLE-CONSUMERS failed > Form: (SB-CONCURRENCY-TEST::TEST-MAILBOX-PRODUCERS-CONSUMERS :N-SENDERS 50 > :N-RECEIVERS 50 > :N-MESSAGES 1000) > Expected values: (:RECEIVED . 50000) > (:GARBAGE . 0) > (:ERRORS . 0) > (:TIMEOUTS . 0) > Actual values: (:RECEIVED . 48314) > (:GARBAGE . 0) > (:ERRORS . 0) > (:TIMEOUTS . 4). > Test SB-CONCURRENCY-TEST::MAILBOX.INTERRUPTS-SAFETY.1 failed > Form: (MULTIPLE-VALUE-BIND > (SB-CONCURRENCY-TEST::RECEIVED SB-CONCURRENCY-TEST::GARBAGE > SB-CONCURRENCY-TEST::ERRORS SB-CONCURRENCY-TEST::TIMEOUTS) > (SB-CONCURRENCY-TEST::TEST-MAILBOX-PRODUCERS-CONSUMERS :N-SENDERS 50 > :N-RECEIVERS > 50 :N-MESSAGES > 1000 > :INTERRUPTOR > #'(LAMBDA > (SB-CONCURRENCY-TEST::THREADS > &AUX > (SB-CONCURRENCY-TEST::N > (LENGTH > SB-CONCURRENCY-TEST::THREADS))) > (LOOP SB-CONCURRENCY-TEST::REPEAT 99 > SB-CONCURRENCY-TEST::FOR SB-CONCURRENCY-TEST::VICTIM = (NTH > (RANDOM > SB-CONCURRENCY-TEST::N) > SB-CONCURRENCY-TEST::THREADS) > DO (SB-CONCURRENCY-TEST::KILL-THREAD > SB-CONCURRENCY-TEST::VICTIM) (SLEEP > (RANDOM > 1.e-4))))) > (VALUES > (IF (<= (CDR SB-CONCURRENCY-TEST::RECEIVED) 1000000) > '(:RECEIVED . :OK) > SB-CONCURRENCY-TEST::RECEIVED) > SB-CONCURRENCY-TEST::GARBAGE SB-CONCURRENCY-TEST::TIMEOUTS)) > Expected values: (:RECEIVED . :OK) > (:GARBAGE . 0) > (:TIMEOUTS . 0) > Actual values: (:RECEIVED . :OK) > (:GARBAGE . 0) > (:TIMEOUTS . 2). > 3 out of 25 total tests failed: SB-CONCURRENCY-TEST::FRLOCK.1, > SB-CONCURRENCY-TEST::MAILBOX.MULTIPLE-PRODUCERS-MULTIPLE-CONSUMERS, > SB-CONCURRENCY-TEST::MAILBOX.INTERRUPTS-SAFETY.1. > > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk > _______________________________________________ > Sbcl-devel mailing list > Sbc...@li... > https://lists.sourceforge.net/lists/listinfo/sbcl-devel |