<feed xmlns='http://www.w3.org/2005/Atom'>
<title>go/src/runtime/stack.go, branch json-isValidNumber</title>
<subtitle>Fork of Go programming language with my patches.</subtitle>
<id>http://git.kilabit.info/go/atom?h=json-isValidNumber</id>
<link rel='self' href='http://git.kilabit.info/go/atom?h=json-isValidNumber'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/'/>
<updated>2022-11-18T16:26:25Z</updated>
<entry>
<title>runtime,cmd/link: increase stack guard space when building with -race</title>
<updated>2022-11-18T16:26:25Z</updated>
<author>
<name>Keith Randall</name>
<email>khr@golang.org</email>
</author>
<published>2022-11-16T20:56:40Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=893964b9727a3dfcadab75c0f6b3c6b683b9bae0'/>
<id>urn:sha1:893964b9727a3dfcadab75c0f6b3c6b683b9bae0</id>
<content type='text'>
More stuff to do = more stack needed. Bump up the guard space when
building with the race detector.

Fixes #54291

Change-Id: I701bc8800507921bed568047d35b8f49c26e7df7
Reviewed-on: https://go-review.googlesource.com/c/go/+/451217
Run-TryBot: Keith Randall &lt;khr@golang.org&gt;
Reviewed-by: Keith Randall &lt;khr@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Reviewed-by: Michael Knyszek &lt;mknyszek@google.com&gt;
</content>
</entry>
<entry>
<title>runtime: fix a few function names on comments</title>
<updated>2022-11-07T19:48:30Z</updated>
<author>
<name>cui fliter</name>
<email>imcusg@gmail.com</email>
</author>
<published>2022-11-03T07:39:41Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=969bea8d59daa6bdd478b71f6e99d8b8f625a140'/>
<id>urn:sha1:969bea8d59daa6bdd478b71f6e99d8b8f625a140</id>
<content type='text'>
Change-Id: I9ef4898d68dfd06618c0bd8e23f81a1d2c77a836
Signed-off-by: cui fliter &lt;imcusg@gmail.com&gt;
Reviewed-on: https://go-review.googlesource.com/c/go/+/447460
Auto-Submit: Michael Pratt &lt;mpratt@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Reviewed-by: Matthew Dempsky &lt;mdempsky@google.com&gt;
Reviewed-by: Michael Pratt &lt;mpratt@google.com&gt;
Run-TryBot: Michael Pratt &lt;mpratt@google.com&gt;
</content>
</entry>
<entry>
<title>runtime: replace all uses of CtzXX with TrailingZerosXX</title>
<updated>2022-10-18T18:06:27Z</updated>
<author>
<name>Youlin Feng</name>
<email>fengyoulin@live.com</email>
</author>
<published>2022-10-05T07:29:29Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=7ae652b7c0cddb8f6e04bfa6f5805baac823dd64'/>
<id>urn:sha1:7ae652b7c0cddb8f6e04bfa6f5805baac823dd64</id>
<content type='text'>
Replace all uses of Ctz64/32/8 with TrailingZeros64/32/8, because they
are the same and maybe duplicated. Also renamed CtzXX functions in 386
assembly code.

Change-Id: I19290204858083750f4be589bb0923393950ae6d
Reviewed-on: https://go-review.googlesource.com/c/go/+/438935
Reviewed-by: Keith Randall &lt;khr@golang.org&gt;
Reviewed-by: Bryan Mills &lt;bcmills@google.com&gt;
Auto-Submit: Keith Randall &lt;khr@golang.org&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Reviewed-by: Keith Randall &lt;khr@google.com&gt;
Run-TryBot: Keith Randall &lt;khr@golang.org&gt;
</content>
</entry>
<entry>
<title>runtime: consolidate stkframe and its methods into stkframe.go</title>
<updated>2022-09-02T19:08:58Z</updated>
<author>
<name>Austin Clements</name>
<email>austin@google.com</email>
</author>
<published>2022-08-17T13:06:14Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=35026f373233de30dbdb6752822d3eabf2220c11'/>
<id>urn:sha1:35026f373233de30dbdb6752822d3eabf2220c11</id>
<content type='text'>
The stkframe struct and its methods are strewn across different source
files. Since they actually have a pretty coherent theme at this point,
migrate it all into a new file, stkframe.go. There are no code changes
in this CL.

For #54466, albeit rather indirectly.

Change-Id: Ibe53fc4b1106d131005e1c9d491be838a8f14211
Reviewed-on: https://go-review.googlesource.com/c/go/+/424516
Reviewed-by: Michael Pratt &lt;mpratt@google.com&gt;
Reviewed-by: Cherry Mui &lt;cherryyz@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Run-TryBot: Austin Clements &lt;austin@google.com&gt;
Auto-Submit: Austin Clements &lt;austin@google.com&gt;
</content>
</entry>
<entry>
<title>runtime: make getStackMap a method of stkframe</title>
<updated>2022-09-02T19:08:56Z</updated>
<author>
<name>Austin Clements</name>
<email>austin@google.com</email>
</author>
<published>2022-08-17T13:02:41Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=b91e3737296c815ecf2508644cc07328172640eb'/>
<id>urn:sha1:b91e3737296c815ecf2508644cc07328172640eb</id>
<content type='text'>
This places getStackMap alongside argBytes and argMapInternal as
another method of stkframe.

For #54466, albeit rather indirectly.

Change-Id: I411dda3605dd7f996983706afcbefddf29a68a85
Reviewed-on: https://go-review.googlesource.com/c/go/+/424515
Reviewed-by: Michael Pratt &lt;mpratt@google.com&gt;
Reviewed-by: Cherry Mui &lt;cherryyz@google.com&gt;
Run-TryBot: Austin Clements &lt;austin@google.com&gt;
Auto-Submit: Austin Clements &lt;austin@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
</content>
</entry>
<entry>
<title>runtime: replace stkframe.arglen/argmap with methods</title>
<updated>2022-09-02T19:08:53Z</updated>
<author>
<name>Austin Clements</name>
<email>austin@google.com</email>
</author>
<published>2022-08-14T01:39:56Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=dbf442b1b2c28b77db288121ee3a7bc669cdc768'/>
<id>urn:sha1:dbf442b1b2c28b77db288121ee3a7bc669cdc768</id>
<content type='text'>
Currently, stkframe.arglen and stkframe.argmap are populated by
gentraceback under a particular set of circumstances. But because they
can be constructed from other fields in stkframe, they don't need to
be computed eagerly at all. They're also rather misleading, as they're
only part of computing the actual argument map and most callers should
be using getStackMap, which does the rest of the work.

This CL drops these fields from stkframe. It shifts the functions that
used to compute them, getArgInfoFast and getArgInfo, into
corresponding methods stkframe.argBytes and stkframe.argMapInternal.
argBytes is expected to be used by callers that need to know only the
argument frame size, while argMapInternal is used only by argBytes and
getStackMap.

We also move some of the logic from getStackMap into argMapInternal
because the previous split of responsibilities didn't make much sense.
This lets us return just a bitvector from argMapInternal, rather than
both a bitvector, which carries a size, and an "actually use this
size".

The getArgInfoFast function was inlined before (and inl_test checked
this). We drop that requirement from stkframe.argBytes because the
uses of this have shifted and now it's only called from heap dumping
(which never happens) and conservative stack frame scanning (which
very, very rarely happens).

There will be a few follow-up clean-up CLs.

For #54466. This is a nice clean-up on its own, but it also serves to
remove pointers from the traceback state that would eventually become
troublesome write barriers once we stack-rip gentraceback.

Change-Id: I107f98ed8e7b00185c081de425bbf24af02a4163
Reviewed-on: https://go-review.googlesource.com/c/go/+/424514
Run-TryBot: Austin Clements &lt;austin@google.com&gt;
Auto-Submit: Austin Clements &lt;austin@google.com&gt;
Reviewed-by: Michael Pratt &lt;mpratt@google.com&gt;
Reviewed-by: Cherry Mui &lt;cherryyz@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
</content>
</entry>
<entry>
<title>runtime: fix formula for computing number of padding bytes</title>
<updated>2022-08-19T16:04:12Z</updated>
<author>
<name>Ludi Rehak</name>
<email>ludi317@gmail.com</email>
</author>
<published>2022-06-25T20:27:11Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=f15761b50bb3a2d1bae9b97f147b2d660e2e4853'/>
<id>urn:sha1:f15761b50bb3a2d1bae9b97f147b2d660e2e4853</id>
<content type='text'>
In order to prevent false sharing of cache lines, structs are
padded with some number of bytes. These bytes are unused, serving
only to make the size of the struct a multiple of the size of the
cache line.

The current calculation of how much to pad is an overestimation,
when the struct size is already a multiple of the cache line size
without padding. For these cases, no padding is necessary, and
the size of the inner pad field should be 0. The bug is that the
pad field is sized to a whole 'nother cache line, wasting space.

Here is the current formula that can never return 0:
cpu.CacheLinePadSize - unsafe.Sizeof(myStruct{})%cpu.CacheLinePadSize

This change simply mods that calculation by cpu.CacheLinePadSize,
so that 0 will be returned instead of cpu.CacheLinePadSize.

Change-Id: I26a2b287171bf47a3b9121873b2722f728381b5e
Reviewed-on: https://go-review.googlesource.com/c/go/+/414214
Reviewed-by: Keith Randall &lt;khr@golang.org&gt;
Run-TryBot: Michael Pratt &lt;mpratt@google.com&gt;
Auto-Submit: Michael Pratt &lt;mpratt@google.com&gt;
Reviewed-by: Keith Randall &lt;khr@google.com&gt;
Reviewed-by: Joedian Reid &lt;joedian@golang.org&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
</content>
</entry>
<entry>
<title>runtime: add and use runtime/internal/sys.NotInHeap</title>
<updated>2022-08-19T00:29:18Z</updated>
<author>
<name>Cuong Manh Le</name>
<email>cuong.manhle.vn@gmail.com</email>
</author>
<published>2022-08-07T10:43:57Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=a719a78c1b36141af68d84970695fe95263fb896'/>
<id>urn:sha1:a719a78c1b36141af68d84970695fe95263fb896</id>
<content type='text'>
Updates #46731

Change-Id: Ic2208c8bb639aa1e390be0d62e2bd799ecf20654
Reviewed-on: https://go-review.googlesource.com/c/go/+/421878
Reviewed-by: Keith Randall &lt;khr@google.com&gt;
Reviewed-by: Keith Randall &lt;khr@golang.org&gt;
Reviewed-by: Matthew Dempsky &lt;mdempsky@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Run-TryBot: Cuong Manh Le &lt;cuong.manhle.vn@gmail.com&gt;
</content>
</entry>
<entry>
<title>runtime: convert g.parkingOnChan to atomic type</title>
<updated>2022-08-17T16:26:22Z</updated>
<author>
<name>Cuong Manh Le</name>
<email>cuong.manhle.vn@gmail.com</email>
</author>
<published>2022-08-17T07:13:06Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=5b0ce94c07524f910278de1d90e31c5bc0805bbd'/>
<id>urn:sha1:5b0ce94c07524f910278de1d90e31c5bc0805bbd</id>
<content type='text'>
Updates #53821

Change-Id: I54de39b984984fb3c160aba5afacb90131fd47c4
Reviewed-on: https://go-review.googlesource.com/c/go/+/424394
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Reviewed-by: Keith Randall &lt;khr@google.com&gt;
Run-TryBot: Cuong Manh Le &lt;cuong.manhle.vn@gmail.com&gt;
Reviewed-by: Michael Pratt &lt;mpratt@google.com&gt;
Auto-Submit: Cuong Manh Le &lt;cuong.manhle.vn@gmail.com&gt;
</content>
</entry>
<entry>
<title>runtime: measure stack usage; start stacks larger if needed</title>
<updated>2022-05-12T22:32:42Z</updated>
<author>
<name>Keith Randall</name>
<email>khr@golang.org</email>
</author>
<published>2021-08-28T22:50:52Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=016d7552138077741a9c3fdadc73c0179f5d3ff7'/>
<id>urn:sha1:016d7552138077741a9c3fdadc73c0179f5d3ff7</id>
<content type='text'>
Measure the average stack size used by goroutines at every GC. When
starting a new goroutine, allocate an initial goroutine stack of that
average size. Intuition is that we'll waste at most 2x in stack space
because only half the goroutines can be below average. In turn, we
avoid some of the early stack growth / copying needed in the average
case.

More details in the design doc at: https://docs.google.com/document/d/1YDlGIdVTPnmUiTAavlZxBI1d9pwGQgZT7IKFKlIXohQ/edit?usp=sharing

name        old time/op  new time/op  delta
Issue18138  95.3µs ± 0%  67.3µs ±13%  -29.35%  (p=0.000 n=9+10)

Fixes #18138

Change-Id: Iba34d22ed04279da7e718bbd569bbf2734922eaa
Reviewed-on: https://go-review.googlesource.com/c/go/+/345889
Run-TryBot: Keith Randall &lt;khr@golang.org&gt;
Reviewed-by: Michael Knyszek &lt;mknyszek@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Reviewed-by: Keith Randall &lt;khr@google.com&gt;
</content>
</entry>
</feed>
