Linux NFS development
 help / color / mirror / Atom feed
From: Benny Halevy <bhalevy@panasas.com>
To: Andy Adamson <andros@netapp.com>
Cc: "linux-nfs@vger.kernel.org Mailing list" <linux-nfs@vger.kernel.org>
Subject: Re: get_lock_alloc_layout
Date: Thu, 01 Jul 2010 17:11:08 +0300	[thread overview]
Message-ID: <4C2CA1FC.8060803@panasas.com> (raw)
In-Reply-To: <7B1AD6D8-4D7D-48B6-9439-7A1469784754@netapp.com>

On Jul. 01, 2010, 16:50 +0300, Andy Adamson <andros@netapp.com> wrote:
> Hi Benny
> 
> Why do we have the complexity of waiting on a bit lock for allocating  
> a layout? Why can't we use the normal form:

It's possible but the expectation was that the race here would
not be infrequent enough it's worth (statistically) losing it.

Benny

> 
> take the i_lock
> lookup layout
> if (layout == NULL) {
>          give up i_lock
>          allocate and init new layout
>                 return NULL if allocation fails
>          take the i_lock
>          lookup layout
>          if (layout == NULL)
>                  set new layout for return
>          else
>                  set found layout for return
> }
> give up i_lock
> if new was allocated and not used
>            free the new layout
> return layout
> 
> 
> -->Andy
> 
>   
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-07-01 14:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-01 13:50 get_lock_alloc_layout Andy Adamson
2010-07-01 14:11 ` Benny Halevy [this message]
2010-07-01 14:19   ` get_lock_alloc_layout Andy Adamson

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=4C2CA1FC.8060803@panasas.com \
    --to=bhalevy@panasas.com \
    --cc=andros@netapp.com \
    --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