From: "H.J. Lu" <hjl.tools@gmail.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: "H.J. Lu via Libc-alpha" <libc-alpha@sourceware.org>
Subject: Re: [PATCH] __check_pf: Add a cancellation cleanup handler [BZ #20975]
Date: Fri, 28 Apr 2023 08:33:19 -0700 [thread overview]
Message-ID: <CAMe9rOrE-XEfvj7wo8JbMBS_ru6-syF=ScCL_JsgQVgDryGing@mail.gmail.com> (raw)
In-Reply-To: <87sfck9zas.fsf@oldenburg.str.redhat.com>
On Fri, Apr 28, 2023 at 1:38 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * H. J. Lu via Libc-alpha:
>
> > There are reports for hang in __check_pf:
> >
> > https://github.com/JoeDog/siege/issues/4
> >
> > It is reproducible only under specific configurations:
> >
> > 1. Large number of cores (>= 64) and large number of threads (> 3X of
> > the number of cores) with long lived socket connection.
> > 2. Low power (frequency) mode.
> > 3. Power management is enabled.
> >
> > While holding lock, __check_pf calls make_request which calls __sendto
> > and __recvmsg. Since __sendto and __recvmsg are cancellation points,
> > lock held by __check_pf won't be released and can cause deadlock when
> > thread cancellation happens in __sendto or __recvmsg. Add a cancellation
> > cleanup handler for __check_pf to unlock the lock when cancelled by
> > another thread. This fixes BZ #20975 and the siege hang issue.
>
> It's probably easier to reproduce if the system has many network
> interfaces with lots of addresses.
>
> Doesn't getaddrinfo leak all kind of resources when canceled? That's
> more difficult to fix, though.
We will work on it if there are reports.
--
H.J.
next prev parent reply other threads:[~2023-04-28 15:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-27 20:06 H.J. Lu
2023-04-27 20:42 ` Noah Goldstein
2023-04-27 20:59 ` H.J. Lu
2023-04-27 21:44 ` Noah Goldstein
2023-04-27 21:50 ` H.J. Lu
2023-04-27 22:03 ` Noah Goldstein
2023-04-27 22:10 ` H.J. Lu
2023-04-28 8:38 ` Florian Weimer
2023-04-28 15:33 ` H.J. Lu [this message]
2023-04-28 19:17 ` Noah Goldstein
2023-05-22 20:37 ` H.J. Lu
2023-05-23 8:58 ` Florian Weimer
2023-05-23 16:56 ` Noah Goldstein
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='CAMe9rOrE-XEfvj7wo8JbMBS_ru6-syF=ScCL_JsgQVgDryGing@mail.gmail.com' \
--to=hjl.tools@gmail.com \
--cc=fweimer@redhat.com \
--cc=libc-alpha@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).