Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755039Ab0KSPel (ORCPT ); Fri, 19 Nov 2010 10:34:41 -0500 Received: from bombadil.infradead.org ([18.85.46.34]:37045 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754849Ab0KSPej (ORCPT ); Fri, 19 Nov 2010 10:34:39 -0500 Date: Fri, 19 Nov 2010 10:34:26 -0500 From: Christoph Hellwig To: Mark Lord Cc: Christoph Hellwig , Greg Freemyer , "Martin K. Petersen" , James Bottomley , Jeff Moyer , Matthew Wilcox , Josef Bacik , Lukas Czerner , tytso@mit.edu, 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 Message-ID: <20101119153426.GA25655@infradead.org> References: <4CE59E57.2090009@teksavvy.com> <4CE5C616.7070706@teksavvy.com> <20101119115516.GA1152@infradead.org> <4CE6831E.4020606@teksavvy.com> <20101119140639.GA25488@infradead.org> <4CE68E2C.9070101@teksavvy.com> <20101119145423.GA27919@infradead.org> <4CE696C4.4030309@teksavvy.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4CE696C4.4030309@teksavvy.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1364 Lines: 26 On Fri, Nov 19, 2010 at 10:24:52AM -0500, Mark Lord wrote: > I wonder if this can be treated more like how SG_IO does things? > The SG_IO mechanism seems to have no issues passing through stuff > like this, so perhaps we could implement something in a similar fashion? We actually sent discards down as BLOCK_PC commands, which basically is SG_IO style I/O from kernelspace. But that caused a lot of problems with scsi error handling so we moved away from it. But even when you do a BLOCK_PC UNMAP command that later gets translated to a TRIM by libata you have a few issues: - you need to get partion offsets in the I/O sumitter to include them in every range. That's doable but a quite nasty layering violation, and it also prevents us from ever adding DM/MD support to that scheme. - you'll have to allocate new memory for the TRIM payload in libata, and switch the libata command to use it, instead of the current hack to reuse the zeroed page sent down with the WRITE SAME command. I tried to get the payload switching in libata to work a few times, but never managed to get it right. -- 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/