From d28d7cef03e73e791df1fdd7ed06eb1e269d01ba Mon Sep 17 00:00:00 2001
From: Kirill Smelkov <kirr@nexedi.com>
Date: Thu, 7 Sep 2017 23:36:26 +0300
Subject: [PATCH] .

---
 go/NOTES-go               |  14 ++
 go/neo/connection_test.go |  17 ++-
 go/todo.dot               |  38 ++++-
 go/todo.svg               | 294 ++++++++++++++++++++++++--------------
 4 files changed, 243 insertions(+), 120 deletions(-)

diff --git a/go/NOTES-go b/go/NOTES-go
index 1206fe99..435769d2 100644
--- a/go/NOTES-go
+++ b/go/NOTES-go
@@ -3,6 +3,20 @@
 
 ? random access -> mmap
 
+- scheduler won't use free P if a G is taking time and other Gs are queued after it on the same P:
+   https://groups.google.com/forum/#!topic/golang-nuts/8KYER1ALelg
+
+e870f06c (runtime: yield time slice to most recently readied G)
+ea0386f8 (runtime: improve randomized stealing logic)
+4bb491b1 (runtime: improve scheduler fairness)
+/s steal
+findrunnable
+runqsteal
+? runqgrab
+schedule	<- top entry
+
+https://golang.org/s/go11sched	-> syscall/M partking and Unparking/Spinning
+
 ----------------------------------------
 
 - TODO stats for events (packets received, errors, etc)
diff --git a/go/neo/connection_test.go b/go/neo/connection_test.go
index 89acc521..761366de 100644
--- a/go/neo/connection_test.go
+++ b/go/neo/connection_test.go
@@ -36,6 +36,8 @@ import (
 
 	"github.com/kylelemons/godebug/pretty"
 	"github.com/pkg/errors"
+
+	"runtime"
 )
 
 func xclose(c io.Closer) {
@@ -721,11 +723,9 @@ func TestHandshake(t *testing.T) {
 // ---- benchmarks ----
 
 // rtt over chan - for comparision as base
-func BenchmarkChanRTT(b *testing.B) {
-	c12 := make(chan byte)
-	c21 := make(chan byte)
-
+func benchmarkChanRTT(b *testing.B, c12, c21 chan byte) {
 	go func() {
+		runtime.LockOSThread()
 		for {
 			c, ok := <-c12
 			if !ok {
@@ -748,6 +748,15 @@ func BenchmarkChanRTT(b *testing.B) {
 	close(c12)
 }
 
+func BenchmarkSyncChanRTT(b *testing.B) {
+	benchmarkChanRTT(b, make(chan byte), make(chan byte))
+}
+
+func BenchmarkBufChanRTT(b *testing.B) {
+	benchmarkChanRTT(b, make(chan byte, 1), make(chan byte, 1))
+}
+
+
 // rtt over net.Conn Read/Write
 func benchmarkNetConnRTT(b *testing.B, c1, c2 net.Conn) {
 	buf1 := make([]byte, 1)
diff --git a/go/todo.dot b/go/todo.dot
index 8d624555..074c5a48 100644
--- a/go/todo.dot
+++ b/go/todo.dot
@@ -10,11 +10,24 @@ digraph {
 	Sgo -> load_serial_next;
 	Sgo -> Sgo_speed;
 
-	Sgo_speed -> Mmap_go;
-	Sgo_speed -> sha1_index;
 	//Sgo_speed -> B_link_recv;
 	Sgo_speed -> garbage;
-	Sgo_speed -> gosched;
+	//Sgo_speed -> gosched;
+	Sgo_speed -> diskio;
+	Sgo_speed -> ConnClose_notimer;
+
+	Sgo_speed -> QSgo_speed;
+
+	QSgo_speed -> Mmap_go;
+	QSgo_speed -> sha1_index;
+
+	garbage	-> pktbuf_alloc;
+	garbage -> msg_alloc;
+	garbage -> conn_alloc;
+
+	diskio	-> gosched;
+	diskio	-> GOMAXPROCS;
+
 
 	Cpy_r_Sgo -> Sgo;
 	//Cpy_r_Sgo -> Protog_fix;
@@ -33,12 +46,13 @@ digraph {
 	Mgo		[label=<M<sub>go</sub>> style=filled fillcolor=lightyellow];
 	SCgo_t		[label=<S<sub>go</sub>  / C<sub>go</sub>  tests> style=filled fillcolor=lightyellow];
 	Sgo_speed	[label=<S<sub>go</sub>  speed/latency>];
-	Cpy_r_Sgo	[label=<C<sub>py</sub>  read S<sub>go</sub>>];
-	Cgo_r_Sgo	[label=<C<sub>go</sub>  read S<sub>go</sub>>];
-	Cgo_r_Spy	[label=<C<sub>go</sub>  read S<sub>py</sub>>];
+	Cpy_r_Sgo	[label=<C<sub>py</sub>  read S<sub>go</sub>> style=filled fillcolor=lightyellow];
+	Cgo_r_Sgo	[label=<C<sub>go</sub>  read S<sub>go</sub>> style=filled fillcolor=lightyellow];
+	Cgo_r_Spy	[label=<C<sub>go</sub>  read S<sub>py</sub>> style=filled fillcolor=lightyellow];
 	Cleanup		[label="Cleanup history"];
+	Post		[label="Post"];
 	//Cpy_patch	[label=<py patch: ConnID py=go> style=filled fillcolor=lightyellow];	// C<sub>py</sub>  patch for ConnID interop. with S<sub>go</sub>>];
-	Mmap_go		[label="io.ReaderAt via mmap"];
+	Mmap_go		[label="? io.ReaderAt via mmap"];
 	//Protog_fix	[label="proto(go/py) compat fix" style=filled fillcolor=lightyellow];
 	//Mpy_vs_Sgo	[label=<M<sub>py</sub> vs S<sub>go</sub>: try/fix> style=filled fillcolor=lightyellow];
 
@@ -52,4 +66,14 @@ digraph {
 
 	//Cgo -> Cgo_tasks;
 	//Cgo_tasks	[label="- talkMaster\n- update nodeTab/partTab\n- dial S on demand\n..." style=filled fillcolor=lightyellow];
+
+	QSgo_speed	[label=<?>];
+
+	pktbuf_alloc	[label=<PktBuf>];
+	msg_alloc	[label=<Msg>];
+	conn_alloc	[label=<Conn>];
+
+	ConnClose_notimer	[label="Conn.Close\nno timer"];
+	diskio		[label="disk io"];
+	GOMAXPROCS	[label="? GOMAXPROCS"];
 }
diff --git a/go/todo.svg b/go/todo.svg
index d8d26df1..52cb8e01 100644
--- a/go/todo.svg
+++ b/go/todo.svg
@@ -4,184 +4,260 @@
 <!-- Generated by graphviz version 2.38.0 (20140413.2041)
  -->
 <!-- Title: %3 Pages: 1 -->
-<svg width="805pt" height="404pt"
- viewBox="0.00 0.00 804.54 404.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 400)">
+<svg width="1033pt" height="494pt"
+ viewBox="0.00 0.00 1033.03 493.74" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 489.74)">
 <title>%3</title>
-<polygon fill="white" stroke="none" points="-4,4 -4,-400 800.536,-400 800.536,4 -4,4"/>
+<polygon fill="white" stroke="none" points="-4,4 -4,-489.74 1029.03,-489.74 1029.03,4 -4,4"/>
 <!-- Cgo -->
 <g id="node1" class="node"><title>Cgo</title>
-<ellipse fill="lightyellow" stroke="black" cx="416.242" cy="-306" rx="27" ry="18"/>
-<text text-anchor="start" x="404.742" y="-303.3" font-family="Times,serif" font-size="14.00">C</text>
-<text text-anchor="start" x="414.742" y="-303.3" font-family="Times,serif" baseline-shift="sub" font-size="14.00">go</text>
+<ellipse fill="lightyellow" stroke="black" cx="416.242" cy="-395.74" rx="27" ry="18"/>
+<text text-anchor="start" x="404.742" y="-393.04" font-family="Times,serif" font-size="14.00">C</text>
+<text text-anchor="start" x="414.742" y="-393.04" font-family="Times,serif" baseline-shift="sub" font-size="14.00">go</text>
 </g>
 <!-- SCgo_t -->
 <g id="node2" class="node"><title>SCgo_t</title>
-<ellipse fill="lightyellow" stroke="black" cx="416.242" cy="-234" rx="69.5877" ry="18"/>
-<text text-anchor="start" x="370.742" y="-231.3" font-family="Times,serif" font-size="14.00">S</text>
-<text text-anchor="start" x="378.742" y="-231.3" font-family="Times,serif" baseline-shift="sub" font-size="14.00">go</text>
-<text text-anchor="start" x="391.742" y="-231.3" font-family="Times,serif" font-size="14.00"> &#160;/ C</text>
-<text text-anchor="start" x="416.742" y="-231.3" font-family="Times,serif" baseline-shift="sub" font-size="14.00">go</text>
-<text text-anchor="start" x="429.742" y="-231.3" font-family="Times,serif" font-size="14.00"> &#160;tests</text>
+<ellipse fill="lightyellow" stroke="black" cx="416.242" cy="-323.74" rx="69.5877" ry="18"/>
+<text text-anchor="start" x="370.742" y="-321.04" font-family="Times,serif" font-size="14.00">S</text>
+<text text-anchor="start" x="378.742" y="-321.04" font-family="Times,serif" baseline-shift="sub" font-size="14.00">go</text>
+<text text-anchor="start" x="391.742" y="-321.04" font-family="Times,serif" font-size="14.00"> &#160;/ C</text>
+<text text-anchor="start" x="416.742" y="-321.04" font-family="Times,serif" baseline-shift="sub" font-size="14.00">go</text>
+<text text-anchor="start" x="429.742" y="-321.04" font-family="Times,serif" font-size="14.00"> &#160;tests</text>
 </g>
 <!-- Cgo&#45;&gt;SCgo_t -->
 <g id="edge1" class="edge"><title>Cgo&#45;&gt;SCgo_t</title>
-<path fill="none" stroke="black" d="M410.402,-288.411C409.539,-280.507 409.29,-270.852 409.654,-261.935"/>
-<polygon fill="black" stroke="black" points="413.145,-262.179 410.362,-251.956 406.162,-261.683 413.145,-262.179"/>
+<path fill="none" stroke="black" d="M410.402,-378.151C409.539,-370.247 409.29,-360.592 409.654,-351.675"/>
+<polygon fill="black" stroke="black" points="413.145,-351.919 410.362,-341.696 406.162,-351.423 413.145,-351.919"/>
 </g>
 <!-- SCgo_t&#45;&gt;Cgo -->
 <g id="edge5" class="edge"><title>SCgo_t&#45;&gt;Cgo</title>
-<path fill="none" stroke="black" d="M422.121,-251.956C422.956,-259.827 423.19,-269.374 422.825,-278.187"/>
-<polygon fill="black" stroke="black" points="419.316,-278.184 422.082,-288.411 426.297,-278.691 419.316,-278.184"/>
+<path fill="none" stroke="black" d="M422.121,-341.696C422.956,-349.567 423.19,-359.114 422.825,-367.927"/>
+<polygon fill="black" stroke="black" points="419.316,-367.924 422.082,-378.151 426.297,-368.431 419.316,-367.924"/>
 </g>
 <!-- Sgo -->
 <g id="node3" class="node"><title>Sgo</title>
-<ellipse fill="lightyellow" stroke="black" cx="331.242" cy="-162" rx="27" ry="18"/>
-<text text-anchor="start" x="320.742" y="-159.3" font-family="Times,serif" font-size="14.00">S</text>
-<text text-anchor="start" x="328.742" y="-159.3" font-family="Times,serif" baseline-shift="sub" font-size="14.00">go</text>
+<ellipse fill="lightyellow" stroke="black" cx="331.242" cy="-251.74" rx="27" ry="18"/>
+<text text-anchor="start" x="320.742" y="-249.04" font-family="Times,serif" font-size="14.00">S</text>
+<text text-anchor="start" x="328.742" y="-249.04" font-family="Times,serif" baseline-shift="sub" font-size="14.00">go</text>
 </g>
 <!-- SCgo_t&#45;&gt;Sgo -->
 <g id="edge4" class="edge"><title>SCgo_t&#45;&gt;Sgo</title>
-<path fill="none" stroke="black" d="M391.193,-217.116C378.555,-207.611 363.535,-195.394 351.607,-184.973"/>
-<polygon fill="black" stroke="black" points="353.702,-182.151 343.911,-178.101 349.039,-187.373 353.702,-182.151"/>
+<path fill="none" stroke="black" d="M391.193,-306.856C378.555,-297.351 363.535,-285.134 351.607,-274.713"/>
+<polygon fill="black" stroke="black" points="353.702,-271.891 343.911,-267.842 349.039,-277.113 353.702,-271.891"/>
 </g>
 <!-- Mgo -->
 <g id="node4" class="node"><title>Mgo</title>
-<ellipse fill="lightyellow" stroke="black" cx="416.242" cy="-162" rx="27.0966" ry="18"/>
-<text text-anchor="start" x="403.242" y="-159.3" font-family="Times,serif" font-size="14.00">M</text>
-<text text-anchor="start" x="416.242" y="-159.3" font-family="Times,serif" baseline-shift="sub" font-size="14.00">go</text>
+<ellipse fill="lightyellow" stroke="black" cx="416.242" cy="-251.74" rx="27.0966" ry="18"/>
+<text text-anchor="start" x="403.242" y="-249.04" font-family="Times,serif" font-size="14.00">M</text>
+<text text-anchor="start" x="416.242" y="-249.04" font-family="Times,serif" baseline-shift="sub" font-size="14.00">go</text>
 </g>
 <!-- SCgo_t&#45;&gt;Mgo -->
 <g id="edge3" class="edge"><title>SCgo_t&#45;&gt;Mgo</title>
-<path fill="none" stroke="black" d="M416.242,-215.697C416.242,-207.983 416.242,-198.712 416.242,-190.112"/>
-<polygon fill="black" stroke="black" points="419.742,-190.104 416.242,-180.104 412.742,-190.104 419.742,-190.104"/>
+<path fill="none" stroke="black" d="M416.242,-305.437C416.242,-297.723 416.242,-288.453 416.242,-279.853"/>
+<polygon fill="black" stroke="black" points="419.742,-279.844 416.242,-269.844 412.742,-279.844 419.742,-279.844"/>
 </g>
 <!-- Sgo&#45;&gt;SCgo_t -->
 <g id="edge2" class="edge"><title>Sgo&#45;&gt;SCgo_t</title>
-<path fill="none" stroke="black" d="M350.708,-174.751C363.576,-184.113 380.277,-197.526 393.685,-209.122"/>
-<polygon fill="black" stroke="black" points="391.729,-212.064 401.544,-216.055 396.36,-206.815 391.729,-212.064"/>
+<path fill="none" stroke="black" d="M350.708,-264.491C363.576,-273.853 380.277,-287.267 393.685,-298.862"/>
+<polygon fill="black" stroke="black" points="391.729,-301.804 401.544,-305.795 396.36,-296.555 391.729,-301.804"/>
 </g>
 <!-- io_cancel -->
 <g id="node5" class="node"><title>io_cancel</title>
-<ellipse fill="none" stroke="black" cx="94.2416" cy="-90" rx="94.4839" ry="18"/>
-<text text-anchor="middle" x="94.2416" y="-86.3" font-family="Times,serif" font-size="14.00">? conn IO vs ctx cancel</text>
+<ellipse fill="none" stroke="black" cx="94.2416" cy="-179.74" rx="94.4839" ry="18"/>
+<text text-anchor="middle" x="94.2416" y="-176.04" font-family="Times,serif" font-size="14.00">? conn IO vs ctx cancel</text>
 </g>
 <!-- Sgo&#45;&gt;io_cancel -->
 <g id="edge6" class="edge"><title>Sgo&#45;&gt;io_cancel</title>
-<path fill="none" stroke="black" d="M306.771,-153.772C270.736,-143.129 202.325,-122.923 152.833,-108.306"/>
-<polygon fill="black" stroke="black" points="153.784,-104.937 143.202,-105.461 151.801,-111.65 153.784,-104.937"/>
+<path fill="none" stroke="black" d="M306.771,-243.513C270.736,-232.869 202.325,-212.664 152.833,-198.046"/>
+<polygon fill="black" stroke="black" points="153.784,-194.677 143.202,-195.201 151.801,-201.39 153.784,-194.677"/>
 </g>
 <!-- load_serial_next -->
 <g id="node6" class="node"><title>load_serial_next</title>
-<ellipse fill="none" stroke="black" cx="331.242" cy="-90" rx="124.578" ry="18"/>
-<text text-anchor="start" x="243.242" y="-87.3" font-family="Times,serif" font-size="14.00">? GetObject return += serial</text>
-<text text-anchor="start" x="398.242" y="-87.3" font-family="Times,serif" baseline-shift="sub" font-size="14.00">next</text>
+<ellipse fill="none" stroke="black" cx="331.242" cy="-179.74" rx="124.578" ry="18"/>
+<text text-anchor="start" x="243.242" y="-177.04" font-family="Times,serif" font-size="14.00">? GetObject return += serial</text>
+<text text-anchor="start" x="398.242" y="-177.04" font-family="Times,serif" baseline-shift="sub" font-size="14.00">next</text>
 </g>
 <!-- Sgo&#45;&gt;load_serial_next -->
 <g id="edge7" class="edge"><title>Sgo&#45;&gt;load_serial_next</title>
-<path fill="none" stroke="black" d="M331.242,-143.697C331.242,-135.983 331.242,-126.712 331.242,-118.112"/>
-<polygon fill="black" stroke="black" points="334.742,-118.104 331.242,-108.104 327.742,-118.104 334.742,-118.104"/>
+<path fill="none" stroke="black" d="M331.242,-233.437C331.242,-225.723 331.242,-216.453 331.242,-207.853"/>
+<polygon fill="black" stroke="black" points="334.742,-207.844 331.242,-197.844 327.742,-207.844 334.742,-207.844"/>
 </g>
 <!-- Sgo_speed -->
 <g id="node7" class="node"><title>Sgo_speed</title>
-<ellipse fill="none" stroke="black" cx="551.242" cy="-90" rx="77.1866" ry="18"/>
-<text text-anchor="start" x="499.742" y="-87.3" font-family="Times,serif" font-size="14.00">S</text>
-<text text-anchor="start" x="507.742" y="-87.3" font-family="Times,serif" baseline-shift="sub" font-size="14.00">go</text>
-<text text-anchor="start" x="520.742" y="-87.3" font-family="Times,serif" font-size="14.00"> &#160;speed/latency</text>
+<ellipse fill="none" stroke="black" cx="551.242" cy="-179.74" rx="77.1866" ry="18"/>
+<text text-anchor="start" x="499.742" y="-177.04" font-family="Times,serif" font-size="14.00">S</text>
+<text text-anchor="start" x="507.742" y="-177.04" font-family="Times,serif" baseline-shift="sub" font-size="14.00">go</text>
+<text text-anchor="start" x="520.742" y="-177.04" font-family="Times,serif" font-size="14.00"> &#160;speed/latency</text>
 </g>
 <!-- Sgo&#45;&gt;Sgo_speed -->
 <g id="edge8" class="edge"><title>Sgo&#45;&gt;Sgo_speed</title>
-<path fill="none" stroke="black" d="M354.616,-152.712C362.712,-149.889 371.858,-146.753 380.242,-144 418.81,-131.337 462.533,-117.799 496.113,-107.576"/>
-<polygon fill="black" stroke="black" points="497.196,-110.905 505.746,-104.649 495.161,-104.207 497.196,-110.905"/>
+<path fill="none" stroke="black" d="M354.616,-242.452C362.712,-239.629 371.858,-236.493 380.242,-233.74 418.81,-221.077 462.533,-207.539 496.113,-197.316"/>
+<polygon fill="black" stroke="black" points="497.196,-200.645 505.746,-194.389 495.161,-193.947 497.196,-200.645"/>
 </g>
-<!-- Mmap_go -->
-<g id="node8" class="node"><title>Mmap_go</title>
-<ellipse fill="none" stroke="black" cx="329.242" cy="-18" rx="92.0841" ry="18"/>
-<text text-anchor="middle" x="329.242" y="-14.3" font-family="Times,serif" font-size="14.00">io.ReaderAt via mmap</text>
+<!-- garbage -->
+<g id="node8" class="node"><title>garbage</title>
+<ellipse fill="none" stroke="black" cx="277.242" cy="-98.8701" rx="38.1938" ry="18"/>
+<text text-anchor="middle" x="277.242" y="-95.1701" font-family="Times,serif" font-size="14.00">garbage</text>
 </g>
-<!-- Sgo_speed&#45;&gt;Mmap_go -->
-<g id="edge9" class="edge"><title>Sgo_speed&#45;&gt;Mmap_go</title>
-<path fill="none" stroke="black" d="M507.382,-75.1703C472.467,-64.161 423.355,-48.6754 385.539,-36.7513"/>
-<polygon fill="black" stroke="black" points="386.279,-33.3149 375.689,-33.6457 384.174,-39.9909 386.279,-33.3149"/>
+<!-- Sgo_speed&#45;&gt;garbage -->
+<g id="edge9" class="edge"><title>Sgo_speed&#45;&gt;garbage</title>
+<path fill="none" stroke="black" d="M504.451,-165.271C452.4,-150.289 369.077,-126.304 319.106,-111.921"/>
+<polygon fill="black" stroke="black" points="319.852,-108.493 309.274,-109.091 317.916,-115.22 319.852,-108.493"/>
+</g>
+<!-- diskio -->
+<g id="node9" class="node"><title>diskio</title>
+<ellipse fill="none" stroke="black" cx="497.242" cy="-98.8701" rx="34.394" ry="18"/>
+<text text-anchor="middle" x="497.242" y="-95.1701" font-family="Times,serif" font-size="14.00">disk io</text>
+</g>
+<!-- Sgo_speed&#45;&gt;diskio -->
+<g id="edge10" class="edge"><title>Sgo_speed&#45;&gt;diskio</title>
+<path fill="none" stroke="black" d="M539.524,-161.626C532.086,-150.762 522.34,-136.528 514.08,-124.464"/>
+<polygon fill="black" stroke="black" points="516.92,-122.416 508.382,-116.142 511.144,-126.37 516.92,-122.416"/>
+</g>
+<!-- ConnClose_notimer -->
+<g id="node10" class="node"><title>ConnClose_notimer</title>
+<ellipse fill="none" stroke="black" cx="606.242" cy="-98.8701" rx="56.6372" ry="26.7407"/>
+<text text-anchor="middle" x="606.242" y="-102.67" font-family="Times,serif" font-size="14.00">Conn.Close</text>
+<text text-anchor="middle" x="606.242" y="-87.6701" font-family="Times,serif" font-size="14.00">no timer</text>
+</g>
+<!-- Sgo_speed&#45;&gt;ConnClose_notimer -->
+<g id="edge11" class="edge"><title>Sgo_speed&#45;&gt;ConnClose_notimer</title>
+<path fill="none" stroke="black" d="M563.176,-161.626C568.992,-153.287 576.192,-142.961 583.03,-133.156"/>
+<polygon fill="black" stroke="black" points="586.053,-134.94 588.902,-124.735 580.311,-130.936 586.053,-134.94"/>
+</g>
+<!-- QSgo_speed -->
+<g id="node11" class="node"><title>QSgo_speed</title>
+<ellipse fill="none" stroke="black" cx="754.242" cy="-98.8701" rx="27" ry="18"/>
+<text text-anchor="start" x="750.742" y="-95.1701" font-family="Times,serif" font-size="14.00">?</text>
+</g>
+<!-- Sgo_speed&#45;&gt;QSgo_speed -->
+<g id="edge12" class="edge"><title>Sgo_speed&#45;&gt;QSgo_speed</title>
+<path fill="none" stroke="black" d="M589.424,-163.905C627.638,-149.059 685.787,-126.466 721.825,-112.465"/>
+<polygon fill="black" stroke="black" points="723.314,-115.641 731.368,-108.757 720.779,-109.116 723.314,-115.641"/>
+</g>
+<!-- pktbuf_alloc -->
+<g id="node14" class="node"><title>pktbuf_alloc</title>
+<ellipse fill="none" stroke="black" cx="319.242" cy="-18" rx="35.9954" ry="18"/>
+<text text-anchor="start" x="299.742" y="-14.3" font-family="Times,serif" font-size="14.00">PktBuf</text>
+</g>
+<!-- garbage&#45;&gt;pktbuf_alloc -->
+<g id="edge15" class="edge"><title>garbage&#45;&gt;pktbuf_alloc</title>
+<path fill="none" stroke="black" d="M286.149,-81.1437C291.773,-70.5825 299.152,-56.7249 305.515,-44.7762"/>
+<polygon fill="black" stroke="black" points="308.736,-46.1738 310.347,-35.7022 302.558,-42.8836 308.736,-46.1738"/>
+</g>
+<!-- msg_alloc -->
+<g id="node15" class="node"><title>msg_alloc</title>
+<ellipse fill="none" stroke="black" cx="160.242" cy="-18" rx="27" ry="18"/>
+<text text-anchor="start" x="147.742" y="-14.3" font-family="Times,serif" font-size="14.00">Msg</text>
+</g>
+<!-- garbage&#45;&gt;msg_alloc -->
+<g id="edge16" class="edge"><title>garbage&#45;&gt;msg_alloc</title>
+<path fill="none" stroke="black" d="M256.324,-83.7697C237,-70.743 208.187,-51.3204 187.155,-37.1423"/>
+<polygon fill="black" stroke="black" points="188.916,-34.1085 178.668,-31.4211 185.003,-39.9129 188.916,-34.1085"/>
+</g>
+<!-- conn_alloc -->
+<g id="node16" class="node"><title>conn_alloc</title>
+<ellipse fill="none" stroke="black" cx="235.242" cy="-18" rx="29.795" ry="18"/>
+<text text-anchor="start" x="220.242" y="-14.3" font-family="Times,serif" font-size="14.00">Conn</text>
+</g>
+<!-- garbage&#45;&gt;conn_alloc -->
+<g id="edge17" class="edge"><title>garbage&#45;&gt;conn_alloc</title>
+<path fill="none" stroke="black" d="M268.335,-81.1437C262.672,-70.5112 255.231,-56.5375 248.839,-44.5342"/>
+<polygon fill="black" stroke="black" points="251.782,-42.6131 243.992,-35.4318 245.603,-45.9034 251.782,-42.6131"/>
 </g>
-<!-- sha1_index -->
-<g id="node9" class="node"><title>sha1_index</title>
-<ellipse fill="none" stroke="black" cx="495.242" cy="-18" rx="55.4913" ry="18"/>
-<text text-anchor="middle" x="495.242" y="-14.3" font-family="Times,serif" font-size="14.00">? sha1 index</text>
+<!-- gosched -->
+<g id="node17" class="node"><title>gosched</title>
+<ellipse fill="none" stroke="black" cx="614.242" cy="-18" rx="66.0889" ry="18"/>
+<text text-anchor="middle" x="614.242" y="-14.3" font-family="Times,serif" font-size="14.00">? go scheduling</text>
 </g>
-<!-- Sgo_speed&#45;&gt;sha1_index -->
-<g id="edge10" class="edge"><title>Sgo_speed&#45;&gt;sha1_index</title>
-<path fill="none" stroke="black" d="M537.686,-72.055C530.876,-63.5427 522.496,-53.0684 514.987,-43.6815"/>
-<polygon fill="black" stroke="black" points="517.653,-41.4113 508.673,-35.789 512.187,-45.7842 517.653,-41.4113"/>
+<!-- diskio&#45;&gt;gosched -->
+<g id="edge18" class="edge"><title>diskio&#45;&gt;gosched</title>
+<path fill="none" stroke="black" d="M517.621,-84.1319C535.381,-72.1605 561.441,-54.5929 582.023,-40.7187"/>
+<polygon fill="black" stroke="black" points="584.132,-43.5177 590.468,-35.0259 580.22,-37.7133 584.132,-43.5177"/>
 </g>
-<!-- garbage -->
-<g id="node10" class="node"><title>garbage</title>
-<ellipse fill="none" stroke="black" cx="607.242" cy="-18" rx="38.1938" ry="18"/>
-<text text-anchor="middle" x="607.242" y="-14.3" font-family="Times,serif" font-size="14.00">garbage</text>
+<!-- GOMAXPROCS -->
+<g id="node18" class="node"><title>GOMAXPROCS</title>
+<ellipse fill="none" stroke="black" cx="451.242" cy="-18" rx="78.7863" ry="18"/>
+<text text-anchor="middle" x="451.242" y="-14.3" font-family="Times,serif" font-size="14.00">? GOMAXPROCS</text>
 </g>
-<!-- Sgo_speed&#45;&gt;garbage -->
-<g id="edge11" class="edge"><title>Sgo_speed&#45;&gt;garbage</title>
-<path fill="none" stroke="black" d="M564.798,-72.055C571.708,-63.4175 580.234,-52.7599 587.827,-43.2681"/>
-<polygon fill="black" stroke="black" points="590.682,-45.3022 594.196,-35.307 585.216,-40.9293 590.682,-45.3022"/>
+<!-- diskio&#45;&gt;GOMAXPROCS -->
+<g id="edge19" class="edge"><title>diskio&#45;&gt;GOMAXPROCS</title>
+<path fill="none" stroke="black" d="M487.71,-81.5281C481.503,-70.8854 473.275,-56.7779 466.206,-44.6568"/>
+<polygon fill="black" stroke="black" points="469.14,-42.74 461.078,-35.8652 463.093,-46.2667 469.14,-42.74"/>
 </g>
-<!-- gosched -->
-<g id="node11" class="node"><title>gosched</title>
-<ellipse fill="none" stroke="black" cx="730.242" cy="-18" rx="66.0889" ry="18"/>
-<text text-anchor="middle" x="730.242" y="-14.3" font-family="Times,serif" font-size="14.00">? go scheduling</text>
+<!-- Mmap_go -->
+<g id="node12" class="node"><title>Mmap_go</title>
+<ellipse fill="none" stroke="black" cx="926.242" cy="-18" rx="98.5829" ry="18"/>
+<text text-anchor="middle" x="926.242" y="-14.3" font-family="Times,serif" font-size="14.00">? io.ReaderAt via mmap</text>
+</g>
+<!-- QSgo_speed&#45;&gt;Mmap_go -->
+<g id="edge13" class="edge"><title>QSgo_speed&#45;&gt;Mmap_go</title>
+<path fill="none" stroke="black" d="M776.026,-87.8811C802.632,-75.681 848.289,-54.7449 882.302,-39.1484"/>
+<polygon fill="black" stroke="black" points="883.93,-42.2524 891.561,-34.9027 881.012,-35.8894 883.93,-42.2524"/>
+</g>
+<!-- sha1_index -->
+<g id="node13" class="node"><title>sha1_index</title>
+<ellipse fill="none" stroke="black" cx="754.242" cy="-18" rx="55.4913" ry="18"/>
+<text text-anchor="middle" x="754.242" y="-14.3" font-family="Times,serif" font-size="14.00">? sha1 index</text>
 </g>
-<!-- Sgo_speed&#45;&gt;gosched -->
-<g id="edge12" class="edge"><title>Sgo_speed&#45;&gt;gosched</title>
-<path fill="none" stroke="black" d="M589.203,-74.1548C617.048,-63.2657 654.989,-48.4284 684.506,-36.8854"/>
-<polygon fill="black" stroke="black" points="686.128,-40.0093 694.166,-33.1076 683.578,-33.4901 686.128,-40.0093"/>
+<!-- QSgo_speed&#45;&gt;sha1_index -->
+<g id="edge14" class="edge"><title>QSgo_speed&#45;&gt;sha1_index</title>
+<path fill="none" stroke="black" d="M754.242,-80.7564C754.242,-70.7312 754.242,-57.8362 754.242,-46.4246"/>
+<polygon fill="black" stroke="black" points="757.742,-46.0802 754.242,-36.0802 750.742,-46.0803 757.742,-46.0802"/>
 </g>
 <!-- Cpy_r_Sgo -->
-<g id="node12" class="node"><title>Cpy_r_Sgo</title>
-<ellipse fill="none" stroke="black" cx="228.242" cy="-234" rx="61.99" ry="18"/>
-<text text-anchor="start" x="188.742" y="-231.3" font-family="Times,serif" font-size="14.00">C</text>
-<text text-anchor="start" x="198.742" y="-231.3" font-family="Times,serif" baseline-shift="sub" font-size="14.00">py</text>
-<text text-anchor="start" x="211.742" y="-231.3" font-family="Times,serif" font-size="14.00"> &#160;read S</text>
-<text text-anchor="start" x="254.742" y="-231.3" font-family="Times,serif" baseline-shift="sub" font-size="14.00">go</text>
+<g id="node19" class="node"><title>Cpy_r_Sgo</title>
+<ellipse fill="lightyellow" stroke="black" cx="228.242" cy="-323.74" rx="61.99" ry="18"/>
+<text text-anchor="start" x="188.742" y="-321.04" font-family="Times,serif" font-size="14.00">C</text>
+<text text-anchor="start" x="198.742" y="-321.04" font-family="Times,serif" baseline-shift="sub" font-size="14.00">py</text>
+<text text-anchor="start" x="211.742" y="-321.04" font-family="Times,serif" font-size="14.00"> &#160;read S</text>
+<text text-anchor="start" x="254.742" y="-321.04" font-family="Times,serif" baseline-shift="sub" font-size="14.00">go</text>
 </g>
 <!-- Cpy_r_Sgo&#45;&gt;Sgo -->
-<g id="edge13" class="edge"><title>Cpy_r_Sgo&#45;&gt;Sgo</title>
-<path fill="none" stroke="black" d="M251.357,-217.291C267.071,-206.611 287.912,-192.447 304.367,-181.264"/>
-<polygon fill="black" stroke="black" points="306.693,-183.915 312.997,-175.399 302.759,-178.126 306.693,-183.915"/>
+<g id="edge20" class="edge"><title>Cpy_r_Sgo&#45;&gt;Sgo</title>
+<path fill="none" stroke="black" d="M251.357,-307.031C267.071,-296.351 287.912,-282.187 304.367,-271.004"/>
+<polygon fill="black" stroke="black" points="306.693,-273.655 312.997,-265.139 302.759,-267.866 306.693,-273.655"/>
 </g>
 <!-- Cgo_r_Sgo -->
-<g id="node13" class="node"><title>Cgo_r_Sgo</title>
-<ellipse fill="none" stroke="black" cx="318.242" cy="-378" rx="61.99" ry="18"/>
-<text text-anchor="start" x="278.742" y="-375.3" font-family="Times,serif" font-size="14.00">C</text>
-<text text-anchor="start" x="288.742" y="-375.3" font-family="Times,serif" baseline-shift="sub" font-size="14.00">go</text>
-<text text-anchor="start" x="301.742" y="-375.3" font-family="Times,serif" font-size="14.00"> &#160;read S</text>
-<text text-anchor="start" x="344.742" y="-375.3" font-family="Times,serif" baseline-shift="sub" font-size="14.00">go</text>
+<g id="node20" class="node"><title>Cgo_r_Sgo</title>
+<ellipse fill="lightyellow" stroke="black" cx="318.242" cy="-467.74" rx="61.99" ry="18"/>
+<text text-anchor="start" x="278.742" y="-465.04" font-family="Times,serif" font-size="14.00">C</text>
+<text text-anchor="start" x="288.742" y="-465.04" font-family="Times,serif" baseline-shift="sub" font-size="14.00">go</text>
+<text text-anchor="start" x="301.742" y="-465.04" font-family="Times,serif" font-size="14.00"> &#160;read S</text>
+<text text-anchor="start" x="344.742" y="-465.04" font-family="Times,serif" baseline-shift="sub" font-size="14.00">go</text>
 </g>
 <!-- Cgo_r_Sgo&#45;&gt;Cgo -->
-<g id="edge14" class="edge"><title>Cgo_r_Sgo&#45;&gt;Cgo</title>
-<path fill="none" stroke="black" d="M340.479,-361.116C355.251,-350.565 374.702,-336.671 390.197,-325.603"/>
-<polygon fill="black" stroke="black" points="392.241,-328.445 398.344,-319.784 388.172,-322.749 392.241,-328.445"/>
+<g id="edge21" class="edge"><title>Cgo_r_Sgo&#45;&gt;Cgo</title>
+<path fill="none" stroke="black" d="M340.479,-450.856C355.251,-440.305 374.702,-426.411 390.197,-415.343"/>
+<polygon fill="black" stroke="black" points="392.241,-418.185 398.344,-409.524 388.172,-412.489 392.241,-418.185"/>
 </g>
 <!-- Cgo_r_Sgo&#45;&gt;Sgo -->
-<g id="edge15" class="edge"><title>Cgo_r_Sgo&#45;&gt;Sgo</title>
-<path fill="none" stroke="black" d="M319.284,-359.849C321.532,-322.832 326.857,-235.181 329.578,-190.386"/>
-<polygon fill="black" stroke="black" points="333.082,-190.426 330.195,-180.232 326.095,-190.002 333.082,-190.426"/>
+<g id="edge22" class="edge"><title>Cgo_r_Sgo&#45;&gt;Sgo</title>
+<path fill="none" stroke="black" d="M319.284,-449.589C321.532,-412.572 326.857,-324.921 329.578,-280.126"/>
+<polygon fill="black" stroke="black" points="333.082,-280.166 330.195,-269.973 326.095,-279.742 333.082,-280.166"/>
 </g>
 <!-- Cgo_r_Spy -->
-<g id="node14" class="node"><title>Cgo_r_Spy</title>
-<ellipse fill="none" stroke="black" cx="459.242" cy="-378" rx="61.99" ry="18"/>
-<text text-anchor="start" x="419.742" y="-375.3" font-family="Times,serif" font-size="14.00">C</text>
-<text text-anchor="start" x="429.742" y="-375.3" font-family="Times,serif" baseline-shift="sub" font-size="14.00">go</text>
-<text text-anchor="start" x="442.742" y="-375.3" font-family="Times,serif" font-size="14.00"> &#160;read S</text>
-<text text-anchor="start" x="485.742" y="-375.3" font-family="Times,serif" baseline-shift="sub" font-size="14.00">py</text>
+<g id="node21" class="node"><title>Cgo_r_Spy</title>
+<ellipse fill="lightyellow" stroke="black" cx="459.242" cy="-467.74" rx="61.99" ry="18"/>
+<text text-anchor="start" x="419.742" y="-465.04" font-family="Times,serif" font-size="14.00">C</text>
+<text text-anchor="start" x="429.742" y="-465.04" font-family="Times,serif" baseline-shift="sub" font-size="14.00">go</text>
+<text text-anchor="start" x="442.742" y="-465.04" font-family="Times,serif" font-size="14.00"> &#160;read S</text>
+<text text-anchor="start" x="485.742" y="-465.04" font-family="Times,serif" baseline-shift="sub" font-size="14.00">py</text>
 </g>
 <!-- Cgo_r_Spy&#45;&gt;Cgo -->
-<g id="edge16" class="edge"><title>Cgo_r_Spy&#45;&gt;Cgo</title>
-<path fill="none" stroke="black" d="M448.833,-360.055C443.559,-351.469 437.058,-340.888 431.254,-331.439"/>
-<polygon fill="black" stroke="black" points="434.182,-329.518 425.965,-322.829 428.217,-333.182 434.182,-329.518"/>
+<g id="edge23" class="edge"><title>Cgo_r_Spy&#45;&gt;Cgo</title>
+<path fill="none" stroke="black" d="M448.833,-449.795C443.559,-441.209 437.058,-430.628 431.254,-421.179"/>
+<polygon fill="black" stroke="black" points="434.182,-419.258 425.965,-412.57 428.217,-422.922 434.182,-419.258"/>
 </g>
 <!-- Cleanup -->
-<g id="node15" class="node"><title>Cleanup</title>
-<ellipse fill="none" stroke="black" cx="606.242" cy="-378" rx="66.8882" ry="18"/>
-<text text-anchor="middle" x="606.242" y="-374.3" font-family="Times,serif" font-size="14.00">Cleanup history</text>
+<g id="node22" class="node"><title>Cleanup</title>
+<ellipse fill="none" stroke="black" cx="606.242" cy="-467.74" rx="66.8882" ry="18"/>
+<text text-anchor="middle" x="606.242" y="-464.04" font-family="Times,serif" font-size="14.00">Cleanup history</text>
+</g>
+<!-- Post -->
+<g id="node23" class="node"><title>Post</title>
+<ellipse fill="none" stroke="black" cx="718.242" cy="-467.74" rx="27" ry="18"/>
+<text text-anchor="middle" x="718.242" y="-464.04" font-family="Times,serif" font-size="14.00">Post</text>
 </g>
 </g>
 </svg>
-- 
2.30.9