From owner-freebsd-stable@FreeBSD.ORG Mon May 31 13:48:55 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D78F4106568A for ; Mon, 31 May 2010 13:48:55 +0000 (UTC) (envelope-from paul@gromit.dlib.vt.edu) Received: from lennier.cc.vt.edu (lennier.cc.vt.edu [198.82.162.213]) by mx1.freebsd.org (Postfix) with ESMTP id 8A51D8FC0A for ; Mon, 31 May 2010 13:48:55 +0000 (UTC) Received: from dagger.cc.vt.edu (dagger.cc.vt.edu [198.82.163.114]) by lennier.cc.vt.edu (8.13.8/8.13.8) with ESMTP id o4VDlINX016851; Mon, 31 May 2010 09:48:18 -0400 Received: from auth3.smtp.vt.edu (EHLO auth3.smtp.vt.edu) ([198.82.161.152]) by dagger.cc.vt.edu (MOS 4.1.8-GA FastPath queued) with ESMTP id JBM58237; Mon, 31 May 2010 09:48:17 -0400 (EDT) Received: from gromit.chumby.lan (c-98-249-7-145.hsd1.va.comcast.net [98.249.7.145]) (authenticated bits=0) by auth3.smtp.vt.edu (8.13.8/8.13.8) with ESMTP id o4VDmGb8006742 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 31 May 2010 09:48:17 -0400 Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Paul Mather In-Reply-To: <19664824-1B23-4E5F-BC12-BB4D59A9C8AA@ee.ryerson.ca> Date: Mon, 31 May 2010 09:48:16 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: <7B30E5C6-07F9-4B61-9F09-1615D21F6461@gromit.dlib.vt.edu> References: <4C017419.9010909@strauser.com> <4632C12D-2B1E-4073-B2C9-E9D15C212EF1@ee.ryerson.ca> <19664824-1B23-4E5F-BC12-BB4D59A9C8AA@ee.ryerson.ca> To: David Magda X-Mailer: Apple Mail (2.1078) X-Mirapoint-Received-SPF: 198.82.161.152 auth3.smtp.vt.edu paul@gromit.dlib.vt.edu 5 none X-Mirapoint-IP-Reputation: reputation=neutral-1, source=Fixed, refid=n/a, actions=MAILHURDLE SPF TAG X-Junkmail-Info: (0) X-Junkmail-Status: score=10/50, host=dagger.cc.vt.edu X-Junkmail-SD-Raw: score=unknown, refid=str=0001.0A02020A.4C03BE22.00E9,ss=1,fgs=0, ip=98.249.7.145, so=2009-09-22 00:05:22, dmn=2009-09-10 00:05:08, mode=multiengine X-Junkmail-IWF: false Cc: FreeBSD-STABLE Mailing List Subject: Re: Make ZFS auto-destroy snapshots when the out of space? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2010 13:48:55 -0000 On May 30, 2010, at 10:35 PM, David Magda wrote: > An event framework would certainly be helpful in a general sense = (Linux has event(3) AFAIK), and that could certainly be useful for = purging snapshots during resource constrained situations. But even if we = don't have it, I doubt a fork(2) from cron(8) and a statfs(2) would be = onerous on a system. :) Devd already receives several ZFS-based events (failed vdev, I/O error, = checksum mismatch, etc.), so perhaps it would be useful to add another, = e.g., "space" which is set to be triggered when a pool attains a certain = percentage full. This could default to 100%, but be capable of being = set lower by an associated kernel sysctl. You could then have any = auto-pruning/snapshot management script triggered from devd. (You'd = probably also have to figure out some kind of throttling mechanism for = this devd event, too.) Cheers, Paul.