LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

Re: [rfc 10/13] [RFC 10/13] IPVS: management of persistence engine modul

To: Stephen Hemminger <shemminger@xxxxxxxxxx>
Subject: Re: [rfc 10/13] [RFC 10/13] IPVS: management of persistence engine modules
Cc: lvs-devel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, netfilter@xxxxxxxxxxxxxxx, netfilter-devel@xxxxxxxxxxxxxxx, Wensong Zhang <wensong@xxxxxxxxxxxx>, Julian Anastasov <ja@xxxxxx>, Patrick McHardy <kaber@xxxxxxxxx>
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Fri, 6 Aug 2010 10:48:44 +0900
On Thu, Aug 05, 2010 at 09:29:20AM -0700, Stephen Hemminger wrote:
> On Thu, 05 Aug 2010 20:48:05 +0900
> Simon Horman <horms@xxxxxxxxxxxx> wrote:
> 
> > +/* lock for service table */
> > +static DEFINE_RWLOCK(__ip_vs_pe_lock);
> 
> It is already static so why the __?
> Reader/writer locks are slower than spinlocks.  Either use
> a spinlock, or RCU (if possible)

No good reason, other than I copied the code from elsewhere.
I'll fix both this and the code that I copied.

> > +/* Bind a service with a pe */
> > +void ip_vs_bind_pe(struct ip_vs_service *svc, struct ip_vs_pe *pe)
> > +{
> > +   svc->pe = pe;
> > +}
> > +
> > +/* Unbind a service from its pe */
> > +void ip_vs_unbind_pe(struct ip_vs_service *svc)
> > +{
> > +   svc->pe = NULL;
> > +}
> 
> What does having these wrappers buy?

Again, I copied the code from elsewhere, where the wrappers did more.  As
it happens, I think that these do make some sense as they are called along
side other bind and unbind calls. But if you have a strong aversion to them
then I am happy to remove these wrappers.
--
To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

<Prev in Thread] Current Thread [Next in Thread>