From owner-freebsd-hackers@freebsd.org Tue Dec 8 18:52:28 2015 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B67E79D316B for ; Tue, 8 Dec 2015 18:52:28 +0000 (UTC) (envelope-from killing@multiplay.co.uk) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 540B61529 for ; Tue, 8 Dec 2015 18:52:27 +0000 (UTC) (envelope-from killing@multiplay.co.uk) Received: by wmuu63 with SMTP id u63so192791246wmu.0 for ; Tue, 08 Dec 2015 10:52:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=mU3kRmJ/3/sBJa2nYH+e/17ma1hDA/6FixHoARuewAY=; b=vX9yH5sE1QGSsd+rnyclKsx7cTyLBFoGnG5IqVwoPdW1rfb4pNGD+x1mj4T5zXCUOK X1U08S8Z3m/H/45NXzH8cP+yHPivUeipJbcR+s7EvHPg7gfwvcTE1GlevMC3SCY3uc9e lymEglsscqjpnjEbIktd19yrBBsqCOe1Gc9mVRKjxC0XckH+hqVsXp0egwq+mIVq8Ilx THQbKpNbMpfr+GLA8UyCYPsHJYYPZfP4BxIjzrI3ZCogPtd+d7nICHc7cIoOFlQY8Sz3 Ds8tHwv4+fHNtdMdYIA3YUBTZ1KkBNxuR1c/+c90zV44dSn8ESEiZywbz+TqZAqs3st8 AV5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=mU3kRmJ/3/sBJa2nYH+e/17ma1hDA/6FixHoARuewAY=; b=KLmKNijlcddc80b9z+pZlwmfZVFvCTpn2AKQOl4ze162sz7BSSf3ReeryX0N6Ymv6W 7ELFPkuhuA6OOSJrzQuzaOUpfTVbkRU39AxJ14FHsb3G+6C5Z1oI1vN08vAt5plbZ3au 0nogIEJzSaB9FxrfuczDqQu8pMSX/8VJX4FaFrT46X0zNzmeWgfXiW/fFaOri3EGytiB eh9GVBikpX0U50zu45F6a8gdsFFE0cWQZcPuzMrJJ8TF7/vmbewl/wT6BidKjLwtDAgT uDXgaYvbGiozGA3Ar8KHNZqcwPyGmPCff59ZkaB2jctbqb1i6LI9CoCImxZZS6Ldk40g IMIQ== X-Gm-Message-State: ALoCoQnwiuPN9ypvz/AvKhTi3gfstr57/aXOvJIjg/kfUd2tgY1J3VIxQhxz5Kzaz3UhO6PGVvAOIhWXAFQBJgil54qWHbvp8g== X-Received: by 10.194.134.102 with SMTP id pj6mr1307903wjb.23.1449600745047; Tue, 08 Dec 2015 10:52:25 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id uz5sm4186446wjc.8.2015.12.08.10.52.23 for (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Dec 2015 10:52:24 -0800 (PST) Subject: Re: Fwd: DELETE support in the VOP_STRATEGY(9)? To: freebsd-hackers@freebsd.org References: <201512052002.tB5K2ZEA026540@chez.mckusick.com> <86poyhqsdh.fsf@desk.des.no> <86fuzdqjwn.fsf@desk.des.no> <864mfssxgt.fsf@desk.des.no> <86wpsord9l.fsf@desk.des.no> From: Steven Hartland Message-ID: <566726ED.2010709@multiplay.co.uk> Date: Tue, 8 Dec 2015 18:52:29 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <86wpsord9l.fsf@desk.des.no> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 18:52:28 -0000 On 08/12/2015 18:44, Dag-Erling Smørgrav wrote: > Warner Losh writes: >> Dag-Erling Smørgrav writes: >>> But the filesystem does not know whether the underlying storage is >>> electromechanical or solid-state, nor does it know whether the user >>> cares much about seek times (unless we introduce the heuristic >>> "avoid creating holes unless the file already has them, in which >>> case the userland probably does not care"). >> Actually, the filesystem does know. Or has some knowledge of what >> is supported and what isn't. BIO_DELETE support is a strong indicator >> of a flash or other log-type system. > The filesystem can ask the layer below if BIO_DELETE is supported, but > should not assume anything about what it means. For instance, I could > write a gnop-like module that translates BIO_DELETE into an all-zeroes > BIO_WRITE and passes everything else unmodified. It would provide a > stronger guarantee than, say, SATA TRIM but would also have a completely > different performance profile (even on SSDs, since it would do its work > synchronously whereas TRIM works asynchronously). > > Anyway, my point is that Maxim needs to revise his assumptions. Just to clarify most consumer devices process TRIM synchronously, not asynchronously. Your example isn't actually just an example CAM scsi_da has a number of different ways it can process BIO_DELETE: * ATA TRIM * SCSI UMAP * Write Same 16 * Write Same 10 * Zero So you example is actually exists in practice in the FreeBSD code base ;-) Regards Steve