Re: [PATCH] block: don't make BLK_DEF_MAX_SECTORS too big

2016-03-30 Thread Kent Overstreet
On Wed, Mar 30, 2016 at 09:50:30AM -0700, Shaohua Li wrote: > On Tue, Mar 29, 2016 at 11:51:51PM -0700, Christoph Hellwig wrote: > > On Tue, Mar 29, 2016 at 03:01:10PM -0700, Shaohua Li wrote: > > > The problem is bcache allocates a big bio (with bio_alloc). The bio is > > > split with

Re: [PATCH] block: don't make BLK_DEF_MAX_SECTORS too big

2016-03-30 Thread Kent Overstreet
On Wed, Mar 30, 2016 at 09:50:30AM -0700, Shaohua Li wrote: > On Tue, Mar 29, 2016 at 11:51:51PM -0700, Christoph Hellwig wrote: > > On Tue, Mar 29, 2016 at 03:01:10PM -0700, Shaohua Li wrote: > > > The problem is bcache allocates a big bio (with bio_alloc). The bio is > > > split with

Re: [PATCH] block: don't make BLK_DEF_MAX_SECTORS too big

2016-03-30 Thread Ming Lei
Hi Shaohua, On Thu, Mar 31, 2016 at 1:07 AM, Shaohua Li wrote: > On Wed, Mar 30, 2016 at 08:13:07PM +0800, Ming Lei wrote: >> Hi Shaohua, >> >> On Wed, Mar 30, 2016 at 10:27 AM, Shaohua Li wrote: >> > On Wed, Mar 30, 2016 at 09:39:35AM +0800, Ming Lei wrote: >> >> On

Re: [PATCH] block: don't make BLK_DEF_MAX_SECTORS too big

2016-03-30 Thread Ming Lei
Hi Shaohua, On Thu, Mar 31, 2016 at 1:07 AM, Shaohua Li wrote: > On Wed, Mar 30, 2016 at 08:13:07PM +0800, Ming Lei wrote: >> Hi Shaohua, >> >> On Wed, Mar 30, 2016 at 10:27 AM, Shaohua Li wrote: >> > On Wed, Mar 30, 2016 at 09:39:35AM +0800, Ming Lei wrote: >> >> On Wed, Mar 30, 2016 at 12:42

Re: [PATCH] block: don't make BLK_DEF_MAX_SECTORS too big

2016-03-30 Thread Christoph Hellwig
On Wed, Mar 30, 2016 at 09:50:30AM -0700, Shaohua Li wrote: > > bcache should be fixed to not allocate larger than allowed bios then. > > And handling too large arguments to bio_alloc_bioset is still useful to > > avoid the checks in the callers and make it robust. > > Doesn't this conflict the

Re: [PATCH] block: don't make BLK_DEF_MAX_SECTORS too big

2016-03-30 Thread Christoph Hellwig
On Wed, Mar 30, 2016 at 09:50:30AM -0700, Shaohua Li wrote: > > bcache should be fixed to not allocate larger than allowed bios then. > > And handling too large arguments to bio_alloc_bioset is still useful to > > avoid the checks in the callers and make it robust. > > Doesn't this conflict the

Re: [PATCH] block: don't make BLK_DEF_MAX_SECTORS too big

2016-03-30 Thread Shaohua Li
On Wed, Mar 30, 2016 at 08:13:07PM +0800, Ming Lei wrote: > Hi Shaohua, > > On Wed, Mar 30, 2016 at 10:27 AM, Shaohua Li wrote: > > On Wed, Mar 30, 2016 at 09:39:35AM +0800, Ming Lei wrote: > >> On Wed, Mar 30, 2016 at 12:42 AM, Shaohua Li wrote: > >> >

Re: [PATCH] block: don't make BLK_DEF_MAX_SECTORS too big

2016-03-30 Thread Shaohua Li
On Wed, Mar 30, 2016 at 08:13:07PM +0800, Ming Lei wrote: > Hi Shaohua, > > On Wed, Mar 30, 2016 at 10:27 AM, Shaohua Li wrote: > > On Wed, Mar 30, 2016 at 09:39:35AM +0800, Ming Lei wrote: > >> On Wed, Mar 30, 2016 at 12:42 AM, Shaohua Li wrote: > >> > bio_alloc_bioset() allocates bvecs from

Re: [PATCH] block: don't make BLK_DEF_MAX_SECTORS too big

2016-03-30 Thread Shaohua Li
On Tue, Mar 29, 2016 at 11:51:51PM -0700, Christoph Hellwig wrote: > On Tue, Mar 29, 2016 at 03:01:10PM -0700, Shaohua Li wrote: > > The problem is bcache allocates a big bio (with bio_alloc). The bio is > > split with blk_queue_split, but it isn't split to small size because > > queue limit. the

Re: [PATCH] block: don't make BLK_DEF_MAX_SECTORS too big

2016-03-30 Thread Shaohua Li
On Tue, Mar 29, 2016 at 11:51:51PM -0700, Christoph Hellwig wrote: > On Tue, Mar 29, 2016 at 03:01:10PM -0700, Shaohua Li wrote: > > The problem is bcache allocates a big bio (with bio_alloc). The bio is > > split with blk_queue_split, but it isn't split to small size because > > queue limit. the

Re: [PATCH] block: don't make BLK_DEF_MAX_SECTORS too big

2016-03-30 Thread Ming Lei
Hi Shaohua, On Wed, Mar 30, 2016 at 10:27 AM, Shaohua Li wrote: > On Wed, Mar 30, 2016 at 09:39:35AM +0800, Ming Lei wrote: >> On Wed, Mar 30, 2016 at 12:42 AM, Shaohua Li wrote: >> > bio_alloc_bioset() allocates bvecs from bvec_slabs which can only >> > allocate

Re: [PATCH] block: don't make BLK_DEF_MAX_SECTORS too big

2016-03-30 Thread Ming Lei
Hi Shaohua, On Wed, Mar 30, 2016 at 10:27 AM, Shaohua Li wrote: > On Wed, Mar 30, 2016 at 09:39:35AM +0800, Ming Lei wrote: >> On Wed, Mar 30, 2016 at 12:42 AM, Shaohua Li wrote: >> > bio_alloc_bioset() allocates bvecs from bvec_slabs which can only >> > allocate maximum 256 bvec (eg, 1M for 4k

Re: [PATCH] block: don't make BLK_DEF_MAX_SECTORS too big

2016-03-30 Thread Christoph Hellwig
On Tue, Mar 29, 2016 at 03:01:10PM -0700, Shaohua Li wrote: > The problem is bcache allocates a big bio (with bio_alloc). The bio is > split with blk_queue_split, but it isn't split to small size because > queue limit. the bio is cloned later in md, which uses bio_alloc_bioset. > bio_alloc_bioset

Re: [PATCH] block: don't make BLK_DEF_MAX_SECTORS too big

2016-03-30 Thread Christoph Hellwig
On Tue, Mar 29, 2016 at 03:01:10PM -0700, Shaohua Li wrote: > The problem is bcache allocates a big bio (with bio_alloc). The bio is > split with blk_queue_split, but it isn't split to small size because > queue limit. the bio is cloned later in md, which uses bio_alloc_bioset. > bio_alloc_bioset

Re: [PATCH] block: don't make BLK_DEF_MAX_SECTORS too big

2016-03-29 Thread Shaohua Li
On Wed, Mar 30, 2016 at 09:39:35AM +0800, Ming Lei wrote: > On Wed, Mar 30, 2016 at 12:42 AM, Shaohua Li wrote: > > bio_alloc_bioset() allocates bvecs from bvec_slabs which can only > > allocate maximum 256 bvec (eg, 1M for 4k pages). We can't bump > > BLK_DEF_MAX_SECTORS to exceed

Re: [PATCH] block: don't make BLK_DEF_MAX_SECTORS too big

2016-03-29 Thread Shaohua Li
On Wed, Mar 30, 2016 at 09:39:35AM +0800, Ming Lei wrote: > On Wed, Mar 30, 2016 at 12:42 AM, Shaohua Li wrote: > > bio_alloc_bioset() allocates bvecs from bvec_slabs which can only > > allocate maximum 256 bvec (eg, 1M for 4k pages). We can't bump > > BLK_DEF_MAX_SECTORS to exceed this value

Re: [PATCH] block: don't make BLK_DEF_MAX_SECTORS too big

2016-03-29 Thread Ming Lei
On Wed, Mar 30, 2016 at 12:42 AM, Shaohua Li wrote: > bio_alloc_bioset() allocates bvecs from bvec_slabs which can only > allocate maximum 256 bvec (eg, 1M for 4k pages). We can't bump > BLK_DEF_MAX_SECTORS to exceed this value otherwise bio_alloc_bioset will > fail. > > In the

Re: [PATCH] block: don't make BLK_DEF_MAX_SECTORS too big

2016-03-29 Thread Ming Lei
On Wed, Mar 30, 2016 at 12:42 AM, Shaohua Li wrote: > bio_alloc_bioset() allocates bvecs from bvec_slabs which can only > allocate maximum 256 bvec (eg, 1M for 4k pages). We can't bump > BLK_DEF_MAX_SECTORS to exceed this value otherwise bio_alloc_bioset will > fail. > > In the future, we can

Re: [PATCH] block: don't make BLK_DEF_MAX_SECTORS too big

2016-03-29 Thread Shaohua Li
On Tue, Mar 29, 2016 at 02:18:33PM -0700, Christoph Hellwig wrote: > On Tue, Mar 29, 2016 at 09:42:33AM -0700, Shaohua Li wrote: > > bio_alloc_bioset() allocates bvecs from bvec_slabs which can only > > allocate maximum 256 bvec (eg, 1M for 4k pages). We can't bump > > BLK_DEF_MAX_SECTORS to

Re: [PATCH] block: don't make BLK_DEF_MAX_SECTORS too big

2016-03-29 Thread Shaohua Li
On Tue, Mar 29, 2016 at 02:18:33PM -0700, Christoph Hellwig wrote: > On Tue, Mar 29, 2016 at 09:42:33AM -0700, Shaohua Li wrote: > > bio_alloc_bioset() allocates bvecs from bvec_slabs which can only > > allocate maximum 256 bvec (eg, 1M for 4k pages). We can't bump > > BLK_DEF_MAX_SECTORS to

Re: [PATCH] block: don't make BLK_DEF_MAX_SECTORS too big

2016-03-29 Thread Christoph Hellwig
On Tue, Mar 29, 2016 at 09:42:33AM -0700, Shaohua Li wrote: > bio_alloc_bioset() allocates bvecs from bvec_slabs which can only > allocate maximum 256 bvec (eg, 1M for 4k pages). We can't bump > BLK_DEF_MAX_SECTORS to exceed this value otherwise bio_alloc_bioset will > fail. This might be true,

Re: [PATCH] block: don't make BLK_DEF_MAX_SECTORS too big

2016-03-29 Thread Christoph Hellwig
On Tue, Mar 29, 2016 at 09:42:33AM -0700, Shaohua Li wrote: > bio_alloc_bioset() allocates bvecs from bvec_slabs which can only > allocate maximum 256 bvec (eg, 1M for 4k pages). We can't bump > BLK_DEF_MAX_SECTORS to exceed this value otherwise bio_alloc_bioset will > fail. This might be true,

[PATCH] block: don't make BLK_DEF_MAX_SECTORS too big

2016-03-29 Thread Shaohua Li
bio_alloc_bioset() allocates bvecs from bvec_slabs which can only allocate maximum 256 bvec (eg, 1M for 4k pages). We can't bump BLK_DEF_MAX_SECTORS to exceed this value otherwise bio_alloc_bioset will fail. In the future, we can extend the size either bvec_slabs array is expanded or the upcoming

[PATCH] block: don't make BLK_DEF_MAX_SECTORS too big

2016-03-29 Thread Shaohua Li
bio_alloc_bioset() allocates bvecs from bvec_slabs which can only allocate maximum 256 bvec (eg, 1M for 4k pages). We can't bump BLK_DEF_MAX_SECTORS to exceed this value otherwise bio_alloc_bioset will fail. In the future, we can extend the size either bvec_slabs array is expanded or the upcoming