Re: [btrfs] Periodic write spikes while idling, on btrfs root

2013-03-03 Thread Brendan Hide

On 2013/02/14 12:15 PM, Vedant Kumar wrote:

Hello,

I'm experiencing periodic write spikes while my system is idle.

...

turned out to be some systemd log in
/var/log/journal. I turned off journald and rebooted, but the write spike
behavior remained.

...

best,
-vk

I believe btrfs syncs every 30 seconds (if anything's changed).

This sounds like systemd's journal is not actually disabled and that it 
is simply logging new information every few seconds and forcing it to be 
synced to disk. Have you tried following the journal as root to see what 
is being logged?

journalctl -f

Alternatively, as another measure to troubleshoot, in 
/etc/systemd/journald.conf, change the Storage= option either to none 
(which disables logging completely) or to a path inside a tmpfs, thereby 
eliminating btrfs' involvement.


--
__
Brendan Hide
http://swiftspirit.co.za/
http://www.webafrica.co.za/?AFF1E97

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


[btrfs] Periodic write spikes while idling, on btrfs root

2013-02-14 Thread Vedant Kumar
Hello,

I'm experiencing periodic write spikes while my system is idle.

According to iotop, they're being caused by btrfs-endio-write,
btrfs-transaction, and btrfs-dealloc. Mostly, the issue is with
endio-write: I've seen up to four of these processes write at the
same time. Using iostat, I've determined that these writes range from
1 to 6 megabytes in size, and that they occur roughly every 5 seconds.

These write spikes may prevent my disk from spinning down and lower
my battery life.

I fetched the latest unpatched mainline kernel and modified
linux/fs/btrfs/inode.c:2051 to add a debugging printk() inside of
btrfs_writepage_end_io_hook(). After running that kernel, I can confirm
two things;

1. The write spikes occur whenever btrfs does:

/* btrfs/inode.c:2051 */
workers = root-fs_info-endio_write_workers;
btrfs_queue_worker(workers, ordered_extent-work);

2. The write spikes seem to affect only one inode. That is to say, every
time there is a write spike, my printk() indicates that it is the exact
same inode being written to over and over again.

I actually scanned my entire disk for this mysterious inode (using
find / -inum ...), and it turned out to be some systemd log in
/var/log/journal. I turned off journald and rebooted, but the write spike
behavior remained. I tried removing write priviliges to that file and then
deleting it outright, but endio-write just picked another inode to write
to (which was again in /var/log/journal!).

I am not a kernel hacker and I'm not absolutely convinced this is a btrfs
issue, but I'd appreciate some pointers in the right direction.

best,
-vk
--
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