> On Mon, Oct 26, 2015 at 8:46 AM, Michael McConville <mm...@mykolab.com> wrote: > > We have a pretty strong guarantee that it can only happen once per > > process... > ... > > --- sys/sys/syscall_mi.h 9 Oct 2015 01:17:18 -0000 1.11 > > +++ sys/sys/syscall_mi.h 26 Oct 2015 15:13:44 -0000 > > @@ -72,7 +72,8 @@ mi_syscall(struct proc *p, register_t co > > if (lock) > > KERNEL_LOCK(); > > pledged = (p->p_p->ps_flags & PS_PLEDGE); > > - if (pledged && !(tval = pledge_check(p, code))) { > > + if (__predict_false( > > + pledged && !(tval = pledge_check(p, code)))) { > > I disagree. That's the code used on every syscall, not just once per > process and pledged is true for *most* of the processes on a -current > box. No, that doesn't mean we should do __predict_true() there.
I have no idea what it will do on all our platforms. > In general, __predict_{true,false} should be left in the tool box and > only pulled out after detailed dives into code paths involved. For > all my banging on the project, I think I've used them in *two* places. I suspect there is more benefit to be gained through actual tested refactoring (with assumption: systrace is almost never used).