Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965183AbbHKOIT (ORCPT ); Tue, 11 Aug 2015 10:08:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34672 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964890AbbHKOIR (ORCPT ); Tue, 11 Aug 2015 10:08:17 -0400 Date: Tue, 11 Aug 2015 10:08:14 -0400 From: Mike Snitzer To: Kent Overstreet Cc: "Martin K. Petersen" , Ming Lin , axboe@fb.com, Christoph Hellwig , device-mapper development , Ming Lei , Christoph Hellwig , Alasdair Kergon , Lars Ellenberg , Philip Kelleher , Nitin Gupta , Ming Lin , Oleg Drokin , Al Viro , Jens Axboe , Andreas Dilger , Geoff Levand , Jiri Kosina , lkml , Jim Paris , Minchan Kim , Dongsu Park , drbd-user@lists.linbit.com, Joe Thornber Subject: Re: [PATCH v5 01/11] block: make generic_make_request handle arbitrarily sized bios Message-ID: <20150811140813.GA29369@redhat.com> References: <20150809064128.GB2436@infradead.org> <1439103347.7880.3.camel@hasee> <20150809070128.GA25739@infradead.org> <1439104707.7880.8.camel@hasee> <20150810150216.GA22719@redhat.com> <1439230696.26458.6.camel@ssi> <20150811024154.GA26351@redhat.com> <20150811033851.GA28533@kmo-pixel> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150811033851.GA28533@kmo-pixel> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2224 Lines: 47 On Mon, Aug 10 2015 at 11:38pm -0400, Kent Overstreet wrote: > On Mon, Aug 10, 2015 at 10:41:55PM -0400, Mike Snitzer wrote: > > On Mon, Aug 10 2015 at 10:00pm -0400, > > Martin K. Petersen wrote: > > > > > >>>>> "Ming" == Ming Lin writes: > > > > > > Ming> Did you mean still use (UINT_MAX >> 9) in blkdev_issue_discard()? > > > > > > Ming> But that doesn't work for dm-thinp. See Kent's suggestion to use > > > Ming> 1<<31. > > > > > > I'm not sure why things are not working for dm-thinp. Presumably Kent's > > > code would split the discard at a granularity boundary so why would that > > > cause problems for dm? > > > > DM-thinp processes discards internally before it passes them down (if > > configured to do so). If a discard is smaller than the granularity of a > > thinp block (whose size is configurable) or if the start and end of the > > discard's extent is misaligned (relative to the thinp blocks mapped to > > the logical extent) then the discard won't actually discard partial > > thinp blocks. > > This kind of logic really doesn't belong in dm - if it's needed, it really > belongs in bio_split() (which is supposed to work correctly for discards - so if > it is needed, then bio_split() needs fixing...) DM thinp does advertise discard_granularity that reflects the thinp blocksize. blk_queue_split() does look like it'd do the right thing. But the splitting that DM thinp is doing is a long standing implementation (in DM core) that will need to be carefully reviewed/rewritten. We can tackle it after all this late splitting code lands. > IMO though it belongs in the driver - if a discard needs to be dropped because > it's too small and the hardware can't do it, that should be the driver's > responsibility. This isn't about the hardware's limits. This is about the intermediate remapping/stacking driver's own space management hooking off of the discard bio too. -- 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/