From owner-freebsd-fs@FreeBSD.ORG Mon Aug 13 08:57:57 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 23DF91065672 for ; Mon, 13 Aug 2012 08:57:57 +0000 (UTC) (envelope-from prvs=15723815ec=killing@multiplay.co.uk) Received: from mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) by mx1.freebsd.org (Postfix) with ESMTP id A277F8FC08 for ; Mon, 13 Aug 2012 08:57:56 +0000 (UTC) X-Spam-Processed: mail1.multiplay.co.uk, Mon, 13 Aug 2012 09:57:51 +0100 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail1.multiplay.co.uk X-Spam-Level: X-Spam-Status: No, score=-5.0 required=6.0 tests=USER_IN_WHITELIST shortcircuit=ham autolearn=disabled version=3.2.5 Received: from r2d2 ([188.220.16.49]) by mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (MDaemon PRO v10.0.4) with ESMTP id md50021208306.msg for ; Mon, 13 Aug 2012 09:57:50 +0100 X-MDRemoteIP: 188.220.16.49 X-Return-Path: prvs=15723815ec=killing@multiplay.co.uk X-Envelope-From: killing@multiplay.co.uk X-MDaemon-Deliver-To: freebsd-fs@freebsd.org Message-ID: <66DF83E4BF514482A094F6F61E24752B@multiplay.co.uk> From: "Steven Hartland" To: "Konstantin Belousov" , "Poul-Henning Kamp" References: <48610.1344847476@critter.freebsd.dk> Date: Mon, 13 Aug 2012 09:58:08 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: freebsd-fs@freebsd.org, Petri Helenius 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 08:57:57 -0000 ----- Original Message ----- From: "Poul-Henning Kamp" >>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. cam da already has this option with the sysctl:- kern.cam.da.X.delete_method = ZERO This however requires the underlying SCSI device supports Write Same (WS10 or WS16) which seems to fairly rare. 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. If this was done care should be take with regards performance as this will be significantly slower than the current methods. That said if the underlying device "supports" trim / unmap it could interpret that how it sees fit. Regards Steve ================================================ 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. 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.