On Wed, 2007-11-14 at 15:30 -0500, Steve Grubb wrote:
On Wednesday 14 November 2007 15:22:08 Eric Paris wrote:
> + if (unlikely((return_code == -ERESTART_RESTARTBLOCK) ||
> + (return_code == -ERESTARTNOHAND) ||
> + (return_code == -ERESTARTSYS) ||
> + (return_code == -ERESTARTNOINTR)))
Would it be more efficient to say:
if (unlikely(return_code <= -ERESTARTSYS &&
return_code >= -ERESTART_RESTARTBLOCK))
That gets it down to 2 compares and 1 logical op.
-Steve
It should be slightly faster (although already on the unlikely() path so
we are tuning the highly unlikely bad perf path anyway, remember by
default linux restarts syscalls when receiving a signal and I don't know
how many people actually change this)
We would also be picking up ENOIOCTLCMD but that shoudln't be seen on
this code path, so I guess it doesn't matter.
Al, thoughts?
-Eric