From owner-freebsd-fs@FreeBSD.ORG Mon Aug 13 09:00:33 2012 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F30681065676 for ; Mon, 13 Aug 2012 09:00:33 +0000 (UTC) (envelope-from petri@helenius.fi) Received: from mail.helenius.fi (mail.helenius.fi [IPv6:2001:67c:164:40::91]) by mx1.freebsd.org (Postfix) with ESMTP id 7F70A8FC1B for ; Mon, 13 Aug 2012 09:00:33 +0000 (UTC) Received: from mail.helenius.fi (localhost [127.0.0.1]) by mail.helenius.fi (Postfix) with ESMTP id B7F3940DC; Mon, 13 Aug 2012 09:00:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at helenius.fi Received: from mail.helenius.fi ([127.0.0.1]) by mail.helenius.fi (mail.helenius.fi [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1I22PA+bEFbp; Mon, 13 Aug 2012 09:00:18 +0000 (UTC) Received: from d141.dyn.helenius.fi (d141.dyn.helenius.fi [83.150.121.141]) (Authenticated sender: pete) by mail.helenius.fi (Postfix) with ESMTPA; Mon, 13 Aug 2012 09:00:17 +0000 (UTC) Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1485\)) Content-Type: text/plain; charset=iso-8859-1 From: Petri Helenius X-Priority: 3 In-Reply-To: <66DF83E4BF514482A094F6F61E24752B@multiplay.co.uk> Date: Mon, 13 Aug 2012 12:00:17 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <8A6340E3-87B4-45EC-B4B2-8E705FE934E8@helenius.fi> References: <48610.1344847476@critter.freebsd.dk> <66DF83E4BF514482A094F6F61E24752B@multiplay.co.uk> To: "Steven Hartland" X-Mailer: Apple Mail (2.1485) Cc: freebsd-fs@freebsd.org, Poul-Henning Kamp Subject: Re: zero deleted blocks X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Aug 2012 09:00:34 -0000 Obviously the most elegant way would be for KVM, Xen and VMware to = support TRIM/UNMAP... Pete On Aug 13, 2012, at 11:58 , "Steven Hartland" = wrote: > ----- Original Message ----- From: "Poul-Henning Kamp" = >=20 >=20 >>> I think TRIM support in UFS can be extended to zero-out the deleted >>> blocks, with relatively small amount of work. Basically, in >>> ufs/ffs/ffs_alloc.c:ffs_blkfree(), a BIO_WRITE of zero buffer shall = be >>> issued instead of BIO_DELETE. >> It would be a better idea to give geom_disk a per-disk option to >> convert BIO_DELETE to writes of zeros. >=20 > cam da already has this option with the sysctl:- > kern.cam.da.X.delete_method =3D ZERO >=20 > This however requires the underlying SCSI device supports > Write Same (WS10 or WS16) which seems to fairly rare. >=20 > I'm not aware of any an equivalent ATA command, but it would > be possible to have both use a standard write to achieve that. >=20 > If this was done care should be take with regards performance > as this will be significantly slower than the current methods. >=20 > That said if the underlying device "supports" trim / unmap > it could interpret that how it sees fit. >=20 > Regards > Steve >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > This e.mail is private and confidential between Multiplay (UK) Ltd. = and the person or entity to whom it is addressed. In the event of = misdirection, the recipient is prohibited from using, copying, printing = or otherwise disseminating it or any information contained in it.=20 > In the event of misdirection, illegible or incomplete transmission = please telephone +44 845 868 1337 > or return the E.mail to postmaster@multiplay.co.uk. >=20