linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] [RFC PATCH 0/4] btrfs: Implement delayed directory name index insertion and deletion
@ 2010-12-01  8:09 Miao Xie
  2010-12-31 15:43 ` Itaru Kitayama
  0 siblings, 1 reply; 4+ messages in thread
From: Miao Xie @ 2010-12-01  8:09 UTC (permalink / raw)
  To: Linux Btrfs

Compare with Ext3/4, the performance of file creation and deletion on btrfs is
very poor. the reason is that btrfs must do a lot of b+ tree insertions, such as
inode item, directory name item, directory name index and so on.

If we can do some delayed b+ tree insertion or deletion, we can improve the
performance, so we made this patch which implemented delayed directory name
index insertion and deletion.

Beside that, we found we must map the page every time we want to set a member
variable of the inode item, it is inefficient. We just do it at first to reduce
the times of mmap(). By this way, we can also improve the performance of file
creation and deletion.

I did a quick test by the benchmark tool[1] and found we can improve the
performance of file creation by ~11%, and file deletion by ~14%.

Before applying this patch:
Create files:
	Total files: 50000
	Total time: 1.188547
	Average time: 0.000024
Delete files:
	Total files: 50000
	Total time: 1.662012
	Average time: 0.000033

After applying this patch:
Create files:
	Total files: 50000
	Total time: 1.057432
	Average time: 0.000021
Delete files:
	Total files: 50000
	Total time: 1.422851
	Average time: 0.000028

You can also try out the patchset by pulling:
	git://repo.or.cz/linux-btrfs-devel.git perf-improve

[1] http://marc.info/?l=linux-btrfs&m=128212635122920&q=p3

---
 fs/btrfs/Makefile            |    2 +-
 fs/btrfs/btrfs_inode.h       |    2 +
 fs/btrfs/ctree.c             |   13 +-
 fs/btrfs/ctree.h             |   21 +-
 fs/btrfs/delayed-dir-index.c |  790 ++++++++++++++++++++++++++++++++++++++++++
 fs/btrfs/delayed-dir-index.h |   92 +++++
 fs/btrfs/dir-item.c          |   61 +++-
 fs/btrfs/extent-tree.c       |   21 ++
 fs/btrfs/inode.c             |  189 +++++++---
 fs/btrfs/transaction.c       |    9 +
 fs/btrfs/transaction.h       |    2 +
 11 files changed, 1117 insertions(+), 85 deletions(-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-01-10  3:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-01  8:09 [GIT PULL] [RFC PATCH 0/4] btrfs: Implement delayed directory name index insertion and deletion Miao Xie
2010-12-31 15:43 ` Itaru Kitayama
2011-01-06  6:47   ` Miao Xie
2011-01-10  3:16     ` Itaru Kitayama

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).