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:
@@ -1225,15 +1225,6 @@ int manager_init(Manager *manager, int fd_ctrl, int fd_uevent) {
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to initialize device monitor: %m");
|
||||
|
||||
/* Bump receiver buffer, but only if we are not called via socket activation, as in that
|
||||
* case systemd sets the receive buffer size for us, and the value in the .socket unit
|
||||
* should take full effect. */
|
||||
if (fd_uevent < 0) {
|
||||
r = sd_device_monitor_set_receive_buffer_size(manager->monitor, 128 * 1024 * 1024);
|
||||
if (r < 0)
|
||||
log_warning_errno(r, "Failed to set receive buffer size for device monitor, ignoring: %m");
|
||||
}
|
||||
|
||||
(void) sd_device_monitor_set_description(manager->monitor, "manager");
|
||||
|
||||
r = device_monitor_enable_receiving(manager->monitor);
|
||||
|
||||
@@ -66,8 +66,6 @@ static int setup_monitor(MonitorNetlinkGroup sender, sd_event *event, sd_device_
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to create netlink socket: %m");
|
||||
|
||||
(void) sd_device_monitor_set_receive_buffer_size(monitor, 128*1024*1024);
|
||||
|
||||
r = sd_device_monitor_attach_event(monitor, event);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to attach event: %m");
|
||||
|
||||
@@ -526,8 +526,6 @@ int trigger_main(int argc, char *argv[], void *userdata) {
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to create device monitor object: %m");
|
||||
|
||||
(void) sd_device_monitor_set_receive_buffer_size(m, 128*1024*1024);
|
||||
|
||||
r = sd_device_monitor_attach_event(m, event);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to attach event to device monitor: %m");
|
||||
|
||||
@@ -184,8 +184,6 @@ static int setup_monitor(sd_event *event, MonitorNetlinkGroup group, const char
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
(void) sd_device_monitor_set_receive_buffer_size(monitor, 128*1024*1024);
|
||||
|
||||
r = sd_device_monitor_attach_event(monitor, event);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user