Skip to content

Commit

Permalink
Flush JIT traces after ctable resize
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandergall committed Mar 15, 2018
1 parent d4f8914 commit 30b1e6f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/apps/ipfix/ipfix.lua
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ function FlowSet:new (template, args)
key_type = template.key_t,
value_type = template.value_t,
max_occupancy_rate = 0.4,
resize_callback = function(table, old_size)
template.logger:log("resize flow cache "..old_size..
" -> "..table.size)
require('jit').flush()
end
}
if args.cache_size then
params.initial_size = math.ceil(args.cache_size / 0.4)
Expand Down
3 changes: 2 additions & 1 deletion src/apps/ipfix/template.lua
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ local function make_template_info(spec)
record_t = record_t,
record_ptr_t = ptr_to(record_t),
swap_fn = gen_swap_fn(),
match = pf.compile_filter(spec.filter)
match = pf.compile_filter(spec.filter),
logger = lib.logger_new({ module = "IPFIX template #"..spec.id })
}
end

Expand Down

0 comments on commit 30b1e6f

Please sign in to comment.