ZFS doing background writes?

Sean Chittenden seanc at groupon.com
Fri Mar 20 15:21:46 UTC 2015


Is atime set on any of your zfs file systems?  Grab dtrace, write a probe
to see what's doing the writes.  Here's a quick script that you can run via
`dtrace -s vfs-io.d`.  Not the greatest, but useful.  -sc

#!/usr/sbin/dtrace -s

#pragma D option quiet
#pragma D option bufsize=8m
#pragma D option switchrate=10hz
#pragma D option dynvarsize=16m

/* See /usr/src/sys/kern/uipc_mqueue.c for vop_read_args.
 * Also see sys/uio.h.
 */

vfs::vop_read:entry, vfs::vop_write:entry
{
        self->ts[stackdepth] = timestamp;
        this->size = args[1]->a_uio->uio_resid;
        this->name = probefunc == "vop_read" ? "Read" : "Write";
        @iosize1[execname, this->name] = quantize(this->size);
}

vfs::vop_read:return, vfs::vop_write:entry
/this->ts = self->ts[stackdepth]/
{
        this->name = probefunc == "vop_read" ? "Read" : "Write";
        @lat1[execname, this->name] = quantize(timestamp - this->ts);
        self->ts[stackdepth] = 0;
}

tick-1s
{
        printf("Latencies (ns)\n\n");
        printa("%s %s\n%@d\n", @lat1);
        printf("IO sizes (bytes)\n\n");
        printa("%s %s\n%@d\n", @iosize1);
        printf("--------------------------------------------\n\n");
        trunc(@lat1);
        trunc(@iosize1);
}




On Fri, Mar 20, 2015 at 7:53 AM, Ronald Klop <ronald-lists at klop.ws> wrote:

> On Tue, 17 Mar 2015 07:30:24 +0100, Dirk E <cipher_nl at hotmail.com> wrote:
>
>  On Mon, 16 Mar 2015, Steven Hartland wrote:
>>>
>>>  yes exactly that its defined by vfs.zfs.txg.timeout.
>>>>
>>>
>>> Well, but what data (modulo atimes, which I presume OP had turned off
>>> before)
>>> are written?
>>>
>>
>> I indeed have atime=off for the whole pool. But even with atime enabled,
>> this behaviour should not happen, since no files are being accessed. Surely
>> not in single user mode; the only processes outside of the kernel were
>> '/bin/sh' and 'top'. Or zpool iostat when i ran it.
>>
>> I left the machine on and after a bunch of hours it is still doing
>> periodical writes. The total ARC usage remains small: 5300K and changes
>> slightly over time - again with no host writes.
>>
>> Even unmounting all ZFS filesystems will NOT cause this behaviour to go
>> away. It seems to originate from the ZFS kernel itself, doing some
>> autonomous maintenance on the background, or other feature.'
>>
>> Using top to sort processes with the longest CPU TIME, i can see:
>>
>> idle: 27.9H
>> kernel: 6:48
>> intr: 4:34
>> zfskern: 0:33
>> geom: 0:29
>> syncer: 0:16
>> rand_harv 0:11
>> cam: 0:09
>> pf purge: 0:08
>> powerd: 0:03
>>
>> This machine has done very little than boot and import the pool. As can
>> be seen, the kernel and ZFS are pretty active in terms of CPU power.
>>
>> Anyone have a clue?
>>
>
> It sounds like I have the same problem. I did not get much reply on my
> question:
> https://lists.freebsd.org/pipermail/freebsd-fs/2014-September/020004.html
>
> Regards,
> Ronald.
> _______________________________________________
> freebsd-fs at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-fs
> To unsubscribe, send any mail to "freebsd-fs-unsubscribe at freebsd.org"
>



-- 
Sean Chittenden


More information about the freebsd-fs mailing list