提交 16f6458f 编写于 作者: W Willem de Bruijn 提交者: David S. Miller

selftests/net: relax cpu affinity requirement in msg_zerocopy test

The msg_zerocopy test pins the sender and receiver threads to separate
cores to reduce variance between runs.

But it hardcodes the cores and skips core 0, so it fails on machines
with the selected cores offline, or simply fewer cores.

The test mainly gives code coverage in automated runs. The throughput
of zerocopy ('-z') and non-zerocopy runs is logged for manual
inspection.

Continue even when sched_setaffinity fails. Just log to warn anyone
interpreting the data.

Fixes: 07b65c5b ("test: add msg_zerocopy test")
Reported-by: NColin Ian King <colin.king@canonical.com>
Signed-off-by: NWillem de Bruijn <willemb@google.com>
Acked-by: NColin Ian King <colin.king@canonical.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 adf73410
......@@ -125,9 +125,8 @@ static int do_setcpu(int cpu)
CPU_ZERO(&mask);
CPU_SET(cpu, &mask);
if (sched_setaffinity(0, sizeof(mask), &mask))
error(1, 0, "setaffinity %d", cpu);
if (cfg_verbose)
fprintf(stderr, "cpu: unable to pin, may increase variance.\n");
else if (cfg_verbose)
fprintf(stderr, "cpu: %u\n", cpu);
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册