From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Paris Subject: Re: [PATCH] Audit: EINTR instead of kernel private return codes in audit records Date: Wed, 14 Nov 2007 16:07:42 -0500 Message-ID: <1195074462.2924.46.camel@localhost.localdomain> References: <1195071728.2924.40.camel@localhost.localdomain> <200711141530.56256.sgrubb@redhat.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <200711141530.56256.sgrubb@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: Steve Grubb Cc: linux-audit@redhat.com, pmoore@hp.com List-Id: linux-audit@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