-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CONFIG_HZ matters ? : BBR with LKL #265
Comments
adding the following function to arch/lkl/kernel/time.c alleviates this issue.
for more detail in https://github.com/lkl/linux/blob/master/Documentation/timers/timekeeping.txt#L107 This will introduce more frequent calls of btw, printk also shows different timestamps started with non-zero value.
|
I can't observe any performance issue of it. According to the doc you refer to, sched_clock should start from 0? |
thanks.
thanks too; it should be like the following where boot_time will be set during time_init().
|
Fixed by #276. |
syzbot reported one use-after-free in pfifo_fast_enqueue() [1] Issue here is that we can not reuse skb after a successful skb_array_produce() since another cpu might have consumed it already. I believe a similar problem exists in try_bulk_dequeue_skb_slow() in case we put an skb into qdisc_enqueue_skb_bad_txq() for lockless qdisc. [1] BUG: KASAN: use-after-free in qdisc_pkt_len include/net/sch_generic.h:610 [inline] BUG: KASAN: use-after-free in qdisc_qstats_cpu_backlog_inc include/net/sch_generic.h:712 [inline] BUG: KASAN: use-after-free in pfifo_fast_enqueue+0x4bc/0x5e0 net/sched/sch_generic.c:639 Read of size 4 at addr ffff8801cede37e8 by task syzkaller717588/5543 CPU: 1 PID: 5543 Comm: syzkaller717588 Not tainted 4.16.0-rc4+ lkl#265 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x194/0x24d lib/dump_stack.c:53 print_address_description+0x73/0x250 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report+0x23c/0x360 mm/kasan/report.c:412 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432 qdisc_pkt_len include/net/sch_generic.h:610 [inline] qdisc_qstats_cpu_backlog_inc include/net/sch_generic.h:712 [inline] pfifo_fast_enqueue+0x4bc/0x5e0 net/sched/sch_generic.c:639 __dev_xmit_skb net/core/dev.c:3216 [inline] Fixes: c5ad119 ("net: sched: pfifo_fast use skb_array") Signed-off-by: Eric Dumazet <edumazet@google.com> Reported-by: syzbot+ed43b6903ab968b16f54@syzkaller.appspotmail.com Cc: John Fastabend <john.fastabend@gmail.com> Cc: Jamal Hadi Salim <jhs@mojatatu.com> Cc: Cong Wang <xiyou.wangcong@gmail.com> Cc: Jiri Pirko <jiri@resnulli.us> Acked-by: John Fastabend <john.fastabend@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Add a new test case which performs double query of the bpf_mprog through libbpf API, but also via raw bpf(2) syscall. This is testing to gather first the count and then in a subsequent probe the full information with the program array without clearing passed structs in between. # ./vmtest.sh -- ./test_progs -t tc_opts [...] ./test_progs -t tc_opts [ 1.398818] tsc: Refined TSC clocksource calibration: 3407.999 MHz [ 1.400263] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x311fd336761, max_idle_ns: 440795243819 ns [ 1.402734] clocksource: Switched to clocksource tsc [ 1.426639] bpf_testmod: loading out-of-tree module taints kernel. [ 1.428112] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel lkl#252 tc_opts_after:OK lkl#253 tc_opts_append:OK lkl#254 tc_opts_basic:OK lkl#255 tc_opts_before:OK lkl#256 tc_opts_chain_classic:OK lkl#257 tc_opts_chain_mixed:OK lkl#258 tc_opts_delete_empty:OK lkl#259 tc_opts_demixed:OK lkl#260 tc_opts_detach:OK lkl#261 tc_opts_detach_after:OK lkl#262 tc_opts_detach_before:OK lkl#263 tc_opts_dev_cleanup:OK lkl#264 tc_opts_invalid:OK lkl#265 tc_opts_max:OK lkl#266 tc_opts_mixed:OK lkl#267 tc_opts_prepend:OK lkl#268 tc_opts_query:OK <--- (new test) lkl#269 tc_opts_replace:OK lkl#270 tc_opts_revision:OK Summary: 19/0 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/r/20231006220655.1653-4-daniel@iogearbox.net Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Add a new test case to query on an empty bpf_mprog and pass the revision directly into expected_revision for attachment to assert that this does succeed. ./test_progs -t tc_opts [ 1.406778] tsc: Refined TSC clocksource calibration: 3407.990 MHz [ 1.408863] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x311fcaf6eb0, max_idle_ns: 440795321766 ns [ 1.412419] clocksource: Switched to clocksource tsc [ 1.428671] bpf_testmod: loading out-of-tree module taints kernel. [ 1.430260] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel lkl#252 tc_opts_after:OK lkl#253 tc_opts_append:OK lkl#254 tc_opts_basic:OK lkl#255 tc_opts_before:OK lkl#256 tc_opts_chain_classic:OK lkl#257 tc_opts_chain_mixed:OK lkl#258 tc_opts_delete_empty:OK lkl#259 tc_opts_demixed:OK lkl#260 tc_opts_detach:OK lkl#261 tc_opts_detach_after:OK lkl#262 tc_opts_detach_before:OK lkl#263 tc_opts_dev_cleanup:OK lkl#264 tc_opts_invalid:OK lkl#265 tc_opts_max:OK lkl#266 tc_opts_mixed:OK lkl#267 tc_opts_prepend:OK lkl#268 tc_opts_query:OK lkl#269 tc_opts_query_attach:OK <--- (new test) lkl#270 tc_opts_replace:OK lkl#271 tc_opts_revision:OK Summary: 20/0 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/r/20231006220655.1653-6-daniel@iogearbox.net Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
I'm playing with Google's new TCP cc flavor, BBR, with LKL and saw some odd behavior if CONFIG_HZ is 100.
(raw output: https://gist.github.com/thehajime/4efc5690bde1d1248087097a8635d31b)
though there is still more to investigate why this different number when HZ=1000, BBR seems to not be functioning if CONFIG_HZ=100.
I will separately check this BBR's number but was wondering if CONFIG_HZ=1000 makes sense to LKL or not.
tested with my tentative branch.
https://github.com/libos-nuse/lkl-linux/tree/bbr-linus-4.9-rc4
The text was updated successfully, but these errors were encountered: