From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f48.google.com ([74.125.82.48]:36741 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752828AbcB2KQu (ORCPT ); Mon, 29 Feb 2016 05:16:50 -0500 Received: by mail-wm0-f48.google.com with SMTP id n186so41549627wmn.1 for ; Mon, 29 Feb 2016 02:16:50 -0800 (PST) Message-ID: <56D41A8E.2070405@plexistor.com> Date: Mon, 29 Feb 2016 12:16:46 +0200 From: Boaz Harrosh MIME-Version: 1.0 To: Christoph Hellwig CC: Ming Lei , lsf-pc@lists.linuxfoundation.org, linux-block@vger.kernel.org, Linux FS Devel Subject: Re: [Lsf-pc] [LSF/MM ATTEND] block: multipage bvecs References: <56D2D757.2000204@plexistor.com> <20160228160801.GB12881@infradead.org> In-Reply-To: <20160228160801.GB12881@infradead.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 02/28/2016 06:08 PM, Christoph Hellwig wrote: > On Sun, Feb 28, 2016 at 01:17:43PM +0200, Boaz Harrosh wrote: >> I don't know if you ever tried it but I did. If I take a regular >> SSD disk or a PCIE flash card that I have in my machine and >> I stick a pointer to a page and bv_len = PAGE_SIZE * 8 and call >> submit_bio, I get 8 pages worth of IO with a single bvec and it >> all just works. > > No, it will break in all kinds of places. Also you really should > never just setup bvecs yourself, please always use bio_add_page! > Guys when did you ever stop playing and became so serious? Of course I never do that in submitted code. But I do like to experiment from time to time and play around, I like it when my VM crashes ;-) That said when did you last look at bio_add_page() it will just work as well. (Specially lately since the limits are checked later ever since bios can split) So if you have a real hard stair you'll see that we consider bv_len everywhere and the PAGE_SIZE assumption is more when allocating array sizes and things like that. Again it will break on SW drivers like brd and scsi_debug. But will currently work on anything going through sg-lists and DMA mapping. This is not the first time in the kernel that a page* and large size denotes a set of contiguous pages, BTW Cheers Boaz