On Jun 20, 2012, at 5:08 PM, Jim Klimov wrote:
> 2012-06-21 1:58, Richard Elling wrote:
>> On Jun 20, 2012, at 4:08 AM, Jim Klimov wrote:
>>> Also by default if you don't give the whole drive to ZFS, its cache
>>> may be disabled upon pool import and you may have to reenable it
>> The behaviour is to attempt to enable the disk's write cache if ZFS has the
>> whole disk. Relevant code:
>> http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/fs/zfs/vdev_disk.c#319
>> Please help us to stop propagating the misinformation that ZFS disables
>> write caches.
>>  -- richard
> I see, sorry. So, the possible states are:
> 1) Before pool import, disk cache was disabled; then pool is imported:
> 1a) If ZFS has whole disk (how is that defined BTW, since partitions
>    and slices are really used? Is the presence of a slice#7 which
>    is 16384 sector long the trigger?) - then cache is enabled;

by the command use:
        zpool create c0t0d0 ==> whole disk
        zpool create c0t0d0s0 ==> not whole disk

> 1b) ZFS does not have whole disk - cache is neither enabled nor
>    disabled;
> 2) Before import disk cache was enabled; after import: no change
>   regardless of "whole-diskness".


> Is this correct?
> How does a disk become "cache disabled" then - only manually?
> Or due to UFS usage? Or does it inherit HW setting? Or somehow else?

For Sun, it was done by setting the disk firmware.

> I think the cache is enabled in the OS by default…

In general, illumos does not touch the cache. I don't know of a way to
set the cache policy in most BIOSes. In some cases, you can set it using
format(1m), but whether it remains set after power-off depends on the
drive manufacturer.

Bottom line: don't worry about it.
 -- richard


ZFS and performance consulting

zfs-discuss mailing list

Reply via email to