Tomasz Chmielewski
2011-May-21  12:58 UTC
curious writes on mounted, not used btrfs filesystem
I have a btrfs filesystem (2.6.39) which is mounted, but otherwise, not used:
# lsof -n|grep /mnt/btrfs
#
I noticed that whenever I do "sync", btrfs will write for around 6.5s
and write 13 MB (see below).
If I do a "while true; do sync; done", there will be constant writes
to btrfs filesystem (again - with no userspace program accessing btrfs).
When it happens, "btrfs-submit-0" is in "D" state.
What are these writes? I didn''t notice anything like this with other
filesystems.
$ iostat -t -k 1 sdb4|grep sdb4
Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
sdb4            320.00         0.00      1660.00          0       1660
sdb4            419.00         0.00      1720.00          0       1720
sdb4            291.00         0.00      1224.00          0       1224
sdb4            417.00         0.00      1736.00          0       1736
sdb4            609.00         0.00      2628.00          0       2628
sdb4            350.00         0.00      1452.00          0       1452
sdb4            606.00         0.00      2620.00          0       2620
sdb4            281.00         0.00      1516.00          0       1516
sdb4            352.00         0.00      1472.00          0       1472
sdb4            384.00         0.00      1584.00          0       1584
sdb4            533.00         0.00      2232.00          0       2232
sdb4            640.00         0.00      2660.00          0       2660
When btrfs is mounted with "compress" flag, there will be also reads
when doing a similar operation.
See MB_wrtn before/after the sync:
$ iostat -t -m  sdb4
Linux 2.6.39-020639-generic (dom) 	05/21/2011 	_x86_64_	(8 CPU)
05/21/2011 02:45:46 PM
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           2.47    0.01    1.25    8.01    0.00   88.26
Device:            tps    MB_read/s    MB_wrtn/s    MB_read    MB_wrtn
sdb4            127.39         0.92         1.94      94207     199343
$ time sync
real	0m6.808s
user	0m0.000s
sys	0m0.110s
$ iostat -t -m  sdb4
Linux 2.6.39-020639-generic (dom) 	05/21/2011 	_x86_64_	(8 CPU)
05/21/2011 02:46:02 PM
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           2.47    0.01    1.25    8.01    0.00   88.26
Device:            tps    MB_read/s    MB_wrtn/s    MB_read    MB_wrtn
sdb4            127.40         0.92         1.94      94207     199356
$ time sync
real	0m6.628s
user	0m0.000s
sys	0m0.110s
$ iostat -t -m  sdb4
Linux 2.6.39-020639-generic (dom) 	05/21/2011 	_x86_64_	(8 CPU)
05/21/2011 02:46:55 PM
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           2.47    0.01    1.25    8.01    0.00   88.27
Device:            tps    MB_read/s    MB_wrtn/s    MB_read    MB_wrtn
sdb4            127.37         0.92         1.94      94207     199369
-- 
Tomasz Chmielewski
http://wpkg.org
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs"
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Stephane Chazelas
2011-May-22  09:34 UTC
Re: curious writes on mounted, not used btrfs filesystem
2011-05-21 14:58:21 +0200, Tomasz Chmielewski:> I have a btrfs filesystem (2.6.39) which is mounted, but otherwise, not used: > > # lsof -n|grep /mnt/btrfsprocesses with open fds are one thing. You could also have loop devices setup on it for instance.> # > > > I noticed that whenever I do "sync", btrfs will write for around 6.5s and write 13 MB (see below).[...] You could try and play with /proc/sys/vm/block_dump to see what is being written (remember to disable logging of kernel messages by syslog). -- Stephane -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Tomasz Chmielewski
2011-May-22  09:52 UTC
Re: curious writes on mounted, not used btrfs filesystem
On 22.05.2011 11:34, Stephane Chazelas wrote:> 2011-05-21 14:58:21 +0200, Tomasz Chmielewski: >> I have a btrfs filesystem (2.6.39) which is mounted, but otherwise, not used: >> >> # lsof -n|grep /mnt/btrfs > > processes with open fds are one thing. You could also have loop > devices setup on it for instance.I know. It''s _not_ used by anything.>> # >> >> >> I noticed that whenever I do "sync", btrfs will write for around 6.5s and write 13 MB (see below). > [...] > > You could try and play with /proc/sys/vm/block_dump to see what > is being written (remember to disable logging of kernel messages > by syslog).It doesn''t give me any hints, really. Can you try running these commands yourself: iostat -k 1 </your/btrfs/device> And in a second terminal: while true; do sync ; done To see if your btrfs makes writes on sync each time? -- Tomasz Chmielewski http://wpkg.org -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Swâmi Petaramesh
2011-May-22  15:21 UTC
Re: curious writes on mounted, not used btrfs filesystem
Le dimanche 22 mai 2011 à 10:34 +0100, Stephane Chazelas a écrit :> > > > I noticed that whenever I do "sync", btrfs will write for around 6.5s and write 13 MB (see below). > [...]I had also noticed here, without really paying further attention, that external USB HDs with a BTRFS mounted, but without any open files (and no possibly open files, these disks being only used for files backups and no direct work, no libraries, no spools, no progs, etc...), show some activity (LED flashing) when executing a "sync" when I would expect there''s nothing to be synced on them... -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Stephane Chazelas
2011-May-22  18:26 UTC
Re: curious writes on mounted, not used btrfs filesystem
2011-05-22 11:52:37 +0200, Tomasz Chmielewski: [...]> Can you try running these commands yourself: > > iostat -k 1 </your/btrfs/device> > > > And in a second terminal: > > while true; do sync ; done > > > To see if your btrfs makes writes on sync each time?[...] Yes it does. And I see: <7>[38554.244219] sync(3354): dirtied inode 1 (?) on dm-11 <7>[38554.244740] btrfs-submit-0(29134): WRITE block 301128 on dm-11 (56 sectors) <7>[38554.244774] btrfs-submit-0(29134): WRITE block 741832 on dm-11 (56 sectors) <7>[38554.249963] sync(3354): WRITE block 128 on dm-11 (8 sectors) <7>[38554.250010] sync(3354): WRITE block 131072 on dm-11 (8 sectors) <7>[38567.312908] sync(3356): dirtied inode 1 (?) on dm-11 <7>[38567.313330] btrfs-submit-0(29134): WRITE block 301256 on dm-11 (24 sectors) <7>[38567.313350] btrfs-submit-0(29134): WRITE block 741960 on dm-11 (24 sectors) <7>[38567.313358] btrfs-submit-0(29134): WRITE block 301288 on dm-11 (24 sectors) <7>[38567.313366] btrfs-submit-0(29134): WRITE block 741992 on dm-11 (24 sectors) <7>[38567.313393] btrfs-submit-0(29134): WRITE block 301312 on dm-11 (8 sectors) <7>[38567.313403] btrfs-submit-0(29134): WRITE block 742016 on dm-11 (8 sectors) <7>[38567.325194] sync(3356): WRITE block 128 on dm-11 (8 sectors) <7>[38567.325244] sync(3356): WRITE block 131072 on dm-11 (8 sectors) <7>[38570.374449] sync(3358): dirtied inode 1 (?) on dm-11 <7>[38570.374976] btrfs-submit-0(29134): WRITE block 301128 on dm-11 (56 sectors) <7>[38570.375011] btrfs-submit-0(29134): WRITE block 741832 on dm-11 (56 sectors) <7>[38570.379221] sync(3358): WRITE block 128 on dm-11 (8 sectors) <7>[38570.379272] sync(3358): WRITE block 131072 on dm-11 (8 sectors) <7>[38572.170816] sync(3359): dirtied inode 1 (?) on dm-11 <7>[38572.171289] btrfs-submit-0(29134): WRITE block 301256 on dm-11 (24 sectors) <7>[38572.171300] btrfs-submit-0(29134): WRITE block 741960 on dm-11 (24 sectors) <7>[38572.171304] btrfs-submit-0(29134): WRITE block 301288 on dm-11 (24 sectors) <7>[38572.171308] btrfs-submit-0(29134): WRITE block 741992 on dm-11 (24 sectors) <7>[38572.171320] btrfs-submit-0(29134): WRITE block 301312 on dm-11 (8 sectors) <7>[38572.171325] btrfs-submit-0(29134): WRITE block 742016 on dm-11 (8 sectors) <7>[38572.180338] sync(3359): WRITE block 128 on dm-11 (8 sectors) <7>[38572.180386] sync(3359): WRITE block 131072 on dm-11 (8 sectors) <7>[38574.186559] sync(3360): dirtied inode 1 (?) on dm-11 <7>[38574.187090] btrfs-submit-0(29134): WRITE block 301128 on dm-11 (56 sectors) <7>[38574.187125] btrfs-submit-0(29134): WRITE block 741832 on dm-11 (56 sectors) <7>[38574.191602] sync(3360): WRITE block 128 on dm-11 (8 sectors) <7>[38574.191654] sync(3360): WRITE block 131072 on dm-11 (8 sectors) <7>[38576.370003] sync(3361): dirtied inode 1 (?) on dm-11 <7>[38576.370452] btrfs-submit-0(29134): WRITE block 301256 on dm-11 (24 sectors) <7>[38576.370470] btrfs-submit-0(29134): WRITE block 741960 on dm-11 (24 sectors) <7>[38576.370478] btrfs-submit-0(29134): WRITE block 301288 on dm-11 (24 sectors) <7>[38576.370485] btrfs-submit-0(29134): WRITE block 741992 on dm-11 (24 sectors) <7>[38576.370513] btrfs-submit-0(29134): WRITE block 301312 on dm-11 (8 sectors) <7>[38576.370523] btrfs-submit-0(29134): WRITE block 742016 on dm-11 (8 sectors) <7>[38576.379718] sync(3361): WRITE block 128 on dm-11 (8 sectors) <7>[38576.379766] sync(3361): WRITE block 131072 on dm-11 (8 sectors) Every other sync the same. -- Stephane -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html