From owner-freebsd-fs@FreeBSD.ORG Sat Apr 30 22:27:29 2011 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 E4333106566B; Sat, 30 Apr 2011 22:27:29 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id B49FB8FC12; Sat, 30 Apr 2011 22:27:29 +0000 (UTC) Received: from julian-mac.elischer.org (home-nat.elischer.org [67.100.89.137]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id p3UMRPmV096016 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 30 Apr 2011 15:27:28 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <4DBC8D08.7030000@freebsd.org> Date: Sat, 30 Apr 2011 15:28:24 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 To: Alexander Motin References: <20110430072831.GA65598@icarus.home.lan> <4DBBE985.9000701@FreeBSD.org> In-Reply-To: <4DBBE985.9000701@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-fs@freebsd.org Subject: Re: TRIM clustering 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: Sat, 30 Apr 2011 22:27:30 -0000 On 4/30/11 3:50 AM, Alexander Motin wrote: > Julian Elischer wrote: >> On 4/30/11 12:28 AM, Jeremy Chadwick wrote: >>> On Sat, Apr 30, 2011 at 09:54:02AM +0300, Alexander Motin wrote: >>>> I've noticed that on file deletion from UFS with TRIM enabled, kernel >>>> issues BIO_DELETE for each 16K (block size?) separately -- thousands per >>>> second for single big file deletion. Fortunately ada driver will try to >>>> aggregate them for the device, but won't some clustering code worth to >>>> be there? >>> I'd like to know who decided it would be best to submit the TRIM command >>> automatically on every single block that is deemed free by UFS during >>> inode removal. The performance hit, from what I've been reading, from >>> doing this is quite severe. Many SSDs take hundreds of milliseconds to >>> complete TRIM operations, which greatly impacts filesystem performance. >>> I appreciate the efforts to get TRIM into FreeBSD for UFS, but the >>> implementation -- if what Alexander says is accurate -- seems like a bad >>> choice. >> well not all devices take it as a hit.. The suggestion of some sort of >> clustering is a good one but it should be tunable. > I believe any device should benefit from receiving single 128K request > instead of 8*16k. Just because of command processing overhead. Am I wrong? well if you never make the 16 k request because you are waiting for the other 112K to show up then I'd prefer the 16k request. I am not sure exactly of exact figures but I would think that about 16k would be a good cluster size for our devices.