All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Banks <gnb@sgi.com>
To: Neil Brown <neilb@suse.de>
Cc: Linux NFS Mailing List <nfs@lists.sourceforge.net>
Subject: Re: [PATCH 7/8] knfsd: repcache: faster hash chain probe
Date: Mon, 16 Oct 2006 21:02:08 +1000	[thread overview]
Message-ID: <20061016110208.GE8568@sgi.com> (raw)
In-Reply-To: <17714.61390.225292.840864@cse.unsw.edu.au>

On Mon, Oct 16, 2006 at 12:34:54PM +1000, Neil Brown wrote:
> On Wednesday October 11, gnb@melbourne.sgi.com wrote:
> > knfsd: Squeeze some small performance improvements out of the duplicate
> > request cache's lookup function by reducing the number of instructions
> > to compare each entry during hash chain probing.
> > 
> > Comparisons such as the RPC protocol number and version which are going
> > to be the same for almost all entries are now done last.  Comparisons
> > such as xid and client IP address which are more likely to differ
> > between entries are done first.  The client IP address comparison
> > is fixed not to compare 8 bytes of zeroes and to do comparisons as
> > 32b quantities.  Finally, a 32b addition for the timestamp is removed
> > from the loop by taking advantage of a loop invariant.
> 
> And yet:
> 
> > +static inline int
> > +compare_sockaddr_in(const struct sockaddr_in *sina, const struct sockaddr_in *sinb)
> > +{
> > +	return ((*(u32 *)&sina->sin_family == *(u32 *)&sinb->sin_family) &&
> > +		(sina->sin_addr.s_addr == sinb->sin_addr.s_addr));
> > +}
> > +
> 
> You compare family and port before address.... I suspect you would
> find the port is the same between clients more often than the address.

Excellent point, I'll fix that.

> Is there a reason?

Not one that I'd want to defend ;-)

Greg.
-- 
Greg Banks, R&D Software Engineer, SGI Australian Software Group.
I don't speak for SGI.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

      reply	other threads:[~2006-10-16 11:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-11 11:29 [PATCH 7/8] knfsd: repcache: faster hash chain probe Greg Banks
2006-10-16  2:34 ` Neil Brown
2006-10-16 11:02   ` Greg Banks [this message]

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=20061016110208.GE8568@sgi.com \
    --to=gnb@sgi.com \
    --cc=neilb@suse.de \
    --cc=nfs@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.