Page MenuHomeFreeBSD

pipe: Avoid unnecessary priv_check() calls in pipespace_new()
ClosedPublic

Authored by markj on Feb 19 2026, 5:01 PM.
Tags
None
Referenced Files
F166375779: D55378.diff
Thu, Aug 13, 6:00 AM
F166333392: D55378.id172388.diff
Wed, Aug 12, 11:35 PM
F166313641: D55378.id172388.diff
Wed, Aug 12, 8:30 PM
F166303615: D55378.id.diff
Wed, Aug 12, 6:53 PM
Unknown Object (File)
Tue, Aug 11, 10:20 AM
Unknown Object (File)
Tue, Aug 11, 9:54 AM
Unknown Object (File)
Tue, Aug 11, 9:53 AM
Unknown Object (File)
Mon, Aug 10, 12:07 PM
Subscribers

Details

Summary

Running out of pipe map KVA is a rare case, so reorder checks
accordingly, presuming that calling priv_check() is more expensive than
the calculation. We might further consider precomputing
maxpipekva / 100 at boot time to avoid the division here.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

You could divide by 128 if this is so important.

Could you please explain the motivation for the changes?

This revision is now accepted and ready to land.Feb 19 2026, 5:37 PM
In D55378#1266686, @kib wrote:

You could divide by 128 if this is so important.

Could you please explain the motivation for the changes?

I was looking at sources of frequent priv_check() calls from unprivileged processes, trying to see if any are avoidable. These calls might do some non-trivial work if MAC hooks are installed.

In D55378#1266686, @kib wrote:

You could divide by 128 if this is so important.

Could you please explain the motivation for the changes?

I was looking at sources of frequent priv_check() calls from unprivileged processes, trying to see if any are avoidable. These calls might do some non-trivial work if MAC hooks are installed.

Add the last sentence to the messages?