<feed xmlns='http://www.w3.org/2005/Atom'>
<title>go/src/runtime/os_windows.go, branch fix-runtime-test-GOMAXPROCS</title>
<subtitle>Fork of Go programming language with my patches.</subtitle>
<id>http://git.kilabit.info/go/atom?h=fix-runtime-test-GOMAXPROCS</id>
<link rel='self' href='http://git.kilabit.info/go/atom?h=fix-runtime-test-GOMAXPROCS'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/'/>
<updated>2025-07-11T21:27:24Z</updated>
<entry>
<title>runtime: gofmt after CL 643897 and CL 662455</title>
<updated>2025-07-11T21:27:24Z</updated>
<author>
<name>Tobias Klauser</name>
<email>tklauser@distanz.ch</email>
</author>
<published>2025-07-11T20:51:46Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=6ebb5f56d9ed35588970ce69cbad63508403bb8d'/>
<id>urn:sha1:6ebb5f56d9ed35588970ce69cbad63508403bb8d</id>
<content type='text'>
Change-Id: I3103325ebe29509c00b129a317b5708aece575a0
Reviewed-on: https://go-review.googlesource.com/c/go/+/687715
Reviewed-by: Michael Pratt &lt;mpratt@google.com&gt;
Reviewed-by: Carlos Amedee &lt;carlos@golang.org&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Auto-Submit: Tobias Klauser &lt;tobias.klauser@gmail.com&gt;
</content>
</entry>
<entry>
<title>runtime: rename ncpu to numCPUStartup</title>
<updated>2025-05-19T19:47:30Z</updated>
<author>
<name>Michael Pratt</name>
<email>mpratt@google.com</email>
</author>
<published>2025-05-13T17:12:47Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=db956262ac4125693cffb517ea7aebf6ab04ec35'/>
<id>urn:sha1:db956262ac4125693cffb517ea7aebf6ab04ec35</id>
<content type='text'>
ncpu is the total logical CPU count at startup. It is never updated. For
#73193, we will start using updated CPU counts for updated GOMAXPROCS,
making the ncpu name a bit ambiguous. Change to a less ambiguous name.

While we're at it, give the OS specific lookup functions a common name,
so it can be used outside of osinit later.

For #73193.

Change-Id: I6a6a636cf21cc60de36b211f3c374080849fc667
Reviewed-on: https://go-review.googlesource.com/c/go/+/672277
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Michael Knyszek &lt;mknyszek@google.com&gt;
Auto-Submit: Michael Pratt &lt;mpratt@google.com&gt;
</content>
</entry>
<entry>
<title>runtime: cleanup M vgetrandom state before dropping P</title>
<updated>2025-04-03T08:25:08Z</updated>
<author>
<name>Michael Pratt</name>
<email>mpratt@google.com</email>
</author>
<published>2025-04-03T03:26:25Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=0b31e6d4cc804ab76ae8ced151ee2f50657aec14'/>
<id>urn:sha1:0b31e6d4cc804ab76ae8ced151ee2f50657aec14</id>
<content type='text'>
When an M is destroyed, we put its vgetrandom state back on the shared
list for another M to reuse. This list is simply a slice, so appending
to the slice may allocate. Currently this operation is performed in
mdestroy, after the P is released, meaning allocation is not allowed.

More the cleanup earlier in mdestroy when allocation is still OK.

Also add //go:nowritebarrierrec to mdestroy since it runs without a P,
which would have caught this bug.

Fixes #73141.

Change-Id: I6a6a636c3fbf5c6eec09d07a260e39dbb4d2db12
Reviewed-on: https://go-review.googlesource.com/c/go/+/662455
Reviewed-by: Jason Donenfeld &lt;Jason@zx2c4.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Keith Randall &lt;khr@golang.org&gt;
Reviewed-by: Keith Randall &lt;khr@google.com&gt;
</content>
</entry>
<entry>
<title>runtime: deduplicate context call injection on Windows</title>
<updated>2025-03-21T21:24:40Z</updated>
<author>
<name>qmuntal</name>
<email>quimmuntal@gmail.com</email>
</author>
<published>2025-03-14T10:56:20Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=3108366214bb1fc15b0f261ba27f448e3bd0e685'/>
<id>urn:sha1:3108366214bb1fc15b0f261ba27f448e3bd0e685</id>
<content type='text'>
Injecting a call to a thread context is complex enough to warrant
a dedicated function so that we don't repeat the same code in multiple
places. Note that the unix sigctxt struct also follows the
same approach.

The behavior is unchanged, but the implementation semantics are now
clearer by using goarch.StackAlign instead of a mix of goarch.PtrSize,
goarch.StackAlign and hardcoded values.

While here, fix #68552.

Cq-Include-Trybots: luci.golang.try:gotip-windows-arm64
Change-Id: Ic29cd2bf322b520127fecccafd61577076945758
Reviewed-on: https://go-review.googlesource.com/c/go/+/657815
Reviewed-by: Cherry Mui &lt;cherryyz@google.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: David Chase &lt;drchase@google.com&gt;
</content>
</entry>
<entry>
<title>runtime: move getcallersp to internal/runtime/sys</title>
<updated>2024-09-17T17:01:20Z</updated>
<author>
<name>Michael Pratt</name>
<email>mpratt@google.com</email>
</author>
<published>2024-09-16T19:58:36Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=4f881115d4067bda8a236aabcae8c41cdd13b4d0'/>
<id>urn:sha1:4f881115d4067bda8a236aabcae8c41cdd13b4d0</id>
<content type='text'>
Moving these intrinsics to a base package enables other internal/runtime
packages to use them.

For #54766.

Change-Id: I45a530422207dd94b5ad4eee51216c9410a84040
Reviewed-on: https://go-review.googlesource.com/c/go/+/613261
Reviewed-by: Cherry Mui &lt;cherryyz@google.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
</content>
</entry>
<entry>
<title>runtime: move getcallerpc to internal/runtime/sys</title>
<updated>2024-09-17T15:14:14Z</updated>
<author>
<name>Michael Pratt</name>
<email>mpratt@google.com</email>
</author>
<published>2024-09-16T18:07:43Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=81c92352a7c6aadc434e7d0921d046a599ba2807'/>
<id>urn:sha1:81c92352a7c6aadc434e7d0921d046a599ba2807</id>
<content type='text'>
Moving these intrinsics to a base package enables other internal/runtime
packages to use them.

For #54766.

Change-Id: I0b3eded3bb45af53e3eb5bab93e3792e6a8beb46
Reviewed-on: https://go-review.googlesource.com/c/go/+/613260
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Cherry Mui &lt;cherryyz@google.com&gt;
</content>
</entry>
<entry>
<title>testing: use QueryPerformanceCounter on Windows</title>
<updated>2024-04-26T22:55:25Z</updated>
<author>
<name>Egon Elbre</name>
<email>egonelbre@gmail.com</email>
</author>
<published>2024-01-22T07:31:43Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=1c4704991aeae5c9e0c6816a227390829b724ab5'/>
<id>urn:sha1:1c4704991aeae5c9e0c6816a227390829b724ab5</id>
<content type='text'>
Windows time.Now granularity is around 0.5ms on modern systems,
which introduces a significant noise into benchmark results.
Instead of relying time.Now use QueryPerformanceCounter, which
has significantly better granularity compared to time.Now.

 │ TimeNow-32  │        HighPrecisionTimeNow-32        │
 │   sec/op    │    sec/op     vs base                 │
   4.812n ± 0%   30.580n ± 0%  +535.43% (p=0.000 n=20)

Fixes #31160

Change-Id: Ib2a574d638c9c6762a2524212def02265574e267
Reviewed-on: https://go-review.googlesource.com/c/go/+/557315
Reviewed-by: Quim Muntal &lt;quimmuntal@gmail.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Alex Brainman &lt;alex.brainman@gmail.com&gt;
Reviewed-by: Cherry Mui &lt;cherryyz@google.com&gt;
Reviewed-by: Michael Knyszek &lt;mknyszek@google.com&gt;
</content>
</entry>
<entry>
<title>runtime: don't call lockOSThread for every syscall call on Windows</title>
<updated>2024-03-26T03:12:13Z</updated>
<author>
<name>qmuntal</name>
<email>quimmuntal@gmail.com</email>
</author>
<published>2024-03-11T09:49:44Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=1f354a60ff7e8e047e4dfecb1033a20ee8c266dc'/>
<id>urn:sha1:1f354a60ff7e8e047e4dfecb1033a20ee8c266dc</id>
<content type='text'>
Windows syscall.SyscallN currently calls lockOSThread for every syscall.
This can be expensive and produce unnecessary context switches,
especially when the syscall is called frequently under high contention.

The lockOSThread was necessary to ensure that cgocall wouldn't
reschedule the goroutine to a different M, as the syscall return values
are reported back in the M struct.

This CL instructs cgocall to copy the syscall return values into the
the M that will see the caller on return, so the caller no longer needs
to call lockOSThread.

Updates #58336.

Cq-Include-Trybots: luci.golang.try:gotip-windows-arm64,gotip-windows-amd64-longtest
Change-Id: If6644fd111dbacab74e7dcee2afa18ca146735da
Reviewed-on: https://go-review.googlesource.com/c/go/+/562915
Reviewed-by: Alex Brainman &lt;alex.brainman@gmail.com&gt;
Auto-Submit: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
Reviewed-by: Than McIntosh &lt;thanm@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Reviewed-by: Michael Pratt &lt;mpratt@google.com&gt;
Run-TryBot: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
</content>
</entry>
<entry>
<title>runtime: migrate internal/atomic to internal/runtime</title>
<updated>2024-03-25T19:53:03Z</updated>
<author>
<name>Andy Pan</name>
<email>panjf2000@gmail.com</email>
</author>
<published>2024-02-01T02:21:14Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=4c2b1e0feb3d3112da94fa4cd11ebe995003fa89'/>
<id>urn:sha1:4c2b1e0feb3d3112da94fa4cd11ebe995003fa89</id>
<content type='text'>
For #65355

Change-Id: I65dd090fb99de9b231af2112c5ccb0eb635db2be
Reviewed-on: https://go-review.googlesource.com/c/go/+/560155
Reviewed-by: David Chase &lt;drchase@google.com&gt;
Reviewed-by: Michael Pratt &lt;mpratt@google.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Ibrahim Bazoka &lt;ibrahimbazoka729@gmail.com&gt;
Auto-Submit: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
</content>
</entry>
<entry>
<title>cmd/internal/osinfo,runtime,syscall: use RtlGetVersion instead of RtlGetNtVersionNumbers</title>
<updated>2024-03-21T11:49:46Z</updated>
<author>
<name>qmuntal</name>
<email>quimmuntal@gmail.com</email>
</author>
<published>2024-03-12T13:20:33Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=cff7267e0d77f02d582c613c272b6f8ebf1c0412'/>
<id>urn:sha1:cff7267e0d77f02d582c613c272b6f8ebf1c0412</id>
<content type='text'>
The RtlGetNtVersionNumbers function is not documented by Microsoft.
Use RtlGetVersion instead, which is documented and available on all
supported versions of Windows.

Cq-Include-Trybots: luci.golang.try:gotip-windows-amd64-longtest,gotip-windows-arm64
Change-Id: Ibaf0e2c28e673951476c5d863a829fd166705aea
Reviewed-on: https://go-review.googlesource.com/c/go/+/571015
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: David Chase &lt;drchase@google.com&gt;
Reviewed-by: Than McIntosh &lt;thanm@google.com&gt;
</content>
</entry>
</feed>
