From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: "Andy Lutomirski" <luto@amacapital.net>,
"Jonathan Neuschäfer" <j.neuschaefer@gmx.net>,
"Theodore Ts'o" <tytso@mit.edu>,
LKML <linux-kernel@vger.kernel.org>,
"Peter Zijlstra" <peterz@infradead.org>,
"Ingo Molnar" <mingo@redhat.com>, "Will Deacon" <will@kernel.org>,
"Waiman Long" <longman@redhat.com>,
"Boqun Feng" <boqun.feng@gmail.com>,
"Andy Lutomirski" <luto@kernel.org>,
stable <stable@vger.kernel.org>,
"Thomas Gleixner" <tglx@linutronix.de>
Subject: Re: [PATCH] random: remove batched entropy locking
Date: Fri, 28 Jan 2022 17:15:16 +0100 [thread overview]
Message-ID: <YfQWlM9b4l2IO43l@linutronix.de> (raw)
In-Reply-To: <CAHmME9pmdeLBKJbTaVQv-z9J81qKA=R4uoZ1DeXABy6Lt3bXuA@mail.gmail.com>
On 2022-01-28 16:54:06 [+0100], Jason A. Donenfeld wrote:
> Hi Sebastian,
Hi Jason,
> On Fri, Jan 28, 2022 at 4:44 PM Sebastian Andrzej Siewior
> <bigeasy@linutronix.de> wrote:
> > NO. Could we please look at my RANDOM patches first?
> > I can repost my rebased patched if there no objection.
>
> I did, and my reply is here:
> https://lore.kernel.org/lkml/CAHmME9pzdXyD0oRYyCoVUSqqsA9h03-oR7kcNhJuPEcEMTJYgw@mail.gmail.com/
>
> I was hoping for a series that addresses these issues. As I mentioned
> before, I'm not super keen on deferring that processing in a
> conditional case and having multiple entry ways into that same
> functionality. I don't think that's worth it, especially if your
> actual concern is just userspace calling RNDADDTOENTCNT too often
> (which can be safely ratelimited). I don't think that thread needs to
And what do you do in ratelimiting? As I explained, you get 20 that
"enter" and the following are block. The first 20 are already
problematic and you need a plan-B for those that can't enter.
So I suggested a mutex_t around the ioctl() which would act as a rate
limiting. You did not not follow up on that idea.
> spill over here, though, so feel free to follow up with a v+1 on that
> series and I'll happily take a look. Alternatively, if you'd like to
> approach this by providing a patch for Jonathan's issue, that makes
> sense too. So far, the things in front of me are: 1) your patchset
> from last month that has unresolved issues, and 2) Andy's thing, which
> maybe will solve the problem (or it won't?). A third alternative from
> you would be most welcome too.
I made a reply yesterday I think with some numbers yesterday. From my
point of view it is an in-IRQ context/ code that can be avoided. The
RNDADDTOENTCNT is a simple way to hammer on the lock and see how bad it
gets. Things like add_hwgenerator_randomness() don't appear so often so
it is hard to figure out what the worst case can be.
Please ignore Jonathan report for now. As I tried to explain: This
lockdep report shows a serious problem on PREEMPT_RT. There is _no_ need
to be concerned on a non-PREEMPT_RT kernel. But it should be addressed.
If this gets merged as-is then thanks to the stable tag it will get
backported (again no change for !RT) and will collide with PREEMPT_RT
patch. And as I mentioned, the locking is not working on PREEMPT_RT.
> Jason
Sebastian
next prev parent reply other threads:[~2022-01-28 16:15 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-27 22:21 "BUG: Invalid wait context" in invalidate_batched_entropy Jonathan Neuschäfer
2022-01-27 22:26 ` Jason A. Donenfeld
2022-01-28 8:34 ` Sebastian Andrzej Siewior
2022-01-28 16:04 ` Jason A. Donenfeld
2022-01-28 16:19 ` Sebastian Andrzej Siewior
2022-01-28 16:28 ` Jason A. Donenfeld
2022-01-28 17:02 ` Sebastian Andrzej Siewior
2022-01-28 15:33 ` [PATCH] random: remove batched entropy locking Jason A. Donenfeld
2022-01-28 15:44 ` Sebastian Andrzej Siewior
2022-01-28 15:54 ` Jason A. Donenfeld
2022-01-28 16:15 ` Sebastian Andrzej Siewior [this message]
2022-01-28 16:36 ` Jason A. Donenfeld
2022-01-28 15:48 ` Jason A. Donenfeld
2022-01-28 22:35 ` [PATCH v2] " Jason A. Donenfeld
2022-01-29 21:03 ` Jonathan Neuschäfer
2022-02-04 0:27 ` Jason A. Donenfeld
2022-02-04 11:10 ` Sebastian Andrzej Siewior
2022-02-04 13:42 ` Jason A. Donenfeld
2022-02-04 14:01 ` Sebastian Andrzej Siewior
2022-02-04 14:11 ` Jason A. Donenfeld
2022-02-04 14:30 ` Sebastian Andrzej Siewior
2022-02-04 15:39 ` Jason A. Donenfeld
2022-02-04 15:51 ` [PATCH v3] " Jason A. Donenfeld
2022-02-04 15:57 ` Sebastian Andrzej Siewior
2022-02-04 16:12 ` Jason A. Donenfeld
2022-02-16 20:01 ` Jann Horn
2022-02-16 20:58 ` Jason A. Donenfeld
2022-02-17 17:33 ` Sebastian Andrzej Siewior
2022-01-28 18:05 ` [PATCH] " Jonathan Neuschäfer
2022-01-29 18:22 ` Jason A. Donenfeld
2022-01-29 7:10 ` [random] 1e1724f9dd: UBSAN:array-index-out-of-bounds_in_drivers/char/random.c kernel test robot
2022-01-29 7:10 ` kernel test robot
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=YfQWlM9b4l2IO43l@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=Jason@zx2c4.com \
--cc=boqun.feng@gmail.com \
--cc=j.neuschaefer@gmx.net \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=luto@amacapital.net \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=tytso@mit.edu \
--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.