From: Eric Paris <eparis@redhat.com>
To: Steve Grubb <sgrubb@redhat.com>
Cc: linux-audit@redhat.com, pmoore@hp.com
Subject: Re: [PATCH] Audit: EINTR instead of kernel private return codes in audit records
Date: Wed, 14 Nov 2007 16:07:42 -0500 [thread overview]
Message-ID: <1195074462.2924.46.camel@localhost.localdomain> (raw)
In-Reply-To: <200711141530.56256.sgrubb@redhat.com>
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
next prev parent reply other threads:[~2007-11-14 21:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-14 20:22 [PATCH] Audit: EINTR instead of kernel private return codes in audit records Eric Paris
2007-11-14 20:29 ` Paul Moore
2007-11-14 20:30 ` Steve Grubb
2007-11-14 21:07 ` Eric Paris [this message]
2007-11-14 21:17 ` Steve Grubb
2007-11-18 1:58 ` Eric Paris
2007-11-18 10:58 ` Steve Grubb
2007-11-18 16:52 ` Eric Paris
2007-11-14 21:13 ` Miloslav Trmac
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1195074462.2924.46.camel@localhost.localdomain \
--to=eparis@redhat.com \
--cc=linux-audit@redhat.com \
--cc=pmoore@hp.com \
--cc=sgrubb@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox