public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "andres at anarazel dot de" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug nptl/29029] poll() spuriously returns EINTR during thread cancellation and with cancellation disabled
Date: Wed, 21 Jun 2023 03:00:05 +0000	[thread overview]
Message-ID: <bug-29029-131-MyHLXdbM1J@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-29029-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=29029

Andres Freund <andres at anarazel dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andres at anarazel dot de

--- Comment #9 from Andres Freund <andres at anarazel dot de> ---
FWIW, the fix / revert (404656009b) seems to have lead to a noticeable
performance regression.

Comparing a process and a single thread doing 10M, on a "Intel(R) Xeon(R) Gold
5215 CPU @ 2.50GHz", I measured:
1) pread()s of 4096 bytes of data
2) close(-1)

glibc commit 404656009b:
testing without threads, performing 10000000 syscalls
        pread() via libc: 3035.157 ms
        pread() via syscall(): 3048.916 ms
        close(-1) via libc: 993.145 ms
        close(-1) via syscall(): 993.274 ms
testing with 1 threads, performing 10000000 syscalls each
        pread() via libc: 3400.858 ms
        pread() via syscall(): 3135.069 ms
        close(-1) via libc: 1203.851 ms
        close(-1) via syscall(): 996.809 ms

glibc commit 2376944b9e:
testing without threads, performing 10000000 syscalls
        pread() via libc: 3048.536 ms
        pread() via syscall(): 3049.653 ms
        close(-1) via libc: 968.820 ms
        close(-1) via syscall(): 950.485 ms
testing with 1 threads, performing 10000000 syscalls each
        pread() via libc: 3203.544 ms
        pread() via syscall(): 3142.467 ms
        close(-1) via libc: 1020.983 ms
        close(-1) via syscall(): 953.038 ms

To reduce variability this was run with turbo mode disabled and the test pinned
to an otherwise unused core and were run against both glibc in sequence,
without a reboot inbetween, with a few repetitions.

Looking at a profile it's obvious that the difference primarily is from
__GI___pthread_disable_asynccancel() and __GI___pthread_enable_asynccancel().
There's also some difference in kernel overhead, but that obviously applies to
both glibc versions.

It's one thing for something as pointless as close(-1) to regress ~18%, but the
fact that this also regresses workloads doing useful, non-trivial syscalls,
like pread() by ~5% seems worrisome.  

I have been seeing __GI___pthread_disable_asynccancel etc in more an more
production profiles for a while and finally spent the time analyzing the issue.


Do you want me to create a new issue or leave it just here?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2023-06-21  3:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-05 21:32 [Bug nptl/29029] New: " aurelien at aurel32 dot net
2022-04-05 22:28 ` [Bug nptl/29029] " adhemerval.zanella at linaro dot org
2022-04-06 13:27 ` fweimer at redhat dot com
2022-04-06 13:31 ` fweimer at redhat dot com
2022-04-06 14:38 ` adhemerval.zanella at linaro dot org
2022-04-06 14:41 ` fweimer at redhat dot com
2022-04-06 14:46 ` adhemerval.zanella at linaro dot org
2022-04-06 15:28 ` adhemerval.zanella at linaro dot org
2022-04-14 18:43 ` adhemerval.zanella at linaro dot org
2023-06-21  3:00 ` andres at anarazel dot de [this message]
2023-06-21 14:25 ` adhemerval.zanella at linaro dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-29029-131-MyHLXdbM1J@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).