Skip to content
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

executor: slow network device initialization #4462

Open
a-nogikh opened this issue Jan 24, 2024 · 0 comments
Open

executor: slow network device initialization #4462

a-nogikh opened this issue Jan 24, 2024 · 0 comments
Labels

Comments

@a-nogikh
Copy link
Collaborator

When executor restarts are frequent, we're observing increased executor startup times.

Some observations:

  • We spend ~4 seconds here. This time is stable and does not depend on the number of procs.

write_file("/sys/bus/netdevsim/del_device", "%u", addr);

I wonder if it can be replaced with a DEVLINK_CMD_RELOAD command.

In general, I've found little to nothing documentation about netdevsim, which does not make things easier.

  • We spend from 1 to 10 seconds here. It's very quick when procs=1 and gets 1-2 seconds slower with every extra proc.

static void initialize_netdevices(void)

Most time is spent here:

for (i = 0; i < sizeof(devices) / (sizeof(devices[0])); i++) {
// Assign some unique address to devices. Some devices won't up without this.
// Shift addresses by 10 because 0 subnet address can mean special things.
char addr[32];
sprintf(addr, DEV_IPV4, i + 10);
netlink_add_addr4(&nlmsg, sock, devices[i].name, addr);
if (!devices[i].noipv6) {
sprintf(addr, DEV_IPV6, i + 10);
netlink_add_addr6(&nlmsg, sock, devices[i].name, addr);
}
uint64 macaddr = DEV_MAC + ((i + 10ull) << 40);
netlink_device_change(&nlmsg, sock, devices[i].name, true, 0, &macaddr, devices[i].macsize, NULL);
}

Note To get these observations under -debug, we need to remove setting procs=1 in the debug mode:

if *flagDebug {
fuzzerV = 100
procs = 1
}

@a-nogikh a-nogikh added the bug label Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant