From: Jan Schmidt <list.btrfs@jan-o-sch.net>
To: Josef Bacik <josef@redhat.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs: convert refs and pages_reading to ints
Date: Tue, 13 Mar 2012 10:51:04 +0100 [thread overview]
Message-ID: <4F5F1888.7060901@jan-o-sch.net> (raw)
In-Reply-To: <1331309197-5389-1-git-send-email-josef@redhat.com>
Hi Josef,
On 09.03.2012 17:06, Josef Bacik wrote:
> I need to be able to safely deal with refs in my next patch, so convert refs and
Did I miss your next patch?
> pages_reading to ints and introduce an eb_lock spinlock so I can use this to
> safely manipulate the refs count when marking eb's as stale. Thanks,
I don't see what makes this version safer, are you synchronizing
eb->refs with eb->pages_reading? This would be strange, because
eb->pages_reading sounds like it could never be != 0 when eb->refs goes
down to 0. Could you extend your description a bit, please?
> diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
> index f030a2d..d11e872 100644
> --- a/fs/btrfs/extent_io.h
> +++ b/fs/btrfs/extent_io.h
> @@ -128,8 +128,9 @@ struct extent_buffer {
> unsigned long map_len;
> unsigned long bflags;
> struct extent_io_tree *tree;
> - atomic_t refs;
> - atomic_t pages_reading;
> + spinlock_t eb_lock;
If you need that one, then please use another name for this. We already
have the extent buffer's rwlock, it'll only be a matter of time until
somebody (me) confuses eb->lock and eb->eb_lock. I'd like something
representing its purpose (which I didn't catch yet). eb->refs_lock or
eb->pages_lock might be appropriate.
> + int refs;
> + int pages_reading;
> struct list_head leak_list;
> struct rcu_head rcu_head;
> pid_t lock_owner;
Thanks,
-Jan
next prev parent reply other threads:[~2012-03-13 9:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-09 16:06 [PATCH] Btrfs: convert refs and pages_reading to ints Josef Bacik
2012-03-13 9:51 ` Jan Schmidt [this message]
2012-03-13 13:24 ` Josef Bacik
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=4F5F1888.7060901@jan-o-sch.net \
--to=list.btrfs@jan-o-sch.net \
--cc=josef@redhat.com \
--cc=linux-btrfs@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