All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Eric W. Biederman" <ebiederm@xmission.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Eric Dumazet <edumazet@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Waiman Long <longman@redhat.com>,
	Shakeel Butt <shakeelb@google.com>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@redhat.com>, Boqun Feng <boqun.feng@gmail.com>,
	Will Deacon <will@kernel.org>, Roman Penyaev <rpenyaev@suse.de>
Subject: Re: [PATCH] locking/rwlocks: do not starve writers
Date: Tue, 21 Jun 2022 11:55:33 -0500	[thread overview]
Message-ID: <87tu8eez22.fsf@email.froward.int.ebiederm.org> (raw)
In-Reply-To: <CAHk-=wiEZmzBUFkZkBrJv3JSJkQ+qxaMZU_Sx1WTpMHs2SOAiQ@mail.gmail.com> (Linus Torvalds's message of "Fri, 17 Jun 2022 14:48:08 -0500")

Linus Torvalds <torvalds@linux-foundation.org> writes:

> On Fri, Jun 17, 2022 at 2:39 PM Eric Dumazet <edumazet@google.com> wrote:
>>
>> I am converting RAW sockets to RCU.
>
> RCU is usually absolutely the best approach. Use regular spinlocks for
> writers, and RCU for readers.
>
> I'd love to see the tasklist_lock be converted to RCU too.  But that
> locks predates RCU (and probably 99% of all kernel code), and it's
> messy, so nobody sane has ever willingly tried to do that afaik.

Well sort of.  I converted proc many many years ago.

Like Peter mentioned the big obvious challenge for converting
signal delivery to something else is the atomic delivery aspect.

I am playing with it, and I think I see how to convert signal delivery.
Something like a quick grab of lock that updates struct pid and creates
a list of signals are pending to be delivered.  Plus code that forces
clone to deliver the pending signal before clone creates a new task.

Plus something like a generation counter so I can see when pulling the
signal in clone if the signal has already been delivered.

I think tasks exiting before getting a signal is ok, and does not need
any code.


I have some patches that are almost working that can use siglock to
protect the parent/child/ptrace relation ship for SIGCHLD processing.
Which will remove the pressure on tasklist_lock when I get them sorted.


Not that any of this will kill tasklist_lock but with a little luck we
can get to short deterministic hold times.

Eric

  parent reply	other threads:[~2022-06-21 16:55 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-17  9:10 [PATCH] locking/rwlocks: do not starve writers Eric Dumazet
2022-06-17 12:07 ` Peter Zijlstra
2022-06-17 14:43   ` Waiman Long
2022-06-17 14:57     ` Shakeel Butt
2022-06-17 15:00       ` Waiman Long
2022-06-17 15:24         ` Eric Dumazet
2022-06-17 15:56           ` Peter Zijlstra
2022-06-17 17:41           ` Waiman Long
2022-06-17 17:45             ` Eric Dumazet
2022-06-17 18:57               ` Waiman Long
2022-06-18  8:43                 ` Hillf Danton
2022-06-17 19:04               ` Peter Zijlstra
2022-06-17 19:10                 ` Eric Dumazet
2022-06-17 19:19                   ` Linus Torvalds
2022-06-17 19:25                     ` Eric Dumazet
2022-06-17 19:34                       ` Linus Torvalds
2022-06-17 19:39                         ` Eric Dumazet
2022-06-17 19:48                           ` Linus Torvalds
2022-06-20  7:25                             ` Peter Zijlstra
2022-06-21 16:55                             ` Eric W. Biederman [this message]
2022-06-17 21:58                           ` David Laight
2022-06-17 19:34                     ` Shakeel Butt
2022-06-17 19:08               ` Linus Torvalds

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=87tu8eez22.fsf@email.froward.int.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=boqun.feng@gmail.com \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rpenyaev@suse.de \
    --cc=shakeelb@google.com \
    --cc=torvalds@linux-foundation.org \
    --cc=will@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.