Commit e5a4211b authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

runtime: do not profile blocked netpoll on windows

There is frequently a thread hanging on GQCS,
currently it skews profiles towards netpoll,
but it is not bad and is not consuming any resources.

R=alex.brainman
CC=golang-codereviews
https://golang.org/cl/61560043
parent 120218af
......@@ -94,13 +94,17 @@ retry:
n = nelem(entries) / runtime·gomaxprocs;
if(n < 8)
n = 8;
if(block)
m->blocked = true;
if(runtime·stdcall(runtime·GetQueuedCompletionStatusEx, 6, iocphandle, entries, (uintptr)n, &n, (uintptr)wait, (uintptr)0) == 0) {
m->blocked = false;
errno = runtime·getlasterror();
if(!block && errno == WAIT_TIMEOUT)
return nil;
runtime·printf("netpoll: GetQueuedCompletionStatusEx failed (errno=%d)\n", errno);
runtime·throw("netpoll: GetQueuedCompletionStatusEx failed");
}
m->blocked = false;
for(i = 0; i < n; i++) {
op = entries[i].op;
errno = 0;
......@@ -113,7 +117,10 @@ retry:
op = nil;
errno = 0;
qty = 0;
if(block)
m->blocked = true;
if(runtime·stdcall(runtime·GetQueuedCompletionStatus, 5, iocphandle, &qty, &key, &op, (uintptr)wait) == 0) {
m->blocked = false;
errno = runtime·getlasterror();
if(!block && errno == WAIT_TIMEOUT)
return nil;
......@@ -123,6 +130,7 @@ retry:
}
// dequeued failed IO packet, so report that
}
m->blocked = false;
handlecompletion(&gp, op, errno, qty);
}
if(block && gp == nil)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment