teknoraver / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone

Blame SOURCES/0073-Remove-the-cap-on-epoll-events.patch

923a60
From f5ce5e24f9cf18a37ef6aedb149891d07767b045 Mon Sep 17 00:00:00 2001
923a60
From: Hannes Reinecke <hare@suse.de>
923a60
Date: Wed, 4 Mar 2015 16:32:16 +0100
923a60
Subject: [PATCH] Remove the cap on epoll events
923a60
923a60
Currently the code will silently blank out events if there are more
923a60
then 512 epoll events, causing them never to be handled at all. This
923a60
patch removes the cap on the number of events for epoll_wait, thereby
923a60
avoiding this issue.
923a60
923a60
(cherry picked from commit 1c724e9e0ec5bc4bf791a3d7b1cf5b955cdb98b2)
923a60
---
923a60
 src/libsystemd/sd-event/sd-event.c | 3 +--
923a60
 1 file changed, 1 insertion(+), 2 deletions(-)
923a60
923a60
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
923a60
index 25089a0335..c6350be9f4 100644
923a60
--- a/src/libsystemd/sd-event/sd-event.c
923a60
+++ b/src/libsystemd/sd-event/sd-event.c
923a60
@@ -37,7 +37,6 @@
923a60
 
923a60
 #include "sd-event.h"
923a60
 
923a60
-#define EPOLL_QUEUE_MAX 512U
923a60
 #define DEFAULT_ACCURACY_USEC (250 * USEC_PER_MSEC)
923a60
 
923a60
 typedef enum EventSourceType {
923a60
@@ -2367,7 +2366,7 @@ _public_ int sd_event_wait(sd_event *e, uint64_t timeout) {
923a60
                 return 1;
923a60
         }
923a60
 
923a60
-        ev_queue_max = CLAMP(e->n_sources, 1U, EPOLL_QUEUE_MAX);
923a60
+        ev_queue_max = MAX(e->n_sources, 1u);
923a60
         ev_queue = newa(struct epoll_event, ev_queue_max);
923a60
 
923a60
         m = epoll_wait(e->epoll_fd, ev_queue, ev_queue_max,