From: Mateusz Guzik <mjguzik@gmail.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: brauner@kernel.org, akpm@linux-foundation.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
"Eric W. Biederman" <ebiederm@xmission.com>
Subject: Re: [PATCH v2] exit: perform randomness and pid work without tasklist_lock
Date: Thu, 30 Jan 2025 12:01:05 +0100 [thread overview]
Message-ID: <CAGudoHEFoM0BaA+CVfuVgR5MGE9mmsWhu-gMaE3-iRcwBvvcDQ@mail.gmail.com> (raw)
In-Reply-To: <20250128192224.GD24845@redhat.com>
On Tue, Jan 28, 2025 at 8:22 PM Oleg Nesterov <oleg@redhat.com> wrote:
>
> On 01/28, Mateusz Guzik wrote:
> >
> > On Tue, Jan 28, 2025 at 7:30 PM Oleg Nesterov <oleg@redhat.com> wrote:
> > >
> > no problem, will send a v3 provided there are no issues reported
> > concerning the pid stuff
>
> Great, thanks.
>
> BTW, I didn't look at the pid stuff yet, I _feel_ that this can be simplified
> too, but I am already sleeping, most probably I am wrong.
>
I looked at pid code apart from the issue at hand.
It the lock protecting it uses irq disablement to guard against
tasklist_lock users coming from an interrupt.
AFAICS this can be legally arranged so that the pidmap_lock is *never*
taken while tasklist_lock is held.
so far the problematic ordering only stems from free_pid calls (not
only on exit), which can all be moved out.
this will reduce total tasklist_lock hold time *and* whack the irq
trip, speeding this up single-threaded
I'll hack it up when I get around to it, maybe this week.
btw, with the current patch when rolling with highly parallel thread
creation/destruction it is pidmap_lock which is the main bottleneck
instead of tasklist_lock
--
Mateusz Guzik <mjguzik gmail.com>
next prev parent reply other threads:[~2025-01-30 11:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-28 16:07 Mateusz Guzik
2025-01-28 18:29 ` Oleg Nesterov
2025-01-28 18:38 ` Mateusz Guzik
2025-01-28 19:22 ` Oleg Nesterov
2025-01-30 11:01 ` Mateusz Guzik [this message]
2025-01-31 20:55 ` Eric W. Biederman
2025-01-31 22:31 ` Mateusz Guzik
2025-01-31 23:09 ` Eric W. Biederman
2025-02-01 14:03 ` Mateusz Guzik
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=CAGudoHEFoM0BaA+CVfuVgR5MGE9mmsWhu-gMaE3-iRcwBvvcDQ@mail.gmail.com \
--to=mjguzik@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=ebiederm@xmission.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=oleg@redhat.com \
/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