-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge PR #1478 (Release 2022-06: Parmigiano) into master
- Loading branch information
Showing
75 changed files
with
6,029 additions
and
881 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2022.01 | ||
2022.07 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
-- Use of this source code is governed by the Apache 2.0 license; see COPYING. | ||
|
||
module(...,package.seeall) | ||
|
||
local histogram = require("core.histogram") | ||
local tsc = require("lib.tsc") | ||
|
||
function instrument_freelist () | ||
local ts = tsc.new() | ||
local rebalance_latency = histogram.create('engine/rebalance_latency.histogram', 1, 100e6) | ||
local reclaim_latency = histogram.create('engine/reclaim_latency.histogram', 1, 100e6) | ||
|
||
local rebalance_step, reclaim_step = packet.rebalance_step, packet.reclaim_step | ||
packet.rebalance_step = function () | ||
local start = ts:stamp() | ||
rebalance_step() | ||
rebalance_latency:add(tonumber(ts:to_ns(ts:stamp()-start))) | ||
end | ||
packet.reclaim_step = function () | ||
local start = ts:stamp() | ||
reclaim_step() | ||
reclaim_latency:add(tonumber(ts:to_ns(ts:stamp()-start))) | ||
end | ||
|
||
return rebalance_latency, reclaim_latency | ||
end | ||
|
||
function histogram_csv_header (out) | ||
out = out or io.stdout | ||
out:write("histogram,lo,hi,count\n") | ||
end | ||
|
||
function histogram_csv (histogram, name, out) | ||
out = out or io.stdout | ||
name = name or 'untitled' | ||
for count, lo, hi in histogram:iterate() do | ||
out:write(("%s,%f,%f,%d\n"):format(name, lo, hi, tonumber(count))) | ||
out:flush() | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
-- Use of this source code is governed by the Apache 2.0 license; see COPYING. | ||
|
||
module(...,package.seeall) | ||
|
||
local Receiver = require("apps.interlink.receiver") | ||
local Sink = require("apps.basic.basic_apps").Sink | ||
local lib = require("core.lib") | ||
local numa = require("lib.numa") | ||
|
||
function configure (c, name) | ||
config.app(c, name, Receiver) | ||
config.app(c, "sink", Sink) | ||
config.link(c, name..".output -> sink.input") | ||
end | ||
|
||
function start (name, duration) | ||
local c = config.new() | ||
configure(c, name) | ||
engine.configure(c) | ||
engine.main{duration=duration} | ||
end | ||
|
||
local instr = require("apps.interlink.freelist_instrument") | ||
|
||
function start_instrument (name, duration, core) | ||
numa.bind_to_cpu(core, 'skip') | ||
local rebalance_latency = instr.instrument_freelist() | ||
start(name, duration) | ||
instr.histogram_csv(rebalance_latency, "rebalance") | ||
local min, avg, max = rebalance_latency:summarize() | ||
io.stderr:write(("(%d) rebalance latency (ns) min:%16s avg:%16s max:%16s\n") | ||
:format(core, | ||
lib.comma_value(math.floor(min)), | ||
lib.comma_value(math.floor(avg)), | ||
lib.comma_value(math.floor(max)))) | ||
io.stderr:flush() | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!snabb snsh | ||
|
||
-- Use of this source code is governed by the Apache 2.0 license; see COPYING. | ||
|
||
local worker = require("core.worker") | ||
local numa = require("lib.numa") | ||
|
||
-- Test wait times caused by group freelist rebalancing | ||
-- Synopsis: wait_test.snabb [duration] [nconsumers] | ||
local DURATION = tonumber(main.parameters[1]) or 10 | ||
local NCONSUMERS = tonumber(main.parameters[2]) or 10 | ||
local CPUS = numa.parse_cpuset(main.parameters[3] or "") | ||
|
||
local cores = {} | ||
for core in pairs(CPUS) do | ||
table.insert(cores, core) | ||
table.sort(cores) | ||
end | ||
|
||
require("apps.interlink.freelist_instrument").histogram_csv_header() | ||
io.stdout:flush() | ||
|
||
for i=1,NCONSUMERS do | ||
worker.start("sink"..i, ([[require("apps.interlink.test_sink").start_instrument(%q, %d, %s)]]) | ||
:format("test"..i, DURATION, cores[1+i])) | ||
end | ||
|
||
worker.start("source", ([[require("apps.interlink.test_source").startn_instrument(%q, %d, %d, %s)]]) | ||
:format("test", DURATION, NCONSUMERS, assert(cores[1]))) | ||
|
||
engine.main{done = function () | ||
for w, s in pairs(worker.status()) do | ||
if s.alive then return false end | ||
end | ||
return true | ||
end} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.