Re: Compression: per filesystem, or per subvolume?

2011-05-10 Thread Fajar A. Nugraha
On Sun, May 8, 2011 at 8:38 PM, cwillu cwi...@gmail.com wrote:
 It's by not-implemented-yet.  Mount options are still currently global to
 the filesystem.

Thanks for the info. I was testing combination of grub2, btrfs /
without separate /boot, and lzo. Using lzo feels much faster compared
to zlib, so right now I just use separate /boot/grub in ext4 to make
it work correctly.

-- 
Fajar


 On May 8, 2011 7:35 AM, Fajar A. Nugraha l...@fajar.net wrote:
 Currently using Ubuntu Natty, kernel 2.6.38-9-generic, I have these
 mount points using btrs subvolumes

 $ mount -t btrfs
 /dev/sda2 on / type btrfs (rw,noatime,subvolid=256,compress-force=zlib)
 /dev/sda2 on /home type btrfs (rw,noatime,subvolid=258,compress=lzo)

 Yet dmesg seems to show only zlib compression enabled
 $ dmesg | grep btrfs
 [ 11.097908] btrfs: force zlib compression

 Is this by design, or a bug?
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Lockdep warning in btrfs_clear_lock_blocking

2011-05-10 Thread David Sterba
Hi,

I've hit this lockdep warning, 2.6.39rc6. Single btrfs partition, 30GB,
filled with 2GB, compress-force=lzo, warning trigered after normal copy+du.
Happened only once.

[Might be a false positive.]

david

[14547.128565] =
[14547.132010] [ INFO: possible recursive locking detected ]
[14547.132010] 2.6.39-rc6-default+ #4
[14547.132010] -
[14547.132010] du/22878 is trying to acquire lock:
[14547.132010]  ((eb-lock)-rlock){+.+...}, at: [a0401e8c]
btrfs_try_spin_lock+0x7c/0xa0 [btrfs]
[14547.132010]
[14547.132010] but task is already holding lock:
[14547.132010]  ((eb-lock)-rlock){+.+...}, at: [a0401e02]
btrfs_clear_lock_blocking+0x22/0x30 [btrfs]
[14547.132010]
[14547.132010] other info that might help us debug this:
[14547.132010] 2 locks held by du/22878:
[14547.132010]  #0:  (sb-s_type-i_mutex_key#18){+.+.+.}, at: 
[81175df5] vfs_readdir+0x75/0xd0
[14547.132010]  #1:  ((eb-lock)-rlock){+.+...}, at: [a0401e02] 
btrfs_clear_lock_blocking+0x22/0x30 [btrfs]
[14547.132010]
[14547.132010] stack backtrace:
[14547.132010] Pid: 22878, comm: du Not tainted 2.6.39-rc6-default+ #4
[14547.132010] Call Trace:
[14547.132010]  [810be08b] __lock_acquire+0x159b/0x1de0
[14547.132010]  [810ac8d8] ? sched_clock_cpu+0xa8/0x110
[14547.132010]  [810ac745] ? sched_clock_local+0x25/0x90
[14547.132010]  [810bef4f] lock_acquire+0x9f/0x130
[14547.132010]  [a0401e8c] ? btrfs_try_spin_lock+0x7c/0xa0 [btrfs]
[14547.132010]  [814e1586] _raw_spin_lock+0x36/0x70
[14547.132010]  [a0401e8c] ? btrfs_try_spin_lock+0x7c/0xa0 [btrfs]
[14547.132010]  [a0401e02] ?  btrfs_clear_lock_blocking+0x22/0x30 
[btrfs]
[14547.132010]  [a0401e8c] btrfs_try_spin_lock+0x7c/0xa0 [btrfs]
[14547.132010]  [a03b312d] btrfs_search_slot+0x80d/0x880 [btrfs]
[14547.132010]  [a03d1d8f] btrfs_real_readdir+0xcf/0x4f0 [btrfs]
[14547.132010]  [814df901] ?  mutex_lock_killable_nested+0x281/0x3c0
[14547.132010]  [81175ad0] ? sys_ioctl+0x80/0x80
[14547.132010]  [81175df5] ? vfs_readdir+0x75/0xd0
[14547.132010]  [810b984d] ? trace_hardirqs_off+0xd/0x10
[14547.132010]  [810ac9af] ? local_clock+0x6f/0x80
[14547.132010]  [81175df5] ? vfs_readdir+0x75/0xd0
[14547.132010]  [81175ad0] ? sys_ioctl+0x80/0x80
[14547.132010]  [81175e28] vfs_readdir+0xa8/0xd0
[14547.132010]  [8116419c] ? fget+0x8c/0x260
[14547.132010]  [81164110] ? fget_raw+0x250/0x250
[14547.132010]  [81176045] sys_getdents64+0x85/0xf0
[14547.132010]  [814ea482] system_call_fastpath+0x16/0x1b
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: btrfs filesystem label command

2011-05-10 Thread Goffredo Baroncelli
Hi,

I suppose that you are familiar with 'git' and the standard unix command
(like cd, make...). The quick way is the following:

$ cd /tmp
$ git clone -b label \
http://cassiopea.homelinux.net/git/btrfs-progs-unstable.git
$ cd btrfs-progs-unstable.git
$ make
$ ./btrfs


Hoping that this may help you

Regards
G.Baroncelli

On 05/09/2011 11:36 PM, BJ Quinn wrote:
 Hi, 
 
 Sorry to ask what's probably a painfully obvious question, but I'd like to 
 use your btrfs filesystem label command. For the life of me, I can't quite 
 figure out what the process would be to download the btrfs-progs sources and 
 apply your patch and use the command. Can you point me in the right 
 direction? 
 
 Thanks! 
 
 -BJ Quinn 
 

--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/4] btrfs: don't spin in shrink_delalloc if there is nothing to free

2011-05-10 Thread Sergei Trofimovich
On Mon, 09 May 2011 12:00:28 -0400
Josef Bacik jo...@redhat.com wrote:

 On 05/07/2011 05:29 PM, sly...@gmail.com wrote:
  Observed as a large delay when --mixed filesystem is filled up.
  Test example:
  1. create tiny --mixed FS:
  $ dd if=/dev/zero of=2G.img seek=$((2048 * 1024 * 1024 - 1)) count=1 
  bs=1
  $ mkfs.btrfs --mixed 2G.img
  $ mount -oloop 2G.img /mnt/ut/
  2. Try to fill it up:
  $ dd if=/dev/urandom of=10M.file bs=10240 count=1024
  $ seq 1 256 | while read file_no; do echo $file_no; time cp 10M.file 
  ${file_no}.copy; done
 
  Up to '200.copy' it goes fast, but when disk fills-up each -ENOSPC
  message takes 3 seconds to pop-up _every_ ENOSPC (and in usermode linux
  it's even more: 30-60 seconds!). (Maybe, time depends on kernel's timer 
  resolution).
 
  No IO, no CPU load, just rescheduling. Some debugging revealed busy spinning
  in shrink_delalloc.
 
  Signed-off-by: Sergei Trofimovichsly...@gentoo.org
  ---
fs/btrfs/extent-tree.c |4 
1 files changed, 4 insertions(+), 0 deletions(-)
 
  diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
  index 9ee6bd5..9f5fdd3 100644
  --- a/fs/btrfs/extent-tree.c
  +++ b/fs/btrfs/extent-tree.c
  @@ -3425,6 +3425,10 @@ static int shrink_delalloc(struct btrfs_trans_handle 
  *trans,
  if (reserved == 0)
  return 0;
 
  +   /* nothing to shrink - nothing to reclaim */
  +   if (root-fs_info-delalloc_bytes == 0)
  +   return 0;
  +
  max_reclaim = min(reserved, to_reclaim);
 
  while (loops  1024) {
 
 Nice catch, you can add
 
 Reviewed-by: Josef Bacik jo...@redhat.com

Will add it (and fix patch enumeration) and resend.

Thanks for the review!

-- 

  Sergei


signature.asc
Description: PGP signature


[PATCH v2 0/3] btrfs: don't spin in shrink_delalloc if there is nothing to free

2011-05-10 Thread y
From: Sergei Trofimovich sly...@gentoo.org

The really interesting commit is
[PATCH 1/3] btrfs: don't spin in shrink_delalloc if there is nothing to free
which fixes hogs on ENOSPC for me.

The rest of patches are cleanup.

Change since v1:
- Added Josef's Reviewed-by
- Fixed my MTA and patch numbering

Thanks!
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 1/3] btrfs: don't spin in shrink_delalloc if there is nothing to free

2011-05-10 Thread y
From: Sergei Trofimovich sly...@gentoo.org

Observed as a large delay when --mixed filesystem is filled up.
Test example:
1. create tiny --mixed FS:
   $ dd if=/dev/zero of=2G.img seek=$((2048 * 1024 * 1024 - 1)) count=1 bs=1
   $ mkfs.btrfs --mixed 2G.img
   $ mount -oloop 2G.img /mnt/ut/
2. Try to fill it up:
   $ dd if=/dev/urandom of=10M.file bs=10240 count=1024
   $ seq 1 256 | while read file_no; do echo $file_no; time cp 10M.file 
${file_no}.copy; done

Up to '200.copy' it goes fast, but when disk fills-up each -ENOSPC
message takes 3 seconds to pop-up _every_ ENOSPC (and in usermode linux
it's even more: 30-60 seconds!). (Maybe, time depends on kernel's timer 
resolution).

No IO, no CPU load, just rescheduling. Some debugging revealed busy spinning
in shrink_delalloc.

Signed-off-by: Sergei Trofimovich sly...@gentoo.org
Reviewed-by: Josef Bacik jo...@redhat.com
---
 fs/btrfs/extent-tree.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 9ee6bd5..9f5fdd3 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -3425,6 +3425,10 @@ static int shrink_delalloc(struct btrfs_trans_handle 
*trans,
if (reserved == 0)
return 0;
 
+   /* nothing to shrink - nothing to reclaim */
+   if (root-fs_info-delalloc_bytes == 0)
+   return 0;
+
max_reclaim = min(reserved, to_reclaim);
 
while (loops  1024) {
-- 
1.7.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 2/3] btrfs: typo: 'btrfS' - 'btrfs'

2011-05-10 Thread y
From: Sergei Trofimovich sly...@gentoo.org

Signed-off-by: Sergei Trofimovich sly...@gentoo.org
---
 fs/btrfs/dir-item.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/btrfs/dir-item.c b/fs/btrfs/dir-item.c
index c62f02f..dec9348 100644
--- a/fs/btrfs/dir-item.c
+++ b/fs/btrfs/dir-item.c
@@ -452,7 +452,7 @@ int verify_dir_item(struct btrfs_root *root,
namelen = XATTR_NAME_MAX;
 
if (btrfs_dir_name_len(leaf, dir_item)  namelen) {
-   printk(KERN_CRIT btrfS: invalid dir item name len: %u\n,
+   printk(KERN_CRIT btrfs: invalid dir item name len: %u\n,
   (unsigned)btrfs_dir_data_len(leaf, dir_item));
return 1;
}
-- 
1.7.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 3/3] btrfs: fix typo 'testeing' - 'testing'

2011-05-10 Thread y
From: Sergei Trofimovich sly...@gentoo.org

Signed-off-by: Sergei Trofimovich sly...@gentoo.org
---
 fs/btrfs/inode.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 7cd8ab0..72650ce 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1310,7 +1310,7 @@ static int btrfs_set_bit_hook(struct inode *inode,
 
/*
 * set_bit and clear bit hooks normally require _irqsave/restore
-* but in this case, we are only testeing for the DELALLOC
+* but in this case, we are only testing for the DELALLOC
 * bit, which is only set or cleared with irqs on
 */
if (!(state-state  EXTENT_DELALLOC)  (*bits  EXTENT_DELALLOC)) {
@@ -1344,7 +1344,7 @@ static int btrfs_clear_bit_hook(struct inode *inode,
 {
/*
 * set_bit and clear bit hooks normally require _irqsave/restore
-* but in this case, we are only testeing for the DELALLOC
+* but in this case, we are only testing for the DELALLOC
 * bit, which is only set or cleared with irqs on
 */
if ((state-state  EXTENT_DELALLOC)  (*bits  EXTENT_DELALLOC)) {
-- 
1.7.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 0/3] btrfs: don't spin in shrink_delalloc if there is nothing to free

2011-05-10 Thread Sergei Trofimovich
The really interesting commit is
[PATCH 1/3] btrfs: don't spin in shrink_delalloc if there is nothing to free
which fixes hogs on ENOSPC for me.

The rest of patches are cleanup.

Change since v1:
- Added Josef's Reviewed-by
- Fixed my MTA and patch numbering

Thanks!
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 1/3] btrfs: don't spin in shrink_delalloc if there is nothing to free

2011-05-10 Thread Sergei Trofimovich
Observed as a large delay when --mixed filesystem is filled up.
Test example:
1. create tiny --mixed FS:
   $ dd if=/dev/zero of=2G.img seek=$((2048 * 1024 * 1024 - 1)) count=1 bs=1
   $ mkfs.btrfs --mixed 2G.img
   $ mount -oloop 2G.img /mnt/ut/
2. Try to fill it up:
   $ dd if=/dev/urandom of=10M.file bs=10240 count=1024
   $ seq 1 256 | while read file_no; do echo $file_no; time cp 10M.file 
${file_no}.copy; done

Up to '200.copy' it goes fast, but when disk fills-up each -ENOSPC
message takes 3 seconds to pop-up _every_ ENOSPC (and in usermode linux
it's even more: 30-60 seconds!). (Maybe, time depends on kernel's timer 
resolution).

No IO, no CPU load, just rescheduling. Some debugging revealed busy spinning
in shrink_delalloc.

Signed-off-by: Sergei Trofimovich sly...@gentoo.org
Reviewed-by: Josef Bacik jo...@redhat.com
---
 fs/btrfs/extent-tree.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 9ee6bd5..9f5fdd3 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -3425,6 +3425,10 @@ static int shrink_delalloc(struct btrfs_trans_handle 
*trans,
if (reserved == 0)
return 0;
 
+   /* nothing to shrink - nothing to reclaim */
+   if (root-fs_info-delalloc_bytes == 0)
+   return 0;
+
max_reclaim = min(reserved, to_reclaim);
 
while (loops  1024) {
-- 
1.7.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 2/3] btrfs: typo: 'btrfS' - 'btrfs'

2011-05-10 Thread Sergei Trofimovich
Signed-off-by: Sergei Trofimovich sly...@gentoo.org
---
 fs/btrfs/dir-item.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/btrfs/dir-item.c b/fs/btrfs/dir-item.c
index c62f02f..dec9348 100644
--- a/fs/btrfs/dir-item.c
+++ b/fs/btrfs/dir-item.c
@@ -452,7 +452,7 @@ int verify_dir_item(struct btrfs_root *root,
namelen = XATTR_NAME_MAX;
 
if (btrfs_dir_name_len(leaf, dir_item)  namelen) {
-   printk(KERN_CRIT btrfS: invalid dir item name len: %u\n,
+   printk(KERN_CRIT btrfs: invalid dir item name len: %u\n,
   (unsigned)btrfs_dir_data_len(leaf, dir_item));
return 1;
}
-- 
1.7.3.4

--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html