From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [GFS2 PATCH] GFS2: Eliminate sd_rindex_mutex
Date: Mon, 05 Mar 2012 13:51:01 +0000 [thread overview]
Message-ID: <1330955461.2699.47.camel@menhir> (raw)
In-Reply-To: <788f6dfa-67d6-4ff6-a91f-8f6c0f87c0b4@zmail12.collab.prod.int.phx2.redhat.com>
Hi,
On Mon, 2012-03-05 at 08:33 -0500, Bob Peterson wrote:
> ----- Original Message -----
> | Bearing in mind that the mutex is an exclusive lock and the glock is
> | only a shared lock, do we have any other protection against the rgrp
> | tree being updated simultaneously?
> |
> | Steve.
>
> Hi,
>
> Yes, I think you're right. The existing code should work most of the
> time but has the potential to leak rgrp memory if the timing is right.
> We could approach the solution two ways:
>
> (1) We could change the shared lock to an exclusive lock.
That is not a good solution. Think about what happens when we have
multiple nodes, and grow has just finished on one... we want them all to
be able to update at the same time.
> (2) We could change function rgd_insert so that it returns an error if
> the rgrp was already in the rb_tree. That way, whoever gets the
> sd_rindex_spin spinlock first will call rgd_insert to insert the new
> rgrp into the rgrp tree, and when the second caller tries to insert
> its new rgrp into the rb_tree, it will find the entry already there,
> (inserted by the first caller), then take the error path and exit,
> freeing the rgrp it kmalloced.
>
> Regards,
>
> Bob Peterson
> Red Hat File Systems
Yes, thats ok since we know that the rgrps will only grow and never
shrink, so if we find one already inserted, we know that we raced and
can free the new entry rather than adding it,
Steve.
prev parent reply other threads:[~2012-03-05 13:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <950f35d3-b138-4bd6-b4eb-240106d088cc@zmail12.collab.prod.int.phx2.redhat.com>
2012-03-02 19:28 ` [Cluster-devel] [GFS2 PATCH] GFS2: Eliminate sd_rindex_mutex Bob Peterson
2012-03-05 12:20 ` Steven Whitehouse
2012-03-05 13:33 ` Bob Peterson
2012-03-05 13:49 ` [Cluster-devel] [GFS2 PATCH TRY #2] " Bob Peterson
2012-03-05 14:20 ` [Cluster-devel] [GFS2 PATCH TRY #3] " Bob Peterson
2012-03-05 16:24 ` Steven Whitehouse
2012-03-05 13:51 ` Steven Whitehouse [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=1330955461.2699.47.camel@menhir \
--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 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).