svn commit: r338829 - head/sys/kern

Eric van Gyzen eric at vangyzen.net
Thu Sep 20 15:13:33 UTC 2018


On 9/20/18 8:32 AM, Mateusz Guzik wrote:
>    fd: prevent inlining of _fdrop thorough kern_descrip.c
>    
>    fdrop is used in several places in the file and almost never has to call
>    _fdrop. Thus inlining it is a pure waste of space.
>    

> -int
> +int __noinline
>   _fdrop(struct file *fp, struct thread *td)

I wonder if some compilers have an attribute for "cold" versus "hot" 
that would indicate that the function is called seldom versus often.  It 
could influence not only inlining, but also prediction of branches that 
lead to an unconditional call to it.

Eric


More information about the svn-src-head mailing list