aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime
AgeCommit message (Collapse)Author
2014-08-13runtime/pprof: fix data raceDmitriy Vyukov
It's unclear why we do this broken double-checked locking. The mutex is not held for the whole duration of CPU profiling. Fixes #8365. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/116290043
2014-08-11runtime: no need to set R9 to m for runtime.sigpanic anymoreShenghou Ma
Replaces CL 123980043 which I created on the dev.power64 branch. LGTM=rsc R=rsc, iant CC=golang-codereviews https://golang.org/cl/123120043
2014-08-08runtime: bump MaxGcprocs to 32Dmitriy Vyukov
There was a number of improvements related to GC parallelization: 1. Parallel roots/stacks scanning. 2. Parallel stack shrinking. 3. Per-thread workbuf caches. 4. Workset reduction. Currently 32 threads work well. go.benchmarks:garbage benchmark on 2 x Intel Xeon E5-2690 (16 HT cores) 1 thread/1 processor: time=16405255 cputime=16386223 gc-pause-one=546793975 gc-pause-total=3280763 2 threads/1 processor: time=9043497 cputime=18075822 gc-pause-one=331116489 gc-pause-total=2152257 4 threads/1 processor: time=4882030 cputime=19421337 gc-pause-one=174543105 gc-pause-total=1134530 8 threads/1 processor: time=4134757 cputime=20097075 gc-pause-one=158680588 gc-pause-total=1015555 16 threads/1 processor + HT: time=2006706 cputime=31960509 gc-pause-one=75425744 gc-pause-total=460097 16 threads/2 processors: time=1513373 cputime=23805571 gc-pause-one=56630946 gc-pause-total=345448 32 threads/2 processors + HT: time=1199312 cputime=37592764 gc-pause-one=48945064 gc-pause-total=278986 LGTM=rlh R=golang-codereviews, tracey.brendan, rlh CC=golang-codereviews, khr, rsc https://golang.org/cl/123920043
2014-08-08runtime: mark functions as static where possibleMatthew Dempsky
Update #8092 LGTM=dvyukov R=golang-codereviews, minux, dvyukov CC=golang-codereviews https://golang.org/cl/122250043
2014-08-08runtime: fix data race in stackallocDmitriy Vyukov
Stack shrinking happens during mark phase, and it assumes that it owns stackcache in mcache. Stack cache flushing also happens during mark phase, and it accesses stackcache's w/o any synchronization. This leads to stackcache corruption: http://goperfd.appspot.com/log/309af5571dfd7e1817259b9c9cf9bcf9b2c27610 LGTM=khr R=khr CC=golang-codereviews, rsc https://golang.org/cl/126870043
2014-08-07runtime: convert equality functions to GoKeith Randall
LGTM=rsc R=rsc, khr CC=golang-codereviews https://golang.org/cl/121330043
2014-08-07runtime: convert interface routines from C to Go.Keith Randall
LGTM=dvyukov R=golang-codereviews, dave, bradfitz, dvyukov, khr CC=golang-codereviews https://golang.org/cl/98510044
2014-08-07runtime: fix nacl/amd64p32 buildDmitriy Vyukov
C compiler does not support unnamed fields. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/124870043
2014-08-07runtime: test distribution of interface hashes.Keith Randall
LGTM=dvyukov R=dvyukov, khr CC=golang-codereviews https://golang.org/cl/121030043
2014-08-07cmd/cc, runtime: eliminate use of the unnamed substructure C extensionPeter Collingbourne
Eliminating use of this extension makes it easier to port the Go runtime to other compilers. This CL also disables the extension in cc to prevent accidental use. LGTM=rsc, khr R=rsc, aram, khr, dvyukov CC=axwalk, golang-codereviews https://golang.org/cl/106790044
2014-08-07runtime: convert markallocated from C to GoDmitriy Vyukov
benchmark old ns/op new ns/op delta BenchmarkMalloc8 28.7 22.4 -21.95% BenchmarkMalloc16 44.8 33.8 -24.55% BenchmarkMallocTypeInfo8 49.0 32.9 -32.86% BenchmarkMallocTypeInfo16 46.7 35.8 -23.34% BenchmarkMallocLargeStruct 907 901 -0.66% BenchmarkGobDecode 13235542 12036851 -9.06% BenchmarkGobEncode 10639699 9539155 -10.34% BenchmarkJSONEncode 25193036 21898922 -13.08% BenchmarkJSONDecode 96104044 89464904 -6.91% Fixes #8452. LGTM=khr R=golang-codereviews, bradfitz, rsc, dave, khr CC=golang-codereviews https://golang.org/cl/122090043
2014-08-07runtime: fix plan9/windows buildDmitriy Vyukov
Fix few remaining cases after cl/117580043. TBR=dfc R=golang-codereviews CC=dave, golang-codereviews https://golang.org/cl/124850043
2014-08-07runtime: remove mal/malloc/FlagNoGC/FlagNoInvokeGCDmitriy Vyukov
FlagNoGC is unused now. FlagNoInvokeGC is unneeded as we don't invoke GC on g0 and when holding locks anyway. mal/malloc have very few uses and you never remember the exact set of flags they use and the difference between them. Moreover, eventually we need to give exact types to all allocations, something what mal/malloc do not support. LGTM=khr R=golang-codereviews, khr CC=golang-codereviews, rsc https://golang.org/cl/117580043
2014-08-07runtime: shrink stacks in parallelDmitriy Vyukov
Shrinkstack does not touch normal heap anymore, so we can shink stacks concurrently with marking. LGTM=khr R=golang-codereviews, khr CC=golang-codereviews, khr, rlh, rsc https://golang.org/cl/122130043
2014-08-06runtime: clean up naming of mcallable functions.Keith Randall
Introduce the mFunction type to represent an mcall/onM-able function. Name such functions using _m. LGTM=bradfitz R=bradfitz CC=golang-codereviews https://golang.org/cl/121320043
2014-08-06runtime: use better hash for floating point inputsRuss Cox
Hashing on the bytes instead of the words does a (much) better job of using all the bits, so that maps of floats have linear performance. LGTM=khr R=golang-codereviews, khr CC=adonovan, golang-codereviews https://golang.org/cl/126720044
2014-08-06runtime: shorten hash declarationsKeith Randall
LGTM=iant R=dvyukov, iant CC=golang-codereviews https://golang.org/cl/117680044
2014-08-06runtime: use better hash for non-empty interfaceRuss Cox
The implementation 'return 0' results in too many collisions. LGTM=khr R=golang-codereviews, adonovan, khr CC=golang-codereviews, iant, khr, r https://golang.org/cl/125720044
2014-08-06runtime: turn off 'unexpected return pc' print on arm tracebackRuss Cox
It can happen legitimately if a profiling signal arrives at just the wrong moment. It's harmless. Fixes #8153. LGTM=minux R=golang-codereviews, minux CC=golang-codereviews, iant, r https://golang.org/cl/118670043
2014-08-06runtime: remove unused variableDmitriy Vyukov
Left over from cl/119490044. LGTM=bradfitz R=rsc, bradfitz CC=golang-codereviews https://golang.org/cl/125730043
2014-08-06runtime: simplify codeDmitriy Vyukov
Full spans can't be passed to UncacheSpan since we get rid of free. LGTM=rsc R=golang-codereviews CC=golang-codereviews, khr, rsc https://golang.org/cl/119490044
2014-08-06runtime: burn cpu before calling yield in windows runtime.systimeAlex Brainman
LGTM=dvyukov R=golang-codereviews, dvyukov CC=golang-codereviews https://golang.org/cl/117670043
2014-08-06runtime: get rid of SA_RESTORER on ARM.Shenghou Ma
The manpages says SA_RESTORER is obsolete, and indeed, not every architecture support it. However, sadly it's required on x86_64, see http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/x86/kernel/signal.c?id=26bcd8b72563b4c54892c4c2a409f6656fb8ae8b#n430, so only use it on x86. LGTM=rsc R=rsc, iant CC=golang-codereviews https://golang.org/cl/115450043
2014-08-06runtime: remove dead codeShenghou Ma
LGTM=bradfitz, dave, ruiu R=rsc, iant, bradfitz, dave, ruiu CC=golang-codereviews https://golang.org/cl/116610043
2014-08-06runtime: disable aeshash on NaCl at compile timeShenghou Ma
Fixes build for nacl/386. LGTM=dave R=khr, bradfitz, dave, dan.kortschak, rsc CC=golang-codereviews https://golang.org/cl/121080043
2014-08-05cmd/cgo: fix handling of defs_linux.goMatthew Dempsky
Instead of including <sys/types.h> to get size_t, instead include the ISO C standard <stddef.h> header, which defines fewer additional types at risk of colliding with the user code. In particular, this prevents collisions between <sys/types.h>'s userspace definitions with the kernel definitions needed by defs_linux.go. Also, -cdefs mode uses #pragma pack, so we can keep misaligned fields. Fixes #8477. LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://golang.org/cl/120610043
2014-08-06runtime: cache one GC workbuf in thread-local storageDmitriy Vyukov
We call scanblock for lots of small root pieces e.g. for every stack frame args and locals area. Every scanblock invocation calls getempty/putempty, which accesses lock-free stack shared among all worker threads. One-element local cache allows most scanblock calls to proceed without accessing the shared stack. LGTM=rsc R=golang-codereviews, rlh CC=golang-codereviews, khr, rsc https://golang.org/cl/121250043
2014-08-05runtime: remove type.goDmitriy Vyukov
We have an autogenerated version in zruntime_defs. I am not sure what are the consequences as gdb never printed any values for me. But it looks unnecessary to manually duplicate it. LGTM=rsc R=golang-codereviews, rsc CC=golang-codereviews, iant, khr https://golang.org/cl/115660043
2014-08-05runtime/race: add tests for maps with big keys/valsDmitriy Vyukov
With the recent GC changes large objects are handled somewhat differently. LGTM=khr R=khr CC=golang-codereviews https://golang.org/cl/114600043
2014-08-05runtime: remove outdated commentDmitriy Vyukov
LGTM=bradfitz, khr R=khr, bradfitz CC=golang-codereviews https://golang.org/cl/120400043
2014-08-04runtime: use memmove rather than memcopy in mgc0.cIan Lance Taylor
For consistency with other code, as that was the only use of memcopy outside of alg.goc. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/122030044
2014-08-04runtime: remove unused enum maxroundIan Lance Taylor
LGTM=minux, dave R=golang-codereviews, minux, dave CC=golang-codereviews https://golang.org/cl/122030043
2014-08-04runtime: only use a single variable in USEDIan Lance Taylor
The gccgo version of USED only accepts a single variable, so this simplifies merging. LGTM=minux, dave R=golang-codereviews, minux, dave CC=golang-codereviews https://golang.org/cl/115630043
2014-08-01runtime: move constants from map header to map typeKeith Randall
A good cleanup anyway, and it makes some room for an additional field needed for issue 8412. Update #8412 LGTM=iant R=iant, khr CC=golang-codereviews https://golang.org/cl/112700043
2014-08-01runtime: prevent pointless jmp in amd64 and 386 memmoveJosh Bleecher Snyder
6a and 8a rearrange memmove such that the fallthrough from move_1or2 to move_0 ends up being a JMP to a RET. Insert an explicit RET to prevent such silliness. Do the same for memclr as prophylaxis. benchmark old ns/op new ns/op delta BenchmarkMemmove1 4.59 4.13 -10.02% BenchmarkMemmove2 4.58 4.13 -9.83% LGTM=khr R=golang-codereviews, dvyukov, minux, ruiu, bradfitz, khr CC=golang-codereviews https://golang.org/cl/120930043
2014-08-01runtime: implement monotonic clocks on windowsAlex Brainman
Update #6007. LGTM=minux, dvyukov R=golang-codereviews, dvyukov, patrick, aram.h, minux CC=golang-codereviews https://golang.org/cl/108700045
2014-07-31runtime: missed a file in alg checkinKeith Randall
TBR=dvyukov CC=golang-codereviews https://golang.org/cl/122740044
2014-07-31runtime: convert hash functions to Go calling convention.Keith Randall
Create proper closures so hash functions can be called directly from Go. Rearrange calling convention so return value is directly accessible. LGTM=dvyukov R=golang-codereviews, dvyukov, dave, khr CC=golang-codereviews https://golang.org/cl/119360043
2014-07-31runtime: move built-in print routines to go.Keith Randall
Fixes #8297 LGTM=bradfitz R=golang-codereviews, bradfitz, khr, dave, dvyukov CC=golang-codereviews https://golang.org/cl/119240043
2014-07-31runtime: fix 32 bit build.Keith Randall
int(maxMem) is negative on 32 bits. Need to use unsigned arithmetic. TBR=bradfitz CC=golang-codereviews https://golang.org/cl/121000045
2014-07-31runtime: convert slice operations to Go.Keith Randall
LGTM=bradfitz, dvyukov R=golang-codereviews, bradfitz, dvyukov CC=golang-codereviews https://golang.org/cl/120190044
2014-07-31runtime: use right mask to extract type kindKeith Randall
Cleanup from recent malloc changes. LGTM=dvyukov R=dvyukov CC=golang-codereviews https://golang.org/cl/120960043
2014-07-31runtime: get rid of freeDmitriy Vyukov
Several reasons: 1. Significantly simplifies runtime. 2. This code proved to be buggy. 3. Free is incompatible with bump-the-pointer allocation. 4. We want to write runtime in Go, Go does not have free. 5. Too much code to free env strings on startup. LGTM=khr R=golang-codereviews, josharian, tracey.brendan, khr CC=bradfitz, golang-codereviews, r, rlh, rsc https://golang.org/cl/116390043
2014-07-30runtime: cast to uintptr to match %p formatter.Keith Randall
LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/121920043
2014-07-30runtime: fix cmallocgc's C prototypeMatthew Dempsky
LGTM=khr R=khr CC=golang-codereviews https://golang.org/cl/121910043
2014-07-30runtime: fix stack memory testKeith Randall
Stand-alone this test is fine. Run together with others, however, the stack used can actually go negative because other tests are freeing stack during its execution. This behavior is new with the new stack allocator. The old allocator never returned (min-sized) stacks. This test is fairly poor - it needs to run in isolation to be accurate. Maybe we should delete it. LGTM=r R=r CC=golang-codereviews https://golang.org/cl/119330044
2014-07-30runtime: fix assembler macro definitions to be consistent in use of center-dotRob Pike
The DISPATCH and CALLFN macro definitions depend on an inconsistency between the internal cpp mini-implementation and the language proper in whether center-dot is an identifier character. The macro depends on it not being an identifier character, but the resulting code depends on it being one. Remove the dependence on the inconsistency by placing the center-dot into the macro invocation rather that the body. No semantic change. This is just renaming macro arguments. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/119320043
2014-07-30runtime: fix freebsd build. Assignment is int32* on 32 bitKeith Randall
machines and int64* on 64 bit machines. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/117330044
2014-07-30runtime: rewrite malloc in Go.Keith Randall
This change introduces gomallocgc, a Go clone of mallocgc. Only a few uses have been moved over, so there are still lots of uses from C. Many of these C uses will be moved over to Go (e.g. in slice.goc), but probably not all. What should remain of C's mallocgc is an open question. LGTM=rsc, dvyukov R=rsc, khr, dave, bradfitz, dvyukov CC=golang-codereviews https://golang.org/cl/108840046
2014-07-29runtime: generate type info for chansDmitriy Vyukov
LGTM=khr R=golang-codereviews, khr CC=golang-codereviews, khr https://golang.org/cl/115280043