tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Logging a kernel message when blocking on entropy



On Tue, 22 Sep 2020, Taylor R Campbell wrote:

Date: Tue, 22 Sep 2020 13:07:04 +0300
From: Andreas Gustafsson <gson%gson.org@localhost>

The following patch will cause a kernel message to be logged when a
process blocks on /dev/random or some other randomness API.  It may
help some users befuddled by pkgsrc builds blocking on /dev/random,
and I'm finding it useful when testing changes aimed at fixing PR
55659.

OK to commit?

I think this is fine, but it should be rate-limited the same way other
messages in kern_entropy.c are rate-limited.

		if (ratecheck(&lasttime, &interval))
			printf("...");

Not sure if that's really necessary.  There's a maximum of one message
per thread - ever, and even if every thread on the machine blocks, the
limit on number of threads stops you at 32k messages.  As soon as one
thread un-blocks, nothing will ever block again, so that feels like a
hard limit.

Of course, since the rate-limiting code is already written, it wouldn't
hurt to use it.  I'm just pointing out that there's a natural limit
inherent in the code!

:)


+--------------------+--------------------------+-----------------------+
| Paul Goyette       | PGP Key fingerprint:     | E-mail addresses:     |
| (Retired)          | FA29 0E3B 35AF E8AE 6651 | paul%whooppee.com@localhost     |
| Software Developer | 0786 F758 55DE 53BA 7731 | pgoyette%netbsd.org@localhost   |
+--------------------+--------------------------+-----------------------+


Home | Main Index | Thread Index | Old Index