linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trond Myklebust <trondmy@gmail.com>
To: "J . Bruce Fields" <bfields@fieldses.org>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 08/15] NFS: Lockless DNS lookups
Date: Wed, 03 Oct 2018 13:55:28 -0400	[thread overview]
Message-ID: <363f1a9b29ebbd5ca77a1c9f21b656744e8e62c8.camel@gmail.com> (raw)
In-Reply-To: <20181003161055.GF17517@fieldses.org>

On Wed, 2018-10-03 at 12:10 -0400, J . Bruce Fields wrote:
> The individual conversions of these caches looks straightforward to
> me.
> Thanks for doing this in these small steps.  I'm assuming you're OK
> with
> these nfs/ changes going through the nfsd tree.
> 

Yes please. With the bulk of the changes being nfsd specific, that
makes more sense to me.

> --b.
> 
> On Mon, Oct 01, 2018 at 10:41:50AM -0400, Trond Myklebust wrote:
> > Enable RCU protected lookup in the legacy DNS resolver.
> > 
> > Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
> > ---
> >  fs/nfs/dns_resolve.c | 15 ++++++++++++---
> >  1 file changed, 12 insertions(+), 3 deletions(-)
> > 
> > diff --git a/fs/nfs/dns_resolve.c b/fs/nfs/dns_resolve.c
> > index 060c658eab66..e93a5dc07c8c 100644
> > --- a/fs/nfs/dns_resolve.c
> > +++ b/fs/nfs/dns_resolve.c
> > @@ -65,6 +65,7 @@ struct nfs_dns_ent {
> >  
> >  	struct sockaddr_storage addr;
> >  	size_t addrlen;
> > +	struct rcu_head rcu_head;
> >  };
> >  
> >  
> > @@ -101,15 +102,23 @@ static void nfs_dns_ent_init(struct
> > cache_head *cnew,
> >  	}
> >  }
> >  
> > -static void nfs_dns_ent_put(struct kref *ref)
> > +static void nfs_dns_ent_free_rcu(struct rcu_head *head)
> >  {
> >  	struct nfs_dns_ent *item;
> >  
> > -	item = container_of(ref, struct nfs_dns_ent, h.ref);
> > +	item = container_of(head, struct nfs_dns_ent, rcu_head);
> >  	kfree(item->hostname);
> >  	kfree(item);
> >  }
> >  
> > +static void nfs_dns_ent_put(struct kref *ref)
> > +{
> > +	struct nfs_dns_ent *item;
> > +
> > +	item = container_of(ref, struct nfs_dns_ent, h.ref);
> > +	call_rcu(item, nfs_dns_ent_free_rcu);
> > +}
> > +
> >  static struct cache_head *nfs_dns_ent_alloc(void)
> >  {
> >  	struct nfs_dns_ent *item = kmalloc(sizeof(*item), GFP_KERNEL);
> > @@ -195,7 +204,7 @@ static struct nfs_dns_ent
> > *nfs_dns_lookup(struct cache_detail *cd,
> >  {
> >  	struct cache_head *ch;
> >  
> > -	ch = sunrpc_cache_lookup(cd,
> > +	ch = sunrpc_cache_lookup_rcu(cd,
> >  			&key->h,
> >  			nfs_dns_hash(key));
> >  	if (!ch)
> > -- 
> > 2.17.1

  reply	other threads:[~2018-10-04  0:44 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-01 14:41 [PATCH 00/15] Performance improvements for knfsd Trond Myklebust
2018-10-01 14:41 ` [PATCH 01/15] SUNRPC: Remove the server 'authtab_lock' and just use RCU Trond Myklebust
2018-10-01 14:41   ` [PATCH 02/15] SUNRPC: Add lockless lookup of the server's auth domain Trond Myklebust
2018-10-01 14:41     ` [PATCH 03/15] SUNRPC: Allow cache lookups to use RCU protection rather than the r/w spinlock Trond Myklebust
2018-10-01 14:41       ` [PATCH 04/15] SUNRPC: Make server side AUTH_UNIX use lockless lookups Trond Myklebust
2018-10-01 14:41         ` [PATCH 05/15] knfsd: Allow lockless lookups of the exports Trond Myklebust
2018-10-01 14:41           ` [PATCH 06/15] SUNRPC: Lockless server RPCSEC_GSS context lookup Trond Myklebust
2018-10-01 14:41             ` [PATCH 07/15] knfsd: Lockless lookup of NFSv4 identities Trond Myklebust
2018-10-01 14:41               ` [PATCH 08/15] NFS: Lockless DNS lookups Trond Myklebust
2018-10-01 14:41                 ` [PATCH 09/15] SUNRPC: Remove non-RCU protected lookup Trond Myklebust
2018-10-01 14:41                   ` [PATCH 10/15] SUNRPC: Replace the cache_detail->hash_lock with a regular spinlock Trond Myklebust
2018-10-01 14:41                     ` [PATCH 11/15] SUNRPC: Simplify TCP receive code Trond Myklebust
2018-10-01 14:41                       ` [PATCH 12/15] knfsd: Remove dead code from nfsd_cache_lookup Trond Myklebust
2018-10-01 14:41                         ` [PATCH 13/15] knfsd: Simplify NFS duplicate replay cache Trond Myklebust
2018-10-01 14:41                           ` [PATCH 14/15] knfsd: Further simplify the cache lookup Trond Myklebust
2018-10-01 14:41                             ` [PATCH 15/15] knfsd: Improve lookup performance in the duplicate reply cache using an rbtree Trond Myklebust
2018-10-04  0:44                               ` J . Bruce Fields
2018-10-03 17:14                           ` [PATCH 13/15] knfsd: Simplify NFS duplicate replay cache J . Bruce Fields
2018-10-03 18:01                             ` Trond Myklebust
2018-10-03 18:11                               ` bfields
2018-10-03 23:51                                 ` bfields
2018-10-03 16:10                 ` [PATCH 08/15] NFS: Lockless DNS lookups J . Bruce Fields
2018-10-03 17:55                   ` Trond Myklebust [this message]
2018-10-03 16:08       ` [PATCH 03/15] SUNRPC: Allow cache lookups to use RCU protection rather than the r/w spinlock J . Bruce Fields
2018-10-02 19:39   ` [PATCH 01/15] SUNRPC: Remove the server 'authtab_lock' and just use RCU J . Bruce Fields
2018-10-01 15:29 ` [PATCH 00/15] Performance improvements for knfsd Trond Myklebust

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=363f1a9b29ebbd5ca77a1c9f21b656744e8e62c8.camel@gmail.com \
    --to=trondmy@gmail.com \
    --cc=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).