Re: [RFC] support for large I/O requests

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

 



On Wed, Mar 29 2006, Alex Tomas wrote:
> 
> On some system (DDN, for example), we've observed noticable
> performance improvement using large I/O requests (1,2,4 MBs).
> please, review the patch for inclusion.
> 
> thanks, Alex
> 
> 
> Signed-off-by: Johann Lombardi <[email protected]>
> 
> Index: linux-2.6.16/include/linux/blkdev.h
> ===================================================================
> --- linux-2.6.16.orig/include/linux/blkdev.h	2006-02-07 14:27:53.000000000 +0100
> +++ linux-2.6.16/include/linux/blkdev.h	2006-02-07 15:21:48.000000000 +0100
> @@ -667,10 +667,29 @@ extern long blk_congestion_wait(int rw, 
>  extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *);
>  extern int blkdev_issue_flush(struct block_device *, sector_t *);
>  
> -#define MAX_PHYS_SEGMENTS 128
> -#define MAX_HW_SEGMENTS 128
>  #define SAFE_MAX_SECTORS 255
>  #define BLK_DEF_MAX_SECTORS 1024
> +#ifdef CONFIG_LARGE_IO_SIZE_512K
> +#define MAX_PHYS_SEGMENTS (1 << (19 - PAGE_CACHE_SHIFT))
> +#define MAX_HW_SEGMENTS (1 << (19 - PAGE_CACHE_SHIFT))
> +#elif CONFIG_LARGE_IO_SIZE_1M
> +#define MAX_PHYS_SEGMENTS (1 << (20 - PAGE_CACHE_SHIFT))
> +#define MAX_HW_SEGMENTS (1 << (20 - PAGE_CACHE_SHIFT))
> +#elif CONFIG_LARGE_IO_SIZE_2M
> +#define MAX_PHYS_SEGMENTS (1 << (21 - PAGE_CACHE_SHIFT))
> +#define MAX_HW_SEGMENTS (1 << (21 - PAGE_CACHE_SHIFT))
> +#elif CONFIG_LARGE_IO_SIZE_4M
> +#define MAX_PHYS_SEGMENTS (1 << (22 - PAGE_CACHE_SHIFT))
> +#define MAX_HW_SEGMENTS (1 << (22 - PAGE_CACHE_SHIFT))
> +#elif CONFIG_LARGE_IO_SIZE_8M
> +#define MAX_PHYS_SEGMENTS (1 << (23 - PAGE_CACHE_SHIFT))
> +#define MAX_HW_SEGMENTS (1 << (23 - PAGE_CACHE_SHIFT))
> +#elif CONFIG_LARGE_IO_SIZE_16M
> +#define MAX_PHYS_SEGMENTS (1 << (24 - PAGE_CACHE_SHIFT))
> +#define MAX_HW_SEGMENTS (1 << (24 - PAGE_CACHE_SHIFT))
> +#else
> +#error "unknown size, check .config"
> +#endif

These are defaults, don't change them. They don't actually limit
anything, the drive is free to set it higher.

> Index: linux-2.6.16/include/linux/bio.h
> ===================================================================
> --- linux-2.6.16.orig/include/linux/bio.h	2006-02-07 14:27:53.000000000 +0100
> +++ linux-2.6.16/include/linux/bio.h	2006-02-07 15:22:35.000000000 +0100
> @@ -46,7 +46,22 @@
>  #define BIO_BUG_ON
>  #endif
>  
> -#define BIO_MAX_PAGES		(256)
> +#ifdef CONFIG_LARGE_IO_SIZE_512K
> +#define BIO_MAX_PAGES		(1 << (19 - PAGE_CACHE_SHIFT))
> +#elif CONFIG_LARGE_IO_SIZE_1M
> +#define BIO_MAX_PAGES		(1 << (20 - PAGE_CACHE_SHIFT))
> +#elif CONFIG_LARGE_IO_SIZE_2M
> +#define BIO_MAX_PAGES		(1 << (21 - PAGE_CACHE_SHIFT))
> +#elif CONFIG_LARGE_IO_SIZE_4M
> +#define BIO_MAX_PAGES		(1 << (22 - PAGE_CACHE_SHIFT))
> +#elif CONFIG_LARGE_IO_SIZE_8M
> +#define BIO_MAX_PAGES		(1 << (23 - PAGE_CACHE_SHIFT))
> +#elif CONFIG_LARGE_IO_SIZE_16M
> +#define BIO_MAX_PAGES		(1 << (24 - PAGE_CACHE_SHIFT))
> +#else
> +#error "unknown size, check .config"
> +#endif

This one is different, it does cap the max indidivual bio size. However,
you can string bio's together inside a struct request for a larger io.

In general, I don't think we need to do anything. You can increase the
max request sizes through sysfs. If you want to do something useful in
this area, go over all block drivers and make sure they set the correct
max_sectors/max_segments limits instead. A config option is a bad idea
imo.

-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux