The patch titled Subject: selftests/uffd: allow EINTR/EAGAIN has been added to the -mm tree. Its filename is selftests-uffd-allow-eintr-eagain.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/selftests-uffd-allow-eintr-eagain.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/selftests-uffd-allow-eintr-eagain.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Peter Xu <peterx@xxxxxxxxxx> Subject: selftests/uffd: allow EINTR/EAGAIN This allow test to continue with interruptions like gdb. Link: https://lkml.kernel.org/r/20211115135219.85881-1-peterx@xxxxxxxxxx Signed-off-by: Peter Xu <peterx@xxxxxxxxxx> Reviewed-by: Axel Rasmussen <axelrasmussen@xxxxxxxxxx> Cc: Andrea Arcangeli <aarcange@xxxxxxxxxx> Cc: Nadav Amit <nadav.amit@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- tools/testing/selftests/vm/userfaultfd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/tools/testing/selftests/vm/userfaultfd.c~selftests-uffd-allow-eintr-eagain +++ a/tools/testing/selftests/vm/userfaultfd.c @@ -644,7 +644,7 @@ static int uffd_read_msg(int ufd, struct if (ret != sizeof(*msg)) { if (ret < 0) { - if (errno == EAGAIN) + if (errno == EAGAIN || errno == EINTR) return 1; err("blocking read error"); } else { @@ -720,8 +720,11 @@ static void *uffd_poll_thread(void *arg) for (;;) { ret = poll(pollfd, 2, -1); - if (ret <= 0) + if (ret <= 0) { + if (errno == EINTR || errno == EAGAIN) + continue; err("poll error: %d", ret); + } if (pollfd[1].revents & POLLIN) { if (read(pollfd[1].fd, &tmp_chr, 1) != 1) err("read pipefd error"); _ Patches currently in -mm which might be from peterx@xxxxxxxxxx are selftests-uffd-allow-eintr-eagain.patch