public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Yan Zheng" <zheng.yan@oracle.com>
To: "Chris Mason" <chris.mason@oracle.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] initial version of reference cache
Date: Sat, 26 Jul 2008 22:26:09 +0800	[thread overview]
Message-ID: <3d0408630807260726h4303fff3k38ecf67c27efcce8@mail.gmail.com> (raw)
In-Reply-To: <1217029117.7572.84.camel@think.oraclecorp.com>

2008/7/26 Chris Mason <chris.mason@oracle.com>:
> I have modified this locally to always cache leaves, even when they
> don't have file extents in them.  That way, walk_down_tree will find the
> cache and won't have to read the leaf (that doesn't have any extents).
>
> So far, it is working very well.  I did a run with fs_mark to create 58
> million files and had very steady numbers.  The unmount took 4 seconds.
> It used to take over an hour.
>
> One question, why not use the block number (byte number) as the key to
> the rbtree instead of the key?
>

When dropping old snapshots, tree leaves are processed in ascending
order of btrfs_key. After a given tree leaf is processed, we remove
the corresponding cache entry and update tree->last to point to next
entry in the tree. Therefore btrfs_lookup_leaf_ref can find the wanted
entry in tree->last in most cases.

Regards
YZ

  reply	other threads:[~2008-07-26 14:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-25 19:29 [PATCH] initial version of reference cache Yan Zheng
2008-07-25 23:38 ` Chris Mason
2008-07-26 14:26   ` Yan Zheng [this message]
2008-07-28 15:09 ` Chris Mason
     [not found]   ` <f058a9c30807280952m2386aad4pa8a08ffaf930c370@mail.gmail.com>
2008-07-28 16:53     ` Miguel Sousa Filipe
2008-07-29  0:25       ` Chris Mason
     [not found]   ` <4891C236.3000604@redhat.com>
2008-07-31 14:11     ` still see locking issues Chris Mason
2008-07-31 14:37     ` Chris Mason
  -- strict thread matches above, loose matches on Subject: below --
2008-07-25 20:57 [PATCH] initial version of reference cache Yan Zheng

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=3d0408630807260726h4303fff3k38ecf67c27efcce8@mail.gmail.com \
    --to=zheng.yan@oracle.com \
    --cc=chris.mason@oracle.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