Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Mar 2015 08:21:38 -0700
From:      Sean Chittenden <seanc@groupon.com>
To:        Ronald Klop <ronald-lists@klop.ws>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: ZFS doing background writes?
Message-ID:  <CACfj5vJFZTSYU=GDtMc_euJkkTe4YgOCqyfuUqRcN2TFnQ6k=g@mail.gmail.com>
In-Reply-To: <op.xvswzjnykndu52@ronaldradial.radialsg.local>
References:  <DUB131-W446C7C68BD022D901F040697020@phx.gbl> <55076B84.0@multiplay.co.uk> <alpine.BSF.2.00.1503170451150.82898@woozle.rinet.ru> <DUB131-W2A91120F53BDE3E17E23997030@phx.gbl> <op.xvswzjnykndu52@ronaldradial.radialsg.local>

next in thread | previous in thread | raw e-mail | index | archive | help
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@klop.ws> wrote:

> On Tue, 17 Mar 2015 07:30:24 +0100, Dirk E <cipher_nl@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@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-fs
> To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org"
>



-- 
Sean Chittenden



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACfj5vJFZTSYU=GDtMc_euJkkTe4YgOCqyfuUqRcN2TFnQ6k=g>