Page 1 of 1

Disk write every 25s even if system is idle(Resolved)

PostPosted: Sun Apr 06, 2014 10:22 am
by 文陳
I found that zfs pool suffer from unknown write periodically.
I can observe this by zpool iostat zdisk0 1
But I can not see anything when I use `iotop -m /zdisk0` or `iotop -m /zdisk0`
I guess that is txg sync and as I know txg sync while there are dirty data.

Reproduce step
1.create a pool
2. don't do anything
3.zpool iostat 1
4. wait 30s

Re: Disk write every 25s even if system is idle

PostPosted: Sun Apr 06, 2014 4:41 pm
by lundman
Some users have noticed this as well, as detailed in this issue:

https://github.com/openzfsonosx/zfs/issues/117

I have yet to look into it. The dmu pool sync is every 5 seconds.

Re: Disk write every 25s even if system is idle

PostPosted: Mon Apr 07, 2014 9:07 am
by 文陳
As I trace code and using DTrace:
I found that root cause it mac os issue vfs sync every 25s.
=================
zfs`spa_sync_allpools+0xad
zfs`zfs_vfs_sync+0x18
mach_kernel`VFS_SYNC+0xc6
mach_kernel`0xffffff80003e4b30+0x43
mach_kernel`vfs_iterate+0x10a
mach_kernel`sync+0x17
mach_kernel`unix_syscall64+0x1f3
mach_kernel`hndl_unix_scall64+0x16
==================
And we handle zfs_vfs_sync as spa_sync_allpools.
spa_sync_allpools force txg to move on and force uberblock updating even if there is no dirty data.

In face, we should separate each vfs and handle this sync call by zil_commit.(just like FreeBSD/Linux)

You can re-produce this issue by just typing 'sync' from the terminal.


http://opensource.apple.com/source/laun ... te_thread()

launchd call sync() every 30s

Re: Disk write every 25s even if system is idle

PostPosted: Mon Apr 07, 2014 5:05 pm
by lundman

Re: Disk write every 25s even if system is idle(Resolved)

PostPosted: Mon Apr 07, 2014 8:38 pm
by 文陳
Great!