tech-kern archive

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

Re: Syscall kill(2) called for a zombie process should return 0



> +                     if (p != NULL && P_ZOMBIE(p)) {
> +                             mutex_exit(proc_lock);
> +                             return 0;
> +                     }
>                       mutex_exit(proc_lock);
>                       return ESRCH;

> This is a general question, not necessarily specific to the patch.
> Which is more costly?  Two function calls as above, or storing the
> return value in a variable to return with just one function call to
> mutex_exit?

"It depends."  A good optimizer could turn either one into the other,
so it may make no real difference.  If optimization is disabled or
limited, the version quoted above will probably be marginally larger
and, assuming "larger code" doesn't mean more cache line fills,
marginally faster.  Which is `more costly' depends on what costs you
care about and to what extent.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                mouse%rodents-montreal.org@localhost
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index