Disable epoll_pwait2() in sd-event

This commit is contained in:
Yu Watanabe 2021-03-19 03:55:54 +09:00 committed by Yu Watanabe
parent a602ccade1
commit 98c9d9f8c5
3 changed files with 38 additions and 38 deletions

View File

@ -0,0 +1,35 @@
From 829e2b5cd552c5ea33a8ccc43e118ba87bbda206 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Fri, 19 Mar 2021 04:13:59 +0900
Subject: [PATCH] sd-event: do not use epoll_pwait2() tentatively
---
src/libsystemd/sd-event/sd-event.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
index 8f74b14101..14bed4f854 100644
--- a/src/libsystemd/sd-event/sd-event.c
+++ b/src/libsystemd/sd-event/sd-event.c
@@ -3808,8 +3808,9 @@ static int epoll_wait_usec(
int maxevents,
usec_t timeout) {
- static bool epoll_pwait2_absent = false;
int r, msec;
+#if 0
+ static bool epoll_pwait2_absent = false;
/* A wrapper that uses epoll_pwait2() if available, and falls back to epoll_wait() if not */
@@ -3829,6 +3830,7 @@ static int epoll_wait_usec(
epoll_pwait2_absent = true;
}
+#endif
if (timeout == USEC_INFINITY)
msec = -1;
--
2.30.2

View File

@ -1,36 +0,0 @@
From 2ad2a50a832140edfb49a95384e35bcf7a034acf Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Thu, 11 Mar 2021 21:49:44 +0100
Subject: [PATCH] syscall: disable epoll_pwait2() for now on 32bit
Alternative to #18973.
---
src/basic/missing_syscall.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/basic/missing_syscall.h b/src/basic/missing_syscall.h
index 13843248045..8bbe4d28847 100644
--- a/src/basic/missing_syscall.h
+++ b/src/basic/missing_syscall.h
@@ -407,6 +407,13 @@ static inline int missing_epoll_pwait2(
const sigset_t *sigset) {
# if defined(__NR_epoll_pwait2) && HAVE_LINUX_TIME_TYPES_H
+# if __SIZEOF_LONG__ == 4
+ /* Someone with an interest in 32bit systems, please have a look at this, and figure out why
+ * this hangs on 32bit systems. My educated guess: might be because of issues with the
+ * __kernel_timespec translation or because of incorrectly sized sigset_t array. */
+ errno = ENOSYS;
+ return -1;
+# else
if (timeout) {
/* Convert from userspace timespec to kernel timespec */
struct __kernel_timespec ts = {
@@ -417,6 +424,7 @@ static inline int missing_epoll_pwait2(
return syscall(__NR_epoll_pwait2, fd, events, maxevents, &ts, sigset, sigset ? KERNEL_NSIG_BYTES : 0);
} else
return syscall(__NR_epoll_pwait2, fd, events, maxevents, NULL, sigset, sigset ? KERNEL_NSIG_BYTES : 0);
+# endif
# else
errno = ENOSYS;
return -1;

View File

@ -71,8 +71,6 @@ GIT_DIR=../../src/systemd/.git git diffab -M v233..master@{2017-06-15} -- hwdb/[
%endif
# Backports of patches from upstream (00000499)
# https://github.com/systemd/systemd/pull/19042
Patch0502: https://github.com/systemd/systemd/pull/19042/commits/2ad2a50a832140edfb49a95384e35bcf7a034acf.patch
# Downstream-only patches (50009999)
# https://bugzilla.redhat.com/show_bug.cgi?id=1738828
@ -81,6 +79,9 @@ Patch0500: use-bfq-scheduler.patch
# https://github.com/systemd/systemd/pull/17050
Patch0501: https://github.com/systemd/systemd/pull/17050/commits/f58b96d3e8d1cb0dd3666bc74fa673918b586612.patch
# https://github.com/systemd/systemd/pull/18973
Patch0502: 0001-sd-event-do-not-use-epoll_pwait2-tentatively.patch
%ifarch %{ix86} x86_64 aarch64
%global have_gnu_efi 1
%endif