struct page **pages is necessary to align with non atomic path in
__iommu_get_pages(). atomic_pool() has the intialized **pages instead
of just *page.
Signed-off-by: Hiroshi Doyu <redacted>
---
arch/arm/mm/dma-mapping.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
Check the given range("start", "size") is included in "atomic_pool" or not.
Signed-off-by: Hiroshi Doyu <redacted>
---
arch/arm/mm/dma-mapping.c | 25 +++++++++++++++++++------
1 files changed, 19 insertions(+), 6 deletions(-)
Make use of the same atomic pool as DMA does, and skip a kernel page
mapping which can involve sleep'able operations at allocating a kernel
page table.
Signed-off-by: Hiroshi Doyu <redacted>
---
arch/arm/mm/dma-mapping.c | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
From: Konrad Rzeszutek Wilk <hidden> Date: 2012-08-24 11:13:57
On Fri, Aug 24, 2012 at 11:29:02AM +0300, Hiroshi Doyu wrote:
quoted hunk
struct page **pages is necessary to align with non atomic path in
__iommu_get_pages(). atomic_pool() has the intialized **pages instead
of just *page.
Signed-off-by: Hiroshi Doyu <redacted>
---
arch/arm/mm/dma-mapping.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
From: Konrad Rzeszutek Wilk <hidden> Date: 2012-08-24 11:15:20
On Fri, Aug 24, 2012 at 11:29:03AM +0300, Hiroshi Doyu wrote:
quoted hunk
Check the given range("start", "size") is included in "atomic_pool" or not.
Signed-off-by: Hiroshi Doyu <redacted>
---
arch/arm/mm/dma-mapping.c | 25 +++++++++++++++++++------
1 files changed, 19 insertions(+), 6 deletions(-)
That does not tell what size or from what pool. Perhaps you should
include some details, such as the 'size' value, the pool used, the
range of the pool, etc. Something that will help _you_in the field
be able to narrow down what might be wrong.
Konrad Rzeszutek Wilk [off-list ref] wrote @ Fri, 24 Aug 2012 13:14:55 +0200:
On Fri, Aug 24, 2012 at 11:29:03AM +0300, Hiroshi Doyu wrote:
quoted
Check the given range("start", "size") is included in "atomic_pool" or not.
Signed-off-by: Hiroshi Doyu <redacted>
---
arch/arm/mm/dma-mapping.c | 25 +++++++++++++++++++------
1 files changed, 19 insertions(+), 6 deletions(-)
That does not tell what size or from what pool. Perhaps you should
include some details, such as the 'size' value, the pool used, the
range of the pool, etc. Something that will help _you_in the field
be able to narrow down what might be wrong.
Konrad Rzeszutek Wilk [off-list ref] wrote @ Fri, 24 Aug 2012 13:13:23 +0200:
On Fri, Aug 24, 2012 at 11:29:02AM +0300, Hiroshi Doyu wrote:
quoted
struct page **pages is necessary to align with non atomic path in
__iommu_get_pages(). atomic_pool() has the intialized **pages instead
of just *page.
Signed-off-by: Hiroshi Doyu <redacted>
---
arch/arm/mm/dma-mapping.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
@@ -335,12 +335,16 @@ static int __init atomic_pool_init(void)unsignedlongnr_pages=pool->size>>PAGE_SHIFT;unsignedlong*bitmap;structpage*page;+structpage**pages;void*ptr;intbitmap_size=BITS_TO_LONGS(nr_pages)*sizeof(long);+size_tsize=nr_pages*sizeof(structpage*);-bitmap=kzalloc(bitmap_size,GFP_KERNEL);+size+=bitmap_size;+bitmap=kzalloc(size,GFP_KERNEL);if(!bitmap)gotono_bitmap;+pages=(void*)bitmap+bitmap_size;
So you stuck a bitmap field in front of the array then?
Why not just define a structure where this is clearly defined
instead of doing the casting.
I just wanted to allocate only once for the members "pool->bitmap" and
"pool->pages" at once. Since the size of a whole bitmap isn't known in
advance, I couldn't find any fixed type for this bitmap, which pointer
can be shifted without casting. IOW, they are variable length.
From: Marek Szyprowski <m.szyprowski@samsung.com> Date: 2012-08-24 12:22:47
Hello,
On Friday, August 24, 2012 1:52 PM Hiroshi Doyu wrote:
Konrad Rzeszutek Wilk [off-list ref] wrote @ Fri, 24 Aug 2012 13:13:23 +0200:
quoted
On Fri, Aug 24, 2012 at 11:29:02AM +0300, Hiroshi Doyu wrote:
quoted
struct page **pages is necessary to align with non atomic path in
__iommu_get_pages(). atomic_pool() has the intialized **pages instead
of just *page.
Signed-off-by: Hiroshi Doyu <redacted>
---
arch/arm/mm/dma-mapping.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
@@ -335,12 +335,16 @@ static int __init atomic_pool_init(void)unsignedlongnr_pages=pool->size>>PAGE_SHIFT;unsignedlong*bitmap;structpage*page;+structpage**pages;void*ptr;intbitmap_size=BITS_TO_LONGS(nr_pages)*sizeof(long);+size_tsize=nr_pages*sizeof(structpage*);-bitmap=kzalloc(bitmap_size,GFP_KERNEL);+size+=bitmap_size;+bitmap=kzalloc(size,GFP_KERNEL);if(!bitmap)gotono_bitmap;+pages=(void*)bitmap+bitmap_size;
So you stuck a bitmap field in front of the array then?
Why not just define a structure where this is clearly defined
instead of doing the casting.
I just wanted to allocate only once for the members "pool->bitmap" and
"pool->pages" at once. Since the size of a whole bitmap isn't known in
advance, I couldn't find any fixed type for this bitmap, which pointer
can be shifted without casting. IOW, they are variable length.
IMHO it is better to avoid any non-trivial things in generic arch code. Merging
those 2 allocations doesn't save any significant bit of memory and might confuse
someone. Better just allocate them separately.
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center