Re: [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors

2013-01-17 Thread Subhash Jadavani
On 1/17/2013 4:17 PM, Russell King - ARM Linux wrote: On Thu, Jan 17, 2013 at 10:37:42AM +, Russell King - ARM Linux wrote: On Thu, Jan 17, 2013 at 09:11:20AM +, James Bottomley wrote: I'd actually prefer page = pfn_to_page(page_to_pfn(page) + 1); because it makes the code look like the

Re: [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors

2013-01-17 Thread Russell King - ARM Linux
On Thu, Jan 17, 2013 at 11:19:21AM +, James Bottomley wrote: > On Thu, 2013-01-17 at 11:04 +, Russell King - ARM Linux wrote: > > On Thu, Jan 17, 2013 at 11:01:47AM +, James Bottomley wrote: > > > On Thu, 2013-01-17 at 10:47 +, Russell King - ARM Linux wrote: > > > > Also, couldn't

Re: [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors

2013-01-17 Thread James Bottomley
On Thu, 2013-01-17 at 11:04 +, Russell King - ARM Linux wrote: > On Thu, Jan 17, 2013 at 11:01:47AM +, James Bottomley wrote: > > On Thu, 2013-01-17 at 10:47 +, Russell King - ARM Linux wrote: > > > Also, couldn't the addition of the scatterlist offset to the page also > > > be buggy to

Re: [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors

2013-01-17 Thread Russell King - ARM Linux
On Thu, Jan 17, 2013 at 11:01:47AM +, James Bottomley wrote: > On Thu, 2013-01-17 at 10:47 +, Russell King - ARM Linux wrote: > > Also, couldn't the addition of the scatterlist offset to the page also > > be buggy too? > > No, fortunately, offset must be within the first page from the poin

Re: [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors

2013-01-17 Thread James Bottomley
On Thu, 2013-01-17 at 10:47 +, Russell King - ARM Linux wrote: > On Thu, Jan 17, 2013 at 10:37:42AM +, Russell King - ARM Linux wrote: > > On Thu, Jan 17, 2013 at 09:11:20AM +, James Bottomley wrote: > > > I'd actually prefer page = pfn_to_page(page_to_pfn(page) + 1); because > > > it m

Re: [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors

2013-01-17 Thread Russell King - ARM Linux
On Thu, Jan 17, 2013 at 10:37:42AM +, Russell King - ARM Linux wrote: > On Thu, Jan 17, 2013 at 09:11:20AM +, James Bottomley wrote: > > I'd actually prefer page = pfn_to_page(page_to_pfn(page) + 1); because > > it makes the code look like the hack it is. The preferred form for all > > ite

Re: [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors

2013-01-17 Thread Russell King - ARM Linux
On Thu, Jan 17, 2013 at 09:11:20AM +, James Bottomley wrote: > On Wed, 2013-01-16 at 15:18 -0800, Tejun Heo wrote: > > On Wed, Jan 16, 2013 at 10:32:35AM +, James Bottomley wrote: > > > diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c > > > index 6b2fb87..ab88c5b 100644 >

Re: [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors

2013-01-17 Thread James Bottomley
On Wed, 2013-01-16 at 15:18 -0800, Tejun Heo wrote: > On Wed, Jan 16, 2013 at 10:32:35AM +, James Bottomley wrote: > > diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c > > index 6b2fb87..ab88c5b 100644 > > --- a/arch/arm/mm/dma-mapping.c > > +++ b/arch/arm/mm/dma-mapping.c > >

Re: [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors

2013-01-17 Thread James Bottomley
On Wed, 2013-01-16 at 23:14 +, Russell King - ARM Linux wrote: > On Wed, Jan 16, 2013 at 10:32:35AM +, James Bottomley wrote: > > On Wed, 2013-01-16 at 12:07 +0530, Subhash Jadavani wrote: > > > > > Now consider this call stack from MMC block driver (this is on the ARmv7 > > > based board

Re: [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors

2013-01-16 Thread Tejun Heo
On Wed, Jan 16, 2013 at 10:32:35AM +, James Bottomley wrote: > diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c > index 6b2fb87..ab88c5b 100644 > --- a/arch/arm/mm/dma-mapping.c > +++ b/arch/arm/mm/dma-mapping.c > @@ -809,7 +809,7 @@ static void dma_cache_maint_page(struct pag

Re: [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors

2013-01-16 Thread Russell King - ARM Linux
On Wed, Jan 16, 2013 at 10:32:35AM +, James Bottomley wrote: > On Wed, 2013-01-16 at 12:07 +0530, Subhash Jadavani wrote: > > > Now consider this call stack from MMC block driver (this is on the ARmv7 > > based board): > > [ 98.918174] [] (v7_dma_inv_range+0x30/0x48) from > > [] (dma_

Re: [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors

2013-01-16 Thread Subhash Jadavani
On 1/16/2013 4:02 PM, James Bottomley wrote: On Wed, 2013-01-16 at 12:07 +0530, Subhash Jadavani wrote: Now consider this call stack from MMC block driver (this is on the ARmv7 based board): [ 98.918174] [] (v7_dma_inv_range+0x30/0x48) from [] (dma_cache_maint_page+0x1c4/0x24c) [

Re: [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors

2013-01-16 Thread James Bottomley
On Wed, 2013-01-16 at 12:07 +0530, Subhash Jadavani wrote: > Now consider this call stack from MMC block driver (this is on the ARmv7 > based board): > [ 98.918174] [] (v7_dma_inv_range+0x30/0x48) from > [] (dma_cache_maint_page+0x1c4/0x24c) > [ 98.927819] [] (dma_cache_maint_page+

Re: [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors

2013-01-16 Thread James Bottomley
On Wed, 2013-01-16 at 12:07 +0530, Subhash Jadavani wrote: > On 1/15/2013 9:49 PM, James Bottomley wrote: > > On Tue, 2013-01-15 at 21:31 +0530, Subhash Jadavani wrote: > >> blk_rq_map_sg() function merges the physically contiguous pages to use same > >> scatter-gather node without checking if thei

Re: [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors

2013-01-15 Thread Subhash Jadavani
On 1/15/2013 9:49 PM, James Bottomley wrote: On Tue, 2013-01-15 at 21:31 +0530, Subhash Jadavani wrote: blk_rq_map_sg() function merges the physically contiguous pages to use same scatter-gather node without checking if their page descriptors are contiguous or not. Now when dma_map_sg() is call

Re: [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors

2013-01-15 Thread James Bottomley
On Tue, 2013-01-15 at 21:31 +0530, Subhash Jadavani wrote: > blk_rq_map_sg() function merges the physically contiguous pages to use same > scatter-gather node without checking if their page descriptors are > contiguous or not. > > Now when dma_map_sg() is called on the scatter gather list, it woul

[PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors

2013-01-15 Thread Subhash Jadavani
blk_rq_map_sg() function merges the physically contiguous pages to use same scatter-gather node without checking if their page descriptors are contiguous or not. Now when dma_map_sg() is called on the scatter gather list, it would take the base page pointer from each node (one by one) and iterates