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