Re: Abysmal Performance

2011-06-21 Thread Henning Rohlfs
On Mon, 20 Jun 2011 20:12:16 -0400, Josef Bacik wrote: On 06/20/2011 05:51 PM, Henning Rohlfs wrote: Hello, I've migrated my system to btrfs (raid1) a few months ago. Since then the performance has been pretty bad, but recently it's gotten unbearable: a simple sync called while the system is

Re: Abysmal Performance

2011-06-21 Thread Sander
Henning Rohlfs wrote (ao): - space_cache was enabled, but it seemed to make the problem worse. It's no longer in the mount options. space_cache is a one time mount option which enabled space_cache. Not supplying it anymore as a mount option has no effect (dmesg | grep btrfs). Sander

[GIT PULL v3] Btrfs: improve write ahead log with sub transaction

2011-06-21 Thread Liu Bo
I've been working to try to improve the write-ahead log's performance, and I found that the bottleneck addresses in the checksum items, especially when we want to make a random write on a large file, e.g a 4G file. Then a idea for this suggested by Chris is to use sub transaction ids and just to

[PATCH 02/12 v3] Btrfs: update block generation if should_cow_block fails

2011-06-21 Thread Liu Bo
Cause we've added sub transaction, if it do not want to cow a block, we also need to get new sub transid recorded. This is used for log code to find the most uptodate file extents. Signed-off-by: Liu Bo liubo2...@cn.fujitsu.com --- fs/btrfs/ctree.c | 34 +- 1

[PATCH 04/12 v3] Btrfs: introduce first sub trans

2011-06-21 Thread Liu Bo
In multi-thread situations, writeback of a file may span across several sub transactions, and we need to introduce first_sub_trans to get sub_transid of teh first sub transaction recorded, so that log code can skip file extents which have been logged or committed onto disk. Signed-off-by: Liu Bo

[PATCH 03/12 v3] Btrfs: modify btrfs_drop_extents API

2011-06-21 Thread Liu Bo
We want to use btrfs_drop_extent() in log code. Signed-off-by: Liu Bo liubo2...@cn.fujitsu.com --- fs/btrfs/ctree.h|3 ++- fs/btrfs/file.c |9 +++-- fs/btrfs/inode.c|6 +++--- fs/btrfs/ioctl.c|4 ++-- fs/btrfs/tree-log.c |2 +- 5 files changed, 15

[PATCH 07/12 v3] Btrfs: add checksum check for log

2011-06-21 Thread Liu Bo
If a inode is a BTRFS_INODE_NODATASUM one, it need not to look for csum items any more. Signed-off-by: Liu Bo liubo2...@cn.fujitsu.com --- fs/btrfs/tree-log.c | 13 - 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index

[PATCH 01/12 v3] Btrfs: introduce sub transaction stuff

2011-06-21 Thread Liu Bo
Introduce a new concept sub transaction, the relation between transaction and sub transaction is transaction A --- transid = x sub trans a(1) --- sub_transid = x+1 sub trans a(2) --- sub_transid = x+2 ... ... sub trans a(n-1) --- sub_transid = x+n-1 sub trans a(n) ---

[PATCH 05/12 v3] Btrfs: still update inode trans stuff when size remains unchanged

2011-06-21 Thread Liu Bo
Due to DIO stuff, commit 1ef30be142d2cc60e2687ef267de864cf31be995 makes btrfs not call btrfs_update_inode when it does not update i_disk_size, but in buffer write case, we need to update btrfs internal inode's trans stuff, so that the log code can find the inode's changes. Signed-off-by: Liu Bo

[PATCH 10/12 v3] Btrfs: deal with EEXIST after iput

2011-06-21 Thread Liu Bo
There are two cases when BTRFS_I(inode)-logged_trans is zero: a) an inode is just allocated; b) iput an inode and reread it. However, in b) if btrfs is not committed yet, and this inode _may_ still remain in log tree. So we need to check the log tree to get logged_trans a right value in case it

[PATCH 08/12 v3] Btrfs: fix a bug of log check

2011-06-21 Thread Liu Bo
The current code uses struct root's last_log_commit to check if an inode has been logged, but the problem is that this root-last_log_commit is shared among files. Say we have N inodes to be logged, after the first inode, root-last_log_commit is updated and the N-1 remains will not be logged. As

[PATCH 09/12 v3] Btrfs: kick off useless code

2011-06-21 Thread Liu Bo
fsync will wait for writeback till it finishes, and last_trans will get the real transid recorded in writeback, so it does not need an extra +1 to ensure fsync's process on the file. Signed-off-by: Liu Bo liubo2...@cn.fujitsu.com --- fs/btrfs/file.c | 13 - 1 files changed, 0

[PATCH 12/12 v3] Revert Btrfs: do not flush csum items of unchanged file data during treelog

2011-06-21 Thread Liu Bo
This reverts commit 8e531cdfeb75269c6c5aae33651cca39707848da. Signed-off-by: Liu Bo liubo2...@cn.fujitsu.com --- fs/btrfs/tree-log.c |3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 166fda5..d4ccf91 100644 ---

[PATCH 06/12 v3] Btrfs: improve log with sub transaction

2011-06-21 Thread Liu Bo
When logging an inode _A_, current btrfs will a) clear all items belonged to _A_ in log, b) copy all items belonged to _A_ from fs/file tree to log tree, and this just wastes a lot of time, especially when logging big files. So we want to use a smarter approach, i.e. find and merge. The amount of

[PATCH 11/12 v3] Btrfs: use the right generation number to read log_root_tree

2011-06-21 Thread Liu Bo
Currently we use the generation number of the super to read in the log tree root after a crash. This doesn't always match the sub trans id and so it doesn't always match the transid stored in the btree blocks. We can use log_root_transid to record the log_root_tree's generation so that when we

Re: Abysmal Performance

2011-06-21 Thread Henning Rohlfs
On Tue, 21 Jun 2011 10:00:59 +0200, Sander wrote: Henning Rohlfs wrote (ao): - space_cache was enabled, but it seemed to make the problem worse. It's no longer in the mount options. space_cache is a one time mount option which enabled space_cache. Not supplying it anymore as a mount option

Re: [PATCH 4/8] fs: kill i_alloc_sem

2011-06-21 Thread Christoph Hellwig
On Tue, Jun 21, 2011 at 03:40:56PM +1000, Dave Chinner wrote: Modification of inode-i_state is not safe outside the inode-i_lock. We never actually set the new bit in i_state, we just use it as a key for the hashed lookups. Or rather we try to, as I misunderstood how wait_on_bit works, so

Re: [PATCH 2/2] Btrfs: fix space leak when trimming free extents

2011-06-21 Thread Li Dongyang
On Tuesday, June 21, 2011 01:50:10 PM Li Zefan wrote: When the end of an extent exceeds the end of the specified range, the extent will be accidentally truncated. Signed-off-by: Li Zefan l...@cn.fujitsu.com --- fs/btrfs/free-space-cache.c |9 - 1 files changed, 8

Re: Applications using fsync cause hangs for several seconds every few minutes

2011-06-21 Thread Jan Stilow
Hello, Nirbheek Chauhan nirbheek at gentoo.org writes: However, recently, perhaps with 2.6.39, or after I quickly started filling up my disk again, it has become impossible for me to work for long periods on my machine. Every few minutes, (I guess) when applications do fsync (firefox,

[HELP!] parent transid verify failed on 600755752960 wanted 757102 found 756726

2011-06-21 Thread Francesco R
[HELP!] parent transid verify failed on 600755752960 wanted 757102 found 756726 Hi list, I've a broken btrfs filesystem to deal with can someone please help me in recover the data? The filesystem has been created a pair of years ago with 4 devices with the command at #create and is mounted with

Re: [PATCH 06/12 v3] Btrfs: improve log with sub transaction

2011-06-21 Thread Josef Bacik
On 06/21/2011 04:49 AM, Liu Bo wrote: When logging an inode _A_, current btrfs will a) clear all items belonged to _A_ in log, b) copy all items belonged to _A_ from fs/file tree to log tree, and this just wastes a lot of time, especially when logging big files. So we want to use a smarter

Re: [PATCH 10/12 v3] Btrfs: deal with EEXIST after iput

2011-06-21 Thread Josef Bacik
On 06/21/2011 04:49 AM, Liu Bo wrote: There are two cases when BTRFS_I(inode)-logged_trans is zero: a) an inode is just allocated; b) iput an inode and reread it. However, in b) if btrfs is not committed yet, and this inode _may_ still remain in log tree. So we need to check the log tree to

Re: [HELP!] parent transid verify failed on 600755752960 wanted 757102 found 756726

2011-06-21 Thread Daniel Witzel
Welcome to the club, I have a similar issue. We pretty much have to wait for the fsck tool to finish being developed. If possible unhook the drives and leave them be until the tool is done. I don't know when it will be done as I am not a developer, mearly a follower. -- To unsubscribe from this

Re: [PATCH v2 1/7] added helper functions to iterate backrefs

2011-06-21 Thread David Sterba
On Sat, Jun 18, 2011 at 01:45:58PM +0200, Jan Schmidt wrote: +/* + * returns 0 if the path could be dumped (probably truncated) + * returns 0 in case of an error + */ +static int inode_to_path(u64 inum, struct btrfs_inode_ref *iref, + struct extent_buffer *eb_ir,

Re: [HELP!] parent transid verify failed on 600755752960 wanted 757102 found 756726

2011-06-21 Thread Francesco R
2011/6/21 Daniel Witzel dannyboy48...@gmail.com: Welcome to the club, I have a similar issue. We pretty much have to wait for the fsck tool to finish being developed. If possible unhook the drives and leave them be until the tool is done. I don't know when it will be done as I am not a

Re: [PATCH v2 1/7] added helper functions to iterate backrefs

2011-06-21 Thread Jan Schmidt
On 21.06.2011 16:37, David Sterba wrote: On Sat, Jun 18, 2011 at 01:45:58PM +0200, Jan Schmidt wrote: +/* + * returns 0 if the path could be dumped (probably truncated) + * returns 0 in case of an error + */ +static int inode_to_path(u64 inum, struct btrfs_inode_ref *iref, +

Re: Abysmal Performance

2011-06-21 Thread Josef Bacik
On 06/21/2011 05:26 AM, Henning Rohlfs wrote: On Tue, 21 Jun 2011 10:00:59 +0200, Sander wrote: Henning Rohlfs wrote (ao): - space_cache was enabled, but it seemed to make the problem worse. It's no longer in the mount options. space_cache is a one time mount option which enabled

Re: Abysmal Performance

2011-06-21 Thread Calvin Walton
On Mon, 2011-06-20 at 23:51 +0200, Henning Rohlfs wrote: Hello, I've migrated my system to btrfs (raid1) a few months ago. Since then the performance has been pretty bad, but recently it's gotten unbearable: a simple sync called while the system is idle can take 20 up to 60 seconds.

[PATCH] Btrfs: save preloaded extent_state's in a percpu cache V2

2011-06-21 Thread Josef Bacik
When doing DIO tracing I noticed we were doing a ton of allocations, a lot of the time for extent_states. Some of the time we don't even use the prealloc'ed extent_state, it just get's free'd up. So instead create a per-cpu cache like the radix tree stuff. So we will check to see if our per-cpu

[PATCH] Btrfs: fix how we merge extent states and deal with cached states V2

2011-06-21 Thread Josef Bacik
First, we can sometimes free the state we're merging, which means anybody who calls merge_state() may have the state it passed in free'ed. This is problematic because we could end up caching the state, which makes caching useless as the state will no longer be part of the tree. So instead of

Re: [PATCH 1/8] far: remove i_alloc_sem abuse

2011-06-21 Thread OGAWA Hirofumi
Christoph Hellwig h...@infradead.org writes: Add a new rw_semaphore to protect bmap against truncate. Previous i_alloc_sem was abused for this, but it's going away in this series. In FAT case, -i_mutex was better. But, last time I saw, shmfs was using -i_mutex to call -bmap. So, this was

Re: [PATCH 1/8] far: remove i_alloc_sem abuse

2011-06-21 Thread OGAWA Hirofumi
OGAWA Hirofumi hirof...@mail.parknet.co.jp writes: Christoph Hellwig h...@infradead.org writes: Add a new rw_semaphore to protect bmap against truncate. Previous i_alloc_sem was abused for this, but it's going away in this series. In FAT case, -i_mutex was better. But, last time I saw,

Re: [PATCH 1/8] far: remove i_alloc_sem abuse

2011-06-21 Thread Christoph Hellwig
On Wed, Jun 22, 2011 at 12:57:43AM +0900, OGAWA Hirofumi wrote: Christoph Hellwig h...@infradead.org writes: Add a new rw_semaphore to protect bmap against truncate. Previous i_alloc_sem was abused for this, but it's going away in this series. In FAT case, -i_mutex was better. But, last

Re: Abysmal Performance

2011-06-21 Thread Henning Rohlfs
On Tue, 21 Jun 2011 11:18:30 -0400, Josef Bacik wrote: On 06/21/2011 05:26 AM, Henning Rohlfs wrote: On Tue, 21 Jun 2011 10:00:59 +0200, Sander wrote: Henning Rohlfs wrote (ao): - space_cache was enabled, but it seemed to make the problem worse. It's no longer in the mount options.

Re: [PATCH 2/8] ext4: remove i_alloc_sem abuse

2011-06-21 Thread Lukas Czerner
On Mon, 20 Jun 2011, Christoph Hellwig wrote: Add a new rw_semaphore to protect page_mkwrite against truncate. Previous i_alloc_sem was abused for this, but it's going away in this series. Signed-off-by: Christoph Hellwig h...@lst.de Index: linux-2.6/fs/ext4/inode.c

Re: [PATCH 2/8] ext4: remove i_alloc_sem abuse

2011-06-21 Thread Christoph Hellwig
On Tue, Jun 21, 2011 at 06:34:50PM +0200, Lukas Czerner wrote: this looks like a bug fix, so we should rather do it in a separate commit. Could you send it separately, or at least mention that in commit description ? What looks like a bugfix? -- To unsubscribe from this list: send the line

Re: [PATCH 2/8] ext4: remove i_alloc_sem abuse

2011-06-21 Thread Lukas Czerner
On Tue, 21 Jun 2011, Lukas Czerner wrote: On Mon, 20 Jun 2011, Christoph Hellwig wrote: Add a new rw_semaphore to protect page_mkwrite against truncate. Previous i_alloc_sem was abused for this, but it's going away in this series. Signed-off-by: Christoph Hellwig h...@lst.de

Re: [PATCH] Btrfs: save preloaded extent_state's in a percpu cache V2

2011-06-21 Thread Andi Kleen
Josef Bacik jo...@redhat.com writes: When doing DIO tracing I noticed we were doing a ton of allocations, a lot of the time for extent_states. Some of the time we don't even use the prealloc'ed extent_state, it just get's free'd up. So instead create a per-cpu cache like the radix tree

Re: [PATCH] Btrfs: save preloaded extent_state's in a percpu cache V2

2011-06-21 Thread Josef Bacik
On 06/21/2011 04:20 PM, Andi Kleen wrote: Josef Bacik jo...@redhat.com writes: When doing DIO tracing I noticed we were doing a ton of allocations, a lot of the time for extent_states. Some of the time we don't even use the prealloc'ed extent_state, it just get's free'd up. So instead

Re: [PATCH 0/8] remove i_alloc_sem

2011-06-21 Thread Jan Kara
On Mon 20-06-11 16:15:33, Christoph Hellwig wrote: i_alloc_sem has always been a bit of an odd lock. It's the only remaining rw_semaphore that can be released by a different thread than the one that locked it, and it's use case in the core direct I/O code is more like a counter given that the

Re: [PATCH 10/12 v3] Btrfs: deal with EEXIST after iput

2011-06-21 Thread liubo
On 06/21/2011 10:00 PM, Josef Bacik wrote: On 06/21/2011 04:49 AM, Liu Bo wrote: There are two cases when BTRFS_I(inode)-logged_trans is zero: a) an inode is just allocated; b) iput an inode and reread it. However, in b) if btrfs is not committed yet, and this inode _may_ still remain in

Christopher Whelan wants to chat

2011-06-21 Thread Christopher Whelan
--- Christopher Whelan wants to stay in better touch using some of Google's coolest new products. If you already have Gmail or Google Talk, visit: http://mail.google.com/mail/b-ee9a324c7f-06c7f01d3e-rl8EXZ4nBadGESgcw_qYvUYj1Po

Re: kernel BUG at fs/btrfs/delayed-inode.c:1301!

2011-06-21 Thread Miao Xie
On Tue, 21 Jun 2011 02:08:54 +0200, David Sterba wrote: On Mon, Jun 20, 2011 at 06:12:10PM +0800, Miao Xie wrote: From 457f39393b2e3d475fbba029b90b6a4e17b94d43 Mon Sep 17 00:00:00 2001 From: Miao Xie mi...@cn.fujitsu.com Date: Mon, 20 Jun 2011 17:21:51 +0800 Subject: [PATCH] btrfs: fix

[PATCH] Btrfs: remove unneeded BUG_ON()

2011-06-21 Thread Tsutomu Itoh
The following functions always return 0. - add_delayed_ref_head() - add_delayed_tree_ref() - add_delayed_data_ref() - add_excluded_extent() Therefore, check by BUG_ON() is unnecessary at the caller of these functions. Signed-off-by: Tsutomu Itoh t-i...@jp.fujitsu.com ---