From owner-freebsd-hackers@freebsd.org Tue Dec 8 19:17:18 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 C47BC9D497A for ; Tue, 8 Dec 2015 19:17:18 +0000 (UTC) (envelope-from killing@multiplay.co.uk) Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::236]) (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 58C8A1068 for ; Tue, 8 Dec 2015 19:17:18 +0000 (UTC) (envelope-from killing@multiplay.co.uk) Received: by wmww144 with SMTP id w144so193596300wmw.1 for ; Tue, 08 Dec 2015 11:17:16 -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=XVvNtyW3bMRyYKACo6Fbj2SnwjD8iSeoKzrbj1z7FOE=; b=h6LkizQz8ShZ1CpOiWRFeFXnDDYZVDV2764I5M1bz26Wc12ZgEPU2M2GfCPY62Bigi pXfryHfR+O9NgAQsyal5kwKobsYJPFuQuDXFBCUIcrDfMYpHb8TkoYjSYF7T2Q78P5W0 NAC0wDPOgwrAv/RmLTh3kZj0WpY3ZxXjFtvrT6TkfAqAJMEqIxvQqDjGk6xpIrPPOWYK Faw9+NRCJSd18YIxuGPsIWzhGYI1lq+aODp9+/OlQdxYk87fVe+/iEBINpyDMFI692Pu 6bzZLZQ0AMzhkhdODAz7oCP3BT9PLUGQw9USjUifr9Tmr0yfvaW8fr6ZUIWIhBApEf+i xzIA== 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=XVvNtyW3bMRyYKACo6Fbj2SnwjD8iSeoKzrbj1z7FOE=; b=HeICt3X6Mi0o5XPFlbnqEwR3HIqw2mETLnZfR1BbNdNi1iQhf/a1y4JD8pBK2CDCtj HzZyCCEdTjowiZ9NvNdQc22Io5J2ZZRBGLdT0BBhXK66BgaKRnyAcwj9FuL4Zshd9SsJ lgE2tJdJKyu9QNzpF78aUpqc3P5BpWr6vjoE7TpdSPI+YiFHrIQwrH5XMfLfVjV0oJMl HKVhhXYPZCLc/1BCq+3Z7nsUwCN/1083lY153YGSWSjxCXGLVMaxYK5BblNC07ojxzck jFSJeNbwrGqTUABW+jx5Z6bg0Gl7MPYAQRX3ZWn6kt4d+m/1q3ZrMjrKZbruHKB5dMIi ijYg== X-Gm-Message-State: ALoCoQmyhRTzMCDUjtRbEjRP2JdgxRlEYgorQxwstb6SE95uQhn9GjI/ncVXLT/wBRrCjwkepn1eJmFFNNd8hKJdC2/tQvUAEg== X-Received: by 10.28.172.129 with SMTP id v123mr6335101wme.47.1449602236621; Tue, 08 Dec 2015 11:17:16 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id ft4sm4212150wjb.37.2015.12.08.11.17.15 for (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Dec 2015 11:17:15 -0800 (PST) Subject: Re: Fwd: DELETE support in the VOP_STRATEGY(9)? To: freebsd-hackers@freebsd.org References: <86poyhqsdh.fsf@desk.des.no> <86fuzdqjwn.fsf@desk.des.no> <864mfssxgt.fsf@desk.des.no> <86wpsord9l.fsf@desk.des.no> <20151208185818.GD82577@kib.kiev.ua> <20151208190622.GE82577@kib.kiev.ua> From: Steven Hartland Message-ID: <56672CC1.7040809@multiplay.co.uk> Date: Tue, 8 Dec 2015 19:17:21 +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: <20151208190622.GE82577@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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 19:17:18 -0000 On 08/12/2015 19:06, Konstantin Belousov wrote: > On Tue, Dec 08, 2015 at 08:58:18PM +0200, Konstantin Belousov wrote: >> On Tue, Dec 08, 2015 at 07:44:38PM +0100, 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). >> I again agree. This is how UFS issues TRIM. When the data block is freed >> and there are no dandling pointers in the inode copy on disk pointing to >> the block, BIO_DELETE is issued if volume reports it. Everything else >> is up to the geom stack and driver. > I am sorry for the followup mail, but I probably have to explain more. > The freed block, for which BIO_DELETE is issued, is not marked as free > in the bitmap, until the BIO_DELETE completion is reported. In other > words, we do not reuse the freed block while TRIM command is possibly > executed. This is the same for ZFS.