Re: [PATCH v3 -next 1/9] DMA, CMA: fix possible memory leak

2014-06-15 Thread Minchan Kim
Hi, Joonsoo On Mon, Jun 16, 2014 at 02:40:43PM +0900, Joonsoo Kim wrote: > We should free memory for bitmap when we find zone mis-match, > otherwise this memory will leak. > > Additionally, I copy code comment from PPC KVM's CMA code to inform > why we need to check zone mis-match. > > * Note >

[PATCH v3 -next 5/9] CMA: generalize CMA reserved area management functionality

2014-06-15 Thread Joonsoo Kim
Currently, there are two users on CMA functionality, one is the DMA subsystem and the other is the KVM on powerpc. They have their own code to manage CMA reserved area even if they looks really similar. From my guess, it is caused by some needs on bitmap management. KVM side wants to maintain bitma

[PATCH v3 -next 4/9] DMA, CMA: support arbitrary bitmap granularity

2014-06-15 Thread Joonsoo Kim
PPC KVM's CMA area management requires arbitrary bitmap granularity, since they want to reserve very large memory and manage this region with bitmap that one bit for several pages to reduce management overheads. So support arbitrary bitmap granularity for following generalization. v3: use consiste

[PATCH v3 -next 9/9] mm, CMA: clean-up log message

2014-06-15 Thread Joonsoo Kim
We don't need explicit 'CMA:' prefix, since we already define prefix 'cma:' in pr_fmt. So remove it. Acked-by: Michal Nazarewicz Reviewed-by: Zhang Yanfei Signed-off-by: Joonsoo Kim diff --git a/mm/cma.c b/mm/cma.c index 9961120..4b251b0 100644 --- a/mm/cma.c +++ b/mm/cma.c @@ -225,12 +225,12

[PATCH v3 -next 7/9] mm, CMA: clean-up CMA allocation error path

2014-06-15 Thread Joonsoo Kim
We can remove one call sites for clear_cma_bitmap() if we first call it before checking error number. Acked-by: Minchan Kim Reviewed-by: Michal Nazarewicz Reviewed-by: Zhang Yanfei Reviewed-by: Aneesh Kumar K.V Signed-off-by: Joonsoo Kim diff --git a/mm/cma.c b/mm/cma.c index 0cf50da..b442a1

[PATCH v3 -next 1/9] DMA, CMA: fix possible memory leak

2014-06-15 Thread Joonsoo Kim
We should free memory for bitmap when we find zone mis-match, otherwise this memory will leak. Additionally, I copy code comment from PPC KVM's CMA code to inform why we need to check zone mis-match. * Note Minchan suggested to add a tag for the stable, but, I don't do it, because I found this po

[PATCH v3 -next 6/9] PPC, KVM, CMA: use general CMA reserved area management framework

2014-06-15 Thread Joonsoo Kim
Now, we have general CMA reserved area management framework, so use it for future maintainabilty. There is no functional change. v3: add zeroing to CMA region (Aneesh) fix compile error (Aneesh) move VM_BUG_ON() to kvm_alloc_hpt() in book3s_hv_builtin.c (Aneesh) Acked-by: Michal Nazarewic

[PATCH v3 -next 0/9] CMA: generalize CMA reserved area management code

2014-06-15 Thread Joonsoo Kim
Currently, there are two users on CMA functionality, one is the DMA subsystem and the other is the KVM on powerpc. They have their own code to manage CMA reserved area even if they looks really similar. From my guess, it is caused by some needs on bitmap management. Kvm side wants to maintain bitma

[PATCH v3 -next 8/9] mm, CMA: change cma_declare_contiguous() to obey coding convention

2014-06-15 Thread Joonsoo Kim
Conventionally, we put output param to the end of param list and put the 'base' ahead of 'size', but cma_declare_contiguous() doesn't look like that, so change it. Additionally, move down cma_areas reference code to the position where it is really needed. v3: put 'base' ahead of 'size' (Minchan)

[PATCH v3 -next 3/9] DMA, CMA: support alignment constraint on CMA region

2014-06-15 Thread Joonsoo Kim
PPC KVM's CMA area management needs alignment constraint on CMA region. So support it to prepare generalization of CMA area management functionality. Additionally, add some comments which tell us why alignment constraint is needed on CMA region. v3: fix wrongly spelled word, align_order->alignmen

[PATCH v3 -next 2/9] DMA, CMA: separate core CMA management codes from DMA APIs

2014-06-15 Thread Joonsoo Kim
To prepare future generalization work on CMA area management code, we need to separate core CMA management codes from DMA APIs. We will extend these core functions to cover requirements of PPC KVM's CMA area management functionality in following patches. This separation helps us not to touch DMA AP

Re: [PATCH v2 07/10] PPC, KVM, CMA: use general CMA reserved area management framework

2014-06-15 Thread Joonsoo Kim
On Sat, Jun 14, 2014 at 02:23:59PM +0530, Aneesh Kumar K.V wrote: > Joonsoo Kim writes: > > > Now, we have general CMA reserved area management framework, > > so use it for future maintainabilty. There is no functional change. > > > > Acked-by: Michal Nazarewicz > > Acked-by: Paolo Bonzini > >

Re: [PATCH v2 00/10] CMA: generalize CMA reserved area management code

2014-06-15 Thread Joonsoo Kim
On Sat, Jun 14, 2014 at 12:55:39PM +0530, Aneesh Kumar K.V wrote: > Joonsoo Kim writes: > > > Currently, there are two users on CMA functionality, one is the DMA > > subsystem and the other is the kvm on powerpc. They have their own code > > to manage CMA reserved area even if they looks really s

Re: [PATCH v2 07/10] PPC, KVM, CMA: use general CMA reserved area management framework

2014-06-15 Thread Joonsoo Kim
On Sat, Jun 14, 2014 at 03:35:33PM +0530, Aneesh Kumar K.V wrote: > Joonsoo Kim writes: > > > Now, we have general CMA reserved area management framework, > > so use it for future maintainabilty. There is no functional change. > > > > Acked-by: Michal Nazarewicz > > Acked-by: Paolo Bonzini > >

Re: [PATCH v2 06/10] CMA: generalize CMA reserved area management functionality

2014-06-15 Thread Joonsoo Kim
On Sat, Jun 14, 2014 at 03:46:44PM +0530, Aneesh Kumar K.V wrote: > Joonsoo Kim writes: > > > Currently, there are two users on CMA functionality, one is the DMA > > subsystem and the other is the kvm on powerpc. They have their own code > > to manage CMA reserved area even if they looks really s

Re: [PATCH v2 03/10] DMA, CMA: separate core cma management codes from DMA APIs

2014-06-15 Thread Joonsoo Kim
On Thu, Jun 12, 2014 at 02:37:43PM +0900, Minchan Kim wrote: > On Thu, Jun 12, 2014 at 12:21:40PM +0900, Joonsoo Kim wrote: > > To prepare future generalization work on cma area management code, > > we need to separate core cma management codes from DMA APIs. > > We will extend these core functions

Re: [PATCH v2 05/10] DMA, CMA: support arbitrary bitmap granularity

2014-06-15 Thread Joonsoo Kim
On Thu, Jun 12, 2014 at 12:19:54PM +0200, Michal Nazarewicz wrote: > On Thu, Jun 12 2014, Joonsoo Kim wrote: > > ppc kvm's cma region management requires arbitrary bitmap granularity, > > since they want to reserve very large memory and manage this region > > with bitmap that one bit for several p

Re: [PATCH v2 04/10] DMA, CMA: support alignment constraint on cma region

2014-06-15 Thread Joonsoo Kim
On Thu, Jun 12, 2014 at 12:02:38PM +0200, Michal Nazarewicz wrote: > On Thu, Jun 12 2014, Joonsoo Kim wrote: > > ppc kvm's cma area management needs alignment constraint on > > I've noticed it earlier and cannot seem to get to terms with this. It > should IMO be PPC, KVM and CMA since those are

Re: [PATCH v2 01/10] DMA, CMA: clean-up log message

2014-06-15 Thread Joonsoo Kim
On Thu, Jun 12, 2014 at 11:53:16AM +0200, Michal Nazarewicz wrote: > On Thu, Jun 12 2014, Michal Nazarewicz wrote: > > I used “function(arg1, arg2, …)” at the *beginning* of functions when > > the arguments passed to the function were included in the message. In > > all other cases I left it at j

Re: kmemleak: Unable to handle kernel paging request

2014-06-15 Thread Michael Ellerman
On Fri, 2014-06-13 at 14:26 +0400, Denis Kirjanov wrote: > On 6/13/14, Catalin Marinas wrote: > > On Fri, Jun 13, 2014 at 08:12:08AM +0100, Denis Kirjanov wrote: > >> On 6/12/14, Catalin Marinas wrote: > >> > On Thu, Jun 12, 2014 at 01:00:57PM +0100, Denis Kirjanov wrote: > >> >> On 6/12/14, Deni

[PATCH -next 26/26] sound: Use dma_zalloc_coherent

2014-06-15 Thread Joe Perches
Use the zeroing function instead of dma_alloc_coherent & memset(,0,) Signed-off-by: Joe Perches --- sound/aoa/soundbus/i2sbus/core.c | 12 sound/sparc/dbri.c | 6 ++ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/sound/aoa/soundbus/i2sbus/core.c b

[PATCH -next 00/26] treewide: Use dma_zalloc_coherent

2014-06-15 Thread Joe Perches
Use the zeroing function instead of dma_alloc_coherent & memset(,0,) Joe Perches (26): powerpc: Use dma_zalloc_coherent sh: Use dma_zalloc_coherent ata: Use dma_zalloc_coherent block: Use dma_zalloc_coherent crypto: Use dma_zalloc_coherent dma: Use dma_zalloc_coherent gpu: Use dma_za

[PATCH -next 01/26] powerpc: Use dma_zalloc_coherent

2014-06-15 Thread Joe Perches
Use the zeroing function instead of dma_alloc_coherent & memset(,0,) Signed-off-by: Joe Perches --- arch/powerpc/platforms/pasemi/dma_lib.c | 8 +++- arch/powerpc/sysdev/fsl_rmu.c | 9 - 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/platforms/

[PATCH V2] KVM: PPC: BOOK3S: HV: Use base page size when comparing against slb value

2014-06-15 Thread Aneesh Kumar K.V
With guests supporting Multiple page size per segment (MPSS), hpte_page_size returns the actual page size used. Add a new function to return base page size and use that to compare against the the page size calculated from SLB. Without this patch a hpte lookup can fail since we are comparing wrong p