All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Thornber <ejt@redhat.com>
To: dm-devel@redhat.com
Cc: Joe Thornber <ejt@redhat.com>, Mike Snitzer <snitzer@redhat.com>
Subject: [PATCH 07/14] dm_space_map: remove entries from the ref_count tree if they're no longer needed
Date: Fri, 16 Mar 2012 15:22:30 +0000	[thread overview]
Message-ID: <1331911358-8848-7-git-send-email-ejt@redhat.com> (raw)
In-Reply-To: <1331911358-8848-1-git-send-email-ejt@redhat.com>

Enhancement.

Ref counts are stored in two places: a bitmap if the ref_count is
below 3, or a btree of uint32_t if 3 or above.

When a ref_count that was above 3 drops below we can remove it from
the tree and save some metadata space.  This removal was commented out
before because I was unsure why this was causing under populated btree
nodes.  Earlier patches have fixed this issue.

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
---
 drivers/md/persistent-data/dm-space-map-common.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/md/persistent-data/dm-space-map-common.c b/drivers/md/persistent-data/dm-space-map-common.c
index df2494c..ff3beed 100644
--- a/drivers/md/persistent-data/dm-space-map-common.c
+++ b/drivers/md/persistent-data/dm-space-map-common.c
@@ -405,8 +405,6 @@ int sm_ll_insert(struct ll_disk *ll, dm_block_t b,
 		if (r < 0)
 			return r;
 
-#if 0
-		/* FIXME: dm_btree_remove doesn't handle this yet */
 		if (old > 2) {
 			r = dm_btree_remove(&ll->ref_count_info,
 					    ll->ref_count_root,
@@ -414,7 +412,6 @@ int sm_ll_insert(struct ll_disk *ll, dm_block_t b,
 			if (r)
 				return r;
 		}
-#endif
 
 	} else {
 		__le32 le_rc = cpu_to_le32(ref_count);
-- 
1.7.9.1

  parent reply	other threads:[~2012-03-16 15:22 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-16 15:21 dm-thin patches for 3.4 Joe Thornber
2012-03-16 15:22 ` [PATCH 01/14] dm-thin: don't use the bi_next field for the holder of a cell Joe Thornber
2012-03-16 15:22   ` [PATCH 02/14] dm-thin: remove some documentation for the unimplemented 'trim' target message Joe Thornber
2012-03-16 15:22   ` [PATCH 03/14] dm_thin: dm_sm_root_size() was being called for the wrong space-map Joe Thornber
2012-03-16 15:22   ` [PATCH 04/14] dm_thin: tweak a comment Joe Thornber
2012-03-16 15:22   ` [PATCH 05/14] dm_btree: remove redundant arg from value_ptr() Joe Thornber
2012-03-16 15:22   ` [PATCH 06/14] dm_btree: fix rebalancing of 3 nodes after remove Joe Thornber
2012-03-16 15:22   ` Joe Thornber [this message]
2012-03-16 15:22   ` [PATCH 08/14] dm_thin: add support for read-only external snapshot origins Joe Thornber
2012-03-16 15:22   ` [PATCH 09/14] dm_thin: foundation for discard support Joe Thornber
2012-03-16 15:22   ` [PATCH 10/14] dm_thin: add support for REQ_DISCARD Joe Thornber
2012-03-23 12:45     ` Alasdair G Kergon
2012-03-16 15:22   ` [PATCH 11/14] dm_thin: add pool target flags to control discard Joe Thornber
2012-03-23 12:37     ` Alasdair G Kergon
2012-03-23 21:55       ` [PATCH] dm thin: fix pool target flags that " Mike Snitzer
2012-03-26 14:15         ` Joe Thornber
2012-03-26 15:33           ` Mike Snitzer
2012-03-26 19:56             ` Mike Snitzer
2012-03-26 15:34           ` [PATCH] " Joe Thornber
2012-03-26 15:46           ` Joe Thornber
2012-03-16 15:22   ` [PATCH 12/14] dm_thin: commit metadata every second Joe Thornber
2012-03-16 15:22   ` [PATCH 13/14] dm_thin: commit just before processing a pool target info request Joe Thornber
2012-03-19 14:00     ` Alasdair G Kergon
2012-03-20 10:12       ` Joe Thornber
2012-03-16 15:22   ` [PATCH 14/14] dm_thin: bump the target versions Joe Thornber
2012-03-20 18:24   ` [PATCH 01/14] dm-thin: don't use the bi_next field for the holder of a cell Alasdair G Kergon

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=1331911358-8848-7-git-send-email-ejt@redhat.com \
    --to=ejt@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=snitzer@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.