Page MenuHomeFreeBSD

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

Authored by markj on Thu, Feb 19, 5:01 PM.
Tags
None
Referenced Files
F145905499: D55378.diff
Thu, Feb 26, 12:16 AM
Unknown Object (File)
Tue, Feb 24, 9:26 PM
Unknown Object (File)
Tue, Feb 24, 7:46 PM
Unknown Object (File)
Tue, Feb 24, 7:45 PM
Unknown Object (File)
Mon, Feb 23, 9:57 PM
Unknown Object (File)
Mon, Feb 23, 9:57 PM
Unknown Object (File)
Mon, Feb 23, 9:57 PM
Unknown Object (File)
Mon, Feb 23, 9:56 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 70785
Build 67668: arc lint + arc unit

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.Thu, Feb 19, 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?