All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] gfs2: Add missing rcu locking for glock lookup
Date: Wed, 22 Feb 2017 15:50:45 +0000	[thread overview]
Message-ID: <b2c7a45b-8993-dc93-81a4-f46eca32cc40@redhat.com> (raw)
In-Reply-To: <CAHc6FU538htYk++DfR4rQvw9syq0kKHQLgsWp86cruqBvTh5rQ@mail.gmail.com>

Hi,


On 22/02/17 15:34, Andreas Gruenbacher wrote:
> On Wed, Feb 22, 2017 at 4:29 PM, Steven Whitehouse <swhiteho@redhat.com> wrote:
>> There should be no need to retry at all. Either the new entry will be added
>> to the hash table, or it will find an existing entry in the table. Is there
>> really some way this can fail for some reason?
> Yes, we may find an existing entry but by the time we try to get a
> lockref, the entry may be dead. In that case, the right thing to do is
> to retry the insert.
>
> Andreas

Hmm. If it is dead but not yet removed from the list, then we will spin 
on this. The original code prior to the rhashtable conversion would have 
just looked at the next entry on the list, if it found a dead entry matching
the key.

In gfs2_glock_put() we do remove the glock from the hash table, but not 
until after removing it from the lru and dropping the gl_lockref.lock, 
so there is some potential for this to happen. Whether it will be a 
problem in reality I'm not sure, but it is not ideal - I wonder how 
other rhashtable users deal with this issue... or maybe we are the only 
ones using lockref with rhashtable.

This is certainly a big improvement on what we had before, but at the 
same time, we should make a note to fix this properly in due course,

Steve.



  reply	other threads:[~2017-02-22 15:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-22 15:09 [Cluster-devel] [PATCH] gfs2: Add missing rcu locking for glock lookup Andreas Gruenbacher
2017-02-22 15:13 ` Steven Whitehouse
2017-02-22 15:26   ` Andreas Gruenbacher
2017-02-22 15:28     ` Andreas Gruenbacher
2017-02-22 15:29     ` Steven Whitehouse
2017-02-22 15:34       ` Andreas Gruenbacher
2017-02-22 15:50         ` Steven Whitehouse [this message]
2017-02-22 15:18 ` Andrew Price
2017-02-22 19:19 ` Bob Peterson
2017-02-23 10:04   ` Andrew Price
2017-02-23 13:08     ` Bob Peterson
2017-02-23 14:32       ` Andrew Price

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=b2c7a45b-8993-dc93-81a4-f46eca32cc40@redhat.com \
    --to=swhiteho@redhat.com \
    /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.