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

Developer discussions.

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

Postby 文陳 » Sun Apr 06, 2014 10:22 am

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
Last edited by 文陳 on Mon Apr 07, 2014 8:38 pm, edited 1 time in total.
文陳
 
Posts: 3
Joined: Sun Apr 06, 2014 10:02 am
Location: Hsichih

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

Postby lundman » Sun Apr 06, 2014 4:41 pm

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.
User avatar
lundman
 
Posts: 1337
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

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

Postby 文陳 » Mon Apr 07, 2014 9:07 am

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
文陳
 
Posts: 3
Joined: Sun Apr 06, 2014 10:02 am
Location: Hsichih

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

Postby lundman » Mon Apr 07, 2014 5:05 pm

User avatar
lundman
 
Posts: 1337
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

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

Postby 文陳 » Mon Apr 07, 2014 8:38 pm

Great!
文陳
 
Posts: 3
Joined: Sun Apr 06, 2014 10:02 am
Location: Hsichih


Return to OpenZFS on OS X Development

Who is online

Users browsing this forum: No registered users and 18 guests