sd-device-monitor: unconditionally increase buffer size by sd_device_monitor_new()

As suggested at https://github.com/systemd/systemd/pull/29872#discussion_r1382932633:
> socket memory is these days accounted to the process that owns a socket,
> hence we shouldn't be too concerned that this might waste memory.
This commit is contained in:
Yu Watanabe
2023-11-06 20:39:51 +09:00
parent 7dafeb6d6b
commit eba449fa81
7 changed files with 9 additions and 24 deletions
@@ -215,6 +215,15 @@ int device_monitor_new_full(sd_device_monitor **ret, MonitorNetlinkGroup group,
}
}
/* Let's bump the receive buffer size, but only if we are not called via socket activation, as in
* that case the service manager sets the receive buffer size for us, and the value in the .socket
* unit should take full effect. */
if (fd < 0) {
r = sd_device_monitor_set_receive_buffer_size(m, 128*1024*1024);
if (r < 0)
log_monitor_errno(m, r, "Failed to increase receive buffer size, ignoring: %m");
}
*ret = TAKE_PTR(m);
return 0;