From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753062AbbJMLvO (ORCPT ); Tue, 13 Oct 2015 07:51:14 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:48696 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752867AbbJMLuO (ORCPT ); Tue, 13 Oct 2015 07:50:14 -0400 Date: Tue, 13 Oct 2015 04:50:11 -0700 From: Christoph Hellwig To: Ming Lin Cc: linux-kernel@vger.kernel.org, Jens Axboe , Kent Overstreet , Dongsu Park , Mike Snitzer , "Martin K. Petersen" , Ming Lin , linux-nvme@lists.infradead.org Subject: Re: [PATCH v6 05/11] block: remove split code in blkdev_issue_{discard,write_same} Message-ID: <20151013115011.GA6546@infradead.org> References: <1439363241-31772-1-git-send-email-mlin@kernel.org> <1439363241-31772-6-git-send-email-mlin@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1439363241-31772-6-git-send-email-mlin@kernel.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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 On Wed, Aug 12, 2015 at 12:07:15AM -0700, Ming Lin wrote: > From: Ming Lin > > The split code in blkdev_issue_{discard,write_same} can go away > now that any driver that cares does the split. We have to make > sure bio size doesn't overflow. > > For discard, we set max discard sectors to (1<<31)>>9 to ensure > it doesn't overflow bi_size and hopefully it is of the proper > granularity as long as the granularity is a power of two. This ends up breaking discard on NVMe devices for a me. An mkfs.xfs which does a discard of the whole device now hangs the system. Something in here makes it send discard command that the device doesn't like and the aborts don't seem to help either, although that might be an issue with the abort handling in the driver. Just a heads up for now, once I get a bit more time I'll try to collect a blktrace to figure out how the commands sent to the driver look different before and after the patch.