Chunhuan.Shen at Sun.COM
2009-Jul-13 02:44 UTC
[zfs-discuss] questions regarding RFE 6334757 and CR 6322205 disk write cache. thanks (case 11356581)
Hello experts, I would like consult you some questions regarding RFE 6334757 and CR 6322205 (disk write cache). =========================================RFE 6334757 disk write cache should be enabled and should have a tool to switch it on and off CR 6322205 Enable disk write cache if ZFS owns the disk ========================================= The cu found on SPARC Enterprise T5140, "Disk Write cache" was disable when it was shifted from Sun factory, but after install ZFS, "Disk Write cache" turned to be enable. My questions are 1) When SPARC Enterprise T5140 was shifted from factory, is the value of Disk Write cache set to disabled, right ? From RFE 6334757, we can see it is disable when shifted from factory, but I am not sure.. 2) On Solaris10, after installing ZFS and Zone, will the value of Disk Write cache be set to enable ? After what action is done, the value of Disk Write cache will be changed ? From CR 6322205, we can see as long as ZFS owns the disk, "Disk Write cache" will be set to enable, but what is the operation for "ZFS owns the disk" ? CR 6322205 Enable disk write cache if ZFS owns the disk 3) If change the value of Disk Write cache from enabled to disable, is there any impact/problem to the system ? ? 4) For FRU parts, Write cache has been set to disabled, right ? Thank you very much. Best Regards chunhuan
sean walmsley
2009-Jul-13 19:27 UTC
[zfs-discuss] questions regarding RFE 6334757 and CR 6322205 disk write cache. thanks (case 11356581)
1) Turning on write caching is potentially dangerous because the disk will indicate that data has been written (to cache) before it has actually been written to non-volatile storage (disk). Since the factory has no way of knowing how you''ll use your T5140, I''m guessing that they set the disk write caches off by default. 2) Since ZFS "knows" about disk caches and ensures that it issues synchronous writes where required, it is safe to turn on write caching when the *ENTIRE* disk is used for ZFS. Accordingly, ZFS will attempt to turn on a disk''s write cache whenever you add the *ENTIRE* disk to a zpool. If you add only a disk slice to a zpool, ZFS will not try to turn on write caching since it doesn''t know whether other portions of the disk will be used for applications which are not write-cache safe. zpool create pool01 c0t0d0 <- ZFS will try to turn on disk write cache since using entire disk zpool create pool02 c0t0d0s1 <- ZFS will not try to turn on disk write cache (only using 1 slice) To avoid future disk replacement problems (e.g. if the replacement disk is slightly smaller), we generally create a single disk slice that takes up almost the entire disk and then build our pools on these slices. ZFS doesn''t turn on the write cache in this case, but since we know that the disk is only being used for ZFS we can (and do!) safety turn on the write cache manually. 3) You can change the write (and read) cache settings using the "cache" submenu of the "format -e" command. If you disable the write cache where it could safely be enabled you will only reduce the performance of the system. If you enable the write cache where it should not be enabled, you run the risk of data loss and/or corruption in the event of a power loss. 4) I wouldn''t assume any particular setting for FRU parts, although I believe that Sun parts generally ship with the write caches disabled. Better to explicitly check using "format -e". -- This message posted from opensolaris.org
sean walmsley
2009-Jul-13 19:28 UTC
[zfs-discuss] questions regarding RFE 6334757 and CR 6322205 disk write cache. thanks (case 11356581)
Something caused my original message to get cut off. Here is the full post: 1) Turning on write caching is potentially dangerous because the disk will indicate that data has been written (to cache) before it has actually been written to non-volatile storage (disk). Since the factory has no way of knowing how you''ll use your T5140, I''m guessing that they set the disk write caches off by default. 2) Since ZFS "knows" about disk caches and ensures that it issues synchronous writes where required, it is safe to turn on write caching when the *ENTIRE* disk is used for ZFS. Accordingly, ZFS will attempt to turn on a disk''s write cache whenever you add the *ENTIRE* disk to a zpool. If you add only a disk slice to a zpool, ZFS will not try to turn on write caching since it doesn''t know whether other portions of the disk will be used for applications which are not write-cache safe. zpool create pool01 c0t0d0 ZFS will try to turn on disk write cache since using entire disk zpool create pool02 c0t0d0s1 ZFS will not try to turn on disk write cache (only using 1 slice) To avoid future disk replacement problems (e.g. if the replacement disk is slightly smaller), we generally create a single disk slice that takes up almost the entire disk and then build our pools on these slices. ZFS doesn''t turn on the write cache in this case, but since we know that the disk is only being used for ZFS we can (and do!) safety turn on the write cache manually. 3) You can change the write (and read) cache settings using the "cache" submenu of the "format -e" command. If you disable the write cache where it could safely be enabled you will only reduce the performance of the system. If you enable the write cache where it should not be enabled, you run the risk of data loss and/or corruption in the event of a power loss. 4) I wouldn''t assume any particular setting for FRU parts, although I believe that Sun parts generally ship with the write caches disabled. Better to explicitly check using "format -e". -- This message posted from opensolaris.org