RE: BIO request larger than our storage device supports in linux kernel 4.x

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yes. This is non-open driver for our Flash based PCI drive for enterprise storage solution.

Some snippet of queue related code is below

struct request_queue *queue;

blk_queue_max_hw_sectors(dev->osdev.queue, (dev->aggr_max_size >> KERNEL_SECTOR_SHIFT));
blk_queue_max_segments(dev->osdev.queue, BLK_MAX_SEGMENTS);
blk_queue_bounce_limit(dev->osdev.queue, BLK_BOUNCE_ANY);
blk_queue_logical_block_size(dev->osdev.queue, dev->hardsect_size);
blk_queue_physical_block_size(dev->osdev.queue, dev->hardsect_size);

dev->osdev.queue = blk_alloc_queue(GFP_KERNEL);

blk_queue_make_request(dev->osdev.queue, fmm_bdev_make_request_wrapper);

Here queue is part of our internal structure struct fmm_bdev *dev




-----Original Message-----
From: Jens Axboe [mailto:axboe@xxxxxxxxx] 
Sent: Wednesday, March 8, 2017 8:35 PM
To: Umesh Patel; linux-block@xxxxxxxxxxxxxxx
Subject: Re: BIO request larger than our storage device supports in linux kernel 4.x

On 03/08/2017 02:34 AM, Umesh Patel wrote:
> Hello,
> 
> We are registering BIO size of our storage device through linux kernel 
> API blk_queue_max_hw_sectors worth of 104K. So max size of BIO that 
> our block device can handle is 104 KB but kernel block layer is 
> sending 256 KB worth of BIO which is more than we are supporting.
> This issue we are observing in 4.4 and also in latest 4.10.1 kernel 
> release. Until this we had not seen this issue.
> 
> From the kernel source code history I came to below things.  4.1 
> kernel version onwards "nr_pages = min(sdio->pages_in_io, 
> bio_get_nr_vecs(map_bh->b_bdev))" has been removed which
> (bio_get_nr_vecs) was considering max_sectors_kb of queue which was
> 104 KB for our device.
> 
> Presently new code is something like "nr_pages = 
> min(sdio->pages_in_io, BIO_MAX_PAGES)" which is sending 256 KB
> (BIO_MAX_PAGES) of BIO size to our device which we are not supporting.
> 
> 
> So from some documentation I found out that 256 KB of bio size is the 
> fix (from 4.x kernel) and that has to support by any drive.  Please 
> let me know is there any way to change BIO size worth of 104 KB from
> 256 KB or any other way to register our BIO size with kernel or any 
> other area to look in to ?.

I'm assuming this is some not-open driver, and I'm also assuming that you are bypassing the proper API and using make_request_fn. In which case you are missing a call to blk_queue_split().

--
Jens Axboe





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux