Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751728Ab0KYEY6 (ORCPT ); Wed, 24 Nov 2010 23:24:58 -0500 Received: from rcsinet10.oracle.com ([148.87.113.121]:23118 "EHLO rcsinet10.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751343Ab0KYEY5 (ORCPT ); Wed, 24 Nov 2010 23:24:57 -0500 To: Mark Lord Cc: "Ted Ts'o" , Lukas Czerner , Steven Whitehouse , James Bottomley , Christoph Hellwig , Matthew Wilcox , Josef Bacik , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, sandeen@redhat.com Subject: Re: [PATCH 1/2] fs: Do not dispatch FITRIM through separate super_operation From: "Martin K. Petersen" Organization: Oracle References: <20101118134804.GN5618@dhcp231-156.rdu.redhat.com> <20101118141957.GK6178@parisc-linux.org> <20101118142918.GA18510@infradead.org> <1290100750.3041.72.camel@mulgrave.site> <1290168976.2570.45.camel@dolmen> <4CE68155.50705@teksavvy.com> <20101119140203.GC10039@thunk.org> <4CE69940.6040908@teksavvy.com> <20101119163013.GJ10039@thunk.org> <4CEDCE60.9050109@teksavvy.com> Date: Wed, 24 Nov 2010 23:23:34 -0500 In-Reply-To: <4CEDCE60.9050109@teksavvy.com> (Mark Lord's message of "Wed, 24 Nov 2010 21:48:00 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1549 Lines: 38 >>>>> "Mark" == Mark Lord writes: Mark> But mke2fs probably is NOT doing a "single big discard", because Mark> for SATA the TRIM command is limited to 64K sectors per Mark> range.. and the in-kernel TRIM code only ever does single ranges.. How many times must I reiterate that this is not true? Due to various limitations in the way the block layer works we can not clear LBA 10 to 20 and LBA 40 to 50 in one command. We don't have an infrastructure in place that allows us to operate on several discrete areas in one request. But for contiguous areas we will cram as many ranges entries in as we can fit in the TRIM payload. This means we'll issue one TRIM command for every 2 GiB minus change (65535*64*512 / 1048576 = 2047 MiB). In your example above blkdev_issue_discard() will loop over the 100 GiB range requested by the caller (filesystem or BLKDISCARD ioctl) and issue about fifty TRIM commands to the drive. Large discards are a best-case scenario (short of SECURE ERASE). So if your drive takes forever to perform this operation then all bets are off in the TRIM department. Mark> So doing a discard over an entire drive-encompassing partition, Mark> say.. 100GB, will require 3000+ individual TRIM commands. No. -- Martin K. Petersen Oracle Linux Engineering -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/