* [PATCH] cma: make default CMA area size zero for x86 @ 2014-10-05 6:02 ` Akinobu Mita 0 siblings, 0 replies; 6+ messages in thread From: Akinobu Mita @ 2014-10-05 6:02 UTC (permalink / raw) To: linux-kernel-u79uwXL29TY76Z2rM5mHXA, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b Cc: Chuck Ebbert, Andi Kleen, Peter Hurley, Yinghai Lu, x86-DgEjT+Ai2ygdnm+yROfE0A, Akinobu Mita, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Ingo Molnar, H. Peter Anvin, Thomas Gleixner, David Woodhouse This makes CMA memory area size zero for x86 in default configuration (doesn't change on the other architectures). If default CMA size is zero, DMA_CMA is disabled. It can be enabled by passing cma= to the kernel. This makes less impact on x86. Because there is no mainline driver that requires it for x86, and Peter Hurley reported the performance regression, as this is trying to drive _all_ dma mapping allocations through a _very_ small window. Signed-off-by: Akinobu Mita <akinobu.mita-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Reported-by: Peter Hurley <peter-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org> Cc: Peter Hurley <peter-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org> Cc: Chuck Ebbert <cebbert.lkml-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Cc: Marek Szyprowski <m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> Cc: Konrad Rzeszutek Wilk <konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> Cc: David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> Cc: Don Dutile <ddutile-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> Cc: Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org> Cc: Ingo Molnar <mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> Cc: "H. Peter Anvin" <hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org> Cc: Andi Kleen <andi-Vw/NltI1exuRpAAqCnN02g@public.gmane.org> Cc: Yinghai Lu <yinghai-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> Cc: x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org --- drivers/base/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig index 4e7f0ff..92a5987e 100644 --- a/drivers/base/Kconfig +++ b/drivers/base/Kconfig @@ -240,6 +240,7 @@ comment "Default contiguous memory area size:" config CMA_SIZE_MBYTES int "Size in Mega Bytes" depends on !CMA_SIZE_SEL_PERCENTAGE + default 0 if X86 default 16 help Defines the size (in MiB) of the default memory area for Contiguous @@ -248,6 +249,7 @@ config CMA_SIZE_MBYTES config CMA_SIZE_PERCENTAGE int "Percentage of total memory" depends on !CMA_SIZE_SEL_MBYTES + default 0 if X86 default 10 help Defines the size of the default memory area for Contiguous Memory -- 1.9.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] cma: make default CMA area size zero for x86 @ 2014-10-05 6:02 ` Akinobu Mita 0 siblings, 0 replies; 6+ messages in thread From: Akinobu Mita @ 2014-10-05 6:02 UTC (permalink / raw) To: linux-kernel, akpm Cc: Akinobu Mita, Peter Hurley, Chuck Ebbert, Marek Szyprowski, Konrad Rzeszutek Wilk, David Woodhouse, Don Dutile, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Andi Kleen, Yinghai Lu, x86, iommu This makes CMA memory area size zero for x86 in default configuration (doesn't change on the other architectures). If default CMA size is zero, DMA_CMA is disabled. It can be enabled by passing cma= to the kernel. This makes less impact on x86. Because there is no mainline driver that requires it for x86, and Peter Hurley reported the performance regression, as this is trying to drive _all_ dma mapping allocations through a _very_ small window. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Reported-by: Peter Hurley <peter@hurleysoftware.com> Cc: Peter Hurley <peter@hurleysoftware.com> Cc: Chuck Ebbert <cebbert.lkml@gmail.com> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Don Dutile <ddutile@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Yinghai Lu <yinghai@kernel.org> Cc: x86@kernel.org Cc: iommu@lists.linux-foundation.org --- drivers/base/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig index 4e7f0ff..92a5987e 100644 --- a/drivers/base/Kconfig +++ b/drivers/base/Kconfig @@ -240,6 +240,7 @@ comment "Default contiguous memory area size:" config CMA_SIZE_MBYTES int "Size in Mega Bytes" depends on !CMA_SIZE_SEL_PERCENTAGE + default 0 if X86 default 16 help Defines the size (in MiB) of the default memory area for Contiguous @@ -248,6 +249,7 @@ config CMA_SIZE_MBYTES config CMA_SIZE_PERCENTAGE int "Percentage of total memory" depends on !CMA_SIZE_SEL_MBYTES + default 0 if X86 default 10 help Defines the size of the default memory area for Contiguous Memory -- 1.9.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
[parent not found: <1412488976-3885-1-git-send-email-akinobu.mita-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH] cma: make default CMA area size zero for x86 2014-10-05 6:02 ` Akinobu Mita @ 2014-10-05 10:47 ` Chuck Ebbert -1 siblings, 0 replies; 6+ messages in thread From: Chuck Ebbert @ 2014-10-05 10:47 UTC (permalink / raw) To: Akinobu Mita Cc: Andi Kleen, Peter Hurley, Yinghai Lu, x86-DgEjT+Ai2ygdnm+yROfE0A, linux-kernel-u79uwXL29TY76Z2rM5mHXA, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Ingo Molnar, H. Peter Anvin, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, David Woodhouse, Thomas Gleixner, Jean Delvare On Sun, 5 Oct 2014 15:02:56 +0900 Akinobu Mita <akinobu.mita-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > This makes CMA memory area size zero for x86 in default configuration > (doesn't change on the other architectures). If default CMA size is > zero, DMA_CMA is disabled. It can be enabled by passing cma= to the > kernel. > > This makes less impact on x86. Because there is no mainline driver that > requires it for x86, and Peter Hurley reported the performance > regression, as this is trying to drive _all_ dma mapping allocations > through a _very_ small window. > > Signed-off-by: Akinobu Mita <akinobu.mita-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > Reported-by: Peter Hurley <peter-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org> > Cc: Peter Hurley <peter-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org> > Cc: Chuck Ebbert <cebbert.lkml-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > Cc: Marek Szyprowski <m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> > Cc: Konrad Rzeszutek Wilk <konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> > Cc: David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> > Cc: Don Dutile <ddutile-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > Cc: Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org> > Cc: Ingo Molnar <mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > Cc: "H. Peter Anvin" <hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org> > Cc: Andi Kleen <andi-Vw/NltI1exuRpAAqCnN02g@public.gmane.org> > Cc: Yinghai Lu <yinghai-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> > Cc: x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org > Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org > --- > drivers/base/Kconfig | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig > index 4e7f0ff..92a5987e 100644 > --- a/drivers/base/Kconfig > +++ b/drivers/base/Kconfig > @@ -240,6 +240,7 @@ comment "Default contiguous memory area size:" > config CMA_SIZE_MBYTES > int "Size in Mega Bytes" > depends on !CMA_SIZE_SEL_PERCENTAGE > + default 0 if X86 > default 16 > help > Defines the size (in MiB) of the default memory area for Contiguous > @@ -248,6 +249,7 @@ config CMA_SIZE_MBYTES > config CMA_SIZE_PERCENTAGE > int "Percentage of total memory" > depends on !CMA_SIZE_SEL_MBYTES > + default 0 if X86 > default 10 > help > Defines the size of the default memory area for Contiguous Memory You probably need to add some documentation too. Jean Delvare proposed the below, before your change. If the default is going to be zero on x86, that information and some further help should be added to this. ------------------------ From: Jean Delvare <jdelvare-l3A5Bk7waGM@public.gmane.org> Subject: [PATCH] CMA: Document cma=0 It isn't obvious that CMA can be disabled on the kernel's command line, so document it. Signed-off-by: Jean Delvare <jdelvare-l3A5Bk7waGM@public.gmane.org> Cc: Joonsoo Kim <iamjoonsoo.kim-Hm3cg6mZ9cc@public.gmane.org> Cc: Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org> --- Documentation/kernel-parameters.txt | 3 ++- drivers/base/Kconfig | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) --- linux-3.17-rc7.orig/Documentation/kernel-parameters.txt 2014-09-23 13:19:06.644838292 +0200 +++ linux-3.17-rc7/Documentation/kernel-parameters.txt 2014-10-04 14:10:03.257579721 +0200 @@ -656,7 +656,8 @@ bytes respectively. Such letter suffixes Sets the size of kernel global memory area for contiguous memory allocations and optionally the placement constraint by the physical address range of - memory allocations. For more information, see + memory allocations. A value of 0 disables CMA + altogether. For more information, see include/linux/dma-contiguous.h cmo_free_hint= [PPC] Format: { yes | no } --- linux-3.17-rc7.orig/drivers/base/Kconfig 2014-09-12 16:23:14.911353676 +0200 +++ linux-3.17-rc7/drivers/base/Kconfig 2014-10-04 13:41:37.672347240 +0200 @@ -231,6 +231,9 @@ config DMA_CMA to allocate big physically-contiguous blocks of memory for use with hardware components that do not support I/O map nor scatter-gather. + You can disable CMA by specifying "cma=0" on the kernel's command + line. + For more information see <include/linux/dma-contiguous.h>. If unsure, say "n". ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] cma: make default CMA area size zero for x86 @ 2014-10-05 10:47 ` Chuck Ebbert 0 siblings, 0 replies; 6+ messages in thread From: Chuck Ebbert @ 2014-10-05 10:47 UTC (permalink / raw) To: Akinobu Mita Cc: linux-kernel, akpm, Peter Hurley, Marek Szyprowski, Konrad Rzeszutek Wilk, David Woodhouse, Don Dutile, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Andi Kleen, Yinghai Lu, x86, iommu, Jean Delvare On Sun, 5 Oct 2014 15:02:56 +0900 Akinobu Mita <akinobu.mita@gmail.com> wrote: > This makes CMA memory area size zero for x86 in default configuration > (doesn't change on the other architectures). If default CMA size is > zero, DMA_CMA is disabled. It can be enabled by passing cma= to the > kernel. > > This makes less impact on x86. Because there is no mainline driver that > requires it for x86, and Peter Hurley reported the performance > regression, as this is trying to drive _all_ dma mapping allocations > through a _very_ small window. > > Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> > Reported-by: Peter Hurley <peter@hurleysoftware.com> > Cc: Peter Hurley <peter@hurleysoftware.com> > Cc: Chuck Ebbert <cebbert.lkml@gmail.com> > Cc: Marek Szyprowski <m.szyprowski@samsung.com> > Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> > Cc: David Woodhouse <dwmw2@infradead.org> > Cc: Don Dutile <ddutile@redhat.com> > Cc: Thomas Gleixner <tglx@linutronix.de> > Cc: Ingo Molnar <mingo@redhat.com> > Cc: "H. Peter Anvin" <hpa@zytor.com> > Cc: Andi Kleen <andi@firstfloor.org> > Cc: Yinghai Lu <yinghai@kernel.org> > Cc: x86@kernel.org > Cc: iommu@lists.linux-foundation.org > --- > drivers/base/Kconfig | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig > index 4e7f0ff..92a5987e 100644 > --- a/drivers/base/Kconfig > +++ b/drivers/base/Kconfig > @@ -240,6 +240,7 @@ comment "Default contiguous memory area size:" > config CMA_SIZE_MBYTES > int "Size in Mega Bytes" > depends on !CMA_SIZE_SEL_PERCENTAGE > + default 0 if X86 > default 16 > help > Defines the size (in MiB) of the default memory area for Contiguous > @@ -248,6 +249,7 @@ config CMA_SIZE_MBYTES > config CMA_SIZE_PERCENTAGE > int "Percentage of total memory" > depends on !CMA_SIZE_SEL_MBYTES > + default 0 if X86 > default 10 > help > Defines the size of the default memory area for Contiguous Memory You probably need to add some documentation too. Jean Delvare proposed the below, before your change. If the default is going to be zero on x86, that information and some further help should be added to this. ------------------------ From: Jean Delvare <jdelvare@suse.de> Subject: [PATCH] CMA: Document cma=0 It isn't obvious that CMA can be disabled on the kernel's command line, so document it. Signed-off-by: Jean Delvare <jdelvare@suse.de> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- Documentation/kernel-parameters.txt | 3 ++- drivers/base/Kconfig | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) --- linux-3.17-rc7.orig/Documentation/kernel-parameters.txt 2014-09-23 13:19:06.644838292 +0200 +++ linux-3.17-rc7/Documentation/kernel-parameters.txt 2014-10-04 14:10:03.257579721 +0200 @@ -656,7 +656,8 @@ bytes respectively. Such letter suffixes Sets the size of kernel global memory area for contiguous memory allocations and optionally the placement constraint by the physical address range of - memory allocations. For more information, see + memory allocations. A value of 0 disables CMA + altogether. For more information, see include/linux/dma-contiguous.h cmo_free_hint= [PPC] Format: { yes | no } --- linux-3.17-rc7.orig/drivers/base/Kconfig 2014-09-12 16:23:14.911353676 +0200 +++ linux-3.17-rc7/drivers/base/Kconfig 2014-10-04 13:41:37.672347240 +0200 @@ -231,6 +231,9 @@ config DMA_CMA to allocate big physically-contiguous blocks of memory for use with hardware components that do not support I/O map nor scatter-gather. + You can disable CMA by specifying "cma=0" on the kernel's command + line. + For more information see <include/linux/dma-contiguous.h>. If unsure, say "n". ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] cma: make default CMA area size zero for x86 2014-10-05 10:47 ` Chuck Ebbert @ 2014-10-05 13:25 ` Akinobu Mita -1 siblings, 0 replies; 6+ messages in thread From: Akinobu Mita @ 2014-10-05 13:25 UTC (permalink / raw) To: Chuck Ebbert Cc: Andi Kleen, Peter Hurley, Yinghai Lu, x86-DgEjT+Ai2ygdnm+yROfE0A, LKML, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Ingo Molnar, H. Peter Anvin, Andrew Morton, David Woodhouse, Thomas Gleixner, Jean Delvare 2014-10-05 19:47 GMT+09:00 Chuck Ebbert <cebbert.lkml-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > On Sun, 5 Oct 2014 15:02:56 +0900 > Akinobu Mita <akinobu.mita-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> This makes CMA memory area size zero for x86 in default configuration >> (doesn't change on the other architectures). If default CMA size is >> zero, DMA_CMA is disabled. It can be enabled by passing cma= to the >> kernel. >> >> This makes less impact on x86. Because there is no mainline driver that >> requires it for x86, and Peter Hurley reported the performance >> regression, as this is trying to drive _all_ dma mapping allocations >> through a _very_ small window. >> >> Signed-off-by: Akinobu Mita <akinobu.mita-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> Reported-by: Peter Hurley <peter-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org> >> Cc: Peter Hurley <peter-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org> >> Cc: Chuck Ebbert <cebbert.lkml-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> Cc: Marek Szyprowski <m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> >> Cc: Konrad Rzeszutek Wilk <konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> >> Cc: David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> >> Cc: Don Dutile <ddutile-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> >> Cc: Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org> >> Cc: Ingo Molnar <mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> >> Cc: "H. Peter Anvin" <hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org> >> Cc: Andi Kleen <andi-Vw/NltI1exuRpAAqCnN02g@public.gmane.org> >> Cc: Yinghai Lu <yinghai-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> >> Cc: x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org >> Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org >> --- >> drivers/base/Kconfig | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig >> index 4e7f0ff..92a5987e 100644 >> --- a/drivers/base/Kconfig >> +++ b/drivers/base/Kconfig >> @@ -240,6 +240,7 @@ comment "Default contiguous memory area size:" >> config CMA_SIZE_MBYTES >> int "Size in Mega Bytes" >> depends on !CMA_SIZE_SEL_PERCENTAGE >> + default 0 if X86 >> default 16 >> help >> Defines the size (in MiB) of the default memory area for Contiguous >> @@ -248,6 +249,7 @@ config CMA_SIZE_MBYTES >> config CMA_SIZE_PERCENTAGE >> int "Percentage of total memory" >> depends on !CMA_SIZE_SEL_MBYTES >> + default 0 if X86 >> default 10 >> help >> Defines the size of the default memory area for Contiguous Memory > > You probably need to add some documentation too. Jean Delvare proposed > the below, before your change. If the default is going to be zero on > x86, that information and some further help should be added to this. OK, I'll add information in help text for CONFIG_CMA_SIZE_MBYTES and CONFIG_CMA_SIZE_PERCENTAGE. Jean's patch adds information in CONFIG_DMA_CMA, so this change doesn't conflict his patch. > ------------------------ > > From: Jean Delvare <jdelvare-l3A5Bk7waGM@public.gmane.org> > Subject: [PATCH] CMA: Document cma=0 > > It isn't obvious that CMA can be disabled on the kernel's command > line, so document it. > > Signed-off-by: Jean Delvare <jdelvare-l3A5Bk7waGM@public.gmane.org> > Cc: Joonsoo Kim <iamjoonsoo.kim-Hm3cg6mZ9cc@public.gmane.org> > Cc: Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org> > --- > Documentation/kernel-parameters.txt | 3 ++- > drivers/base/Kconfig | 3 +++ > 2 files changed, 5 insertions(+), 1 deletion(-) > > --- linux-3.17-rc7.orig/Documentation/kernel-parameters.txt 2014-09-23 13:19:06.644838292 +0200 > +++ linux-3.17-rc7/Documentation/kernel-parameters.txt 2014-10-04 14:10:03.257579721 +0200 > @@ -656,7 +656,8 @@ bytes respectively. Such letter suffixes > Sets the size of kernel global memory area for > contiguous memory allocations and optionally the > placement constraint by the physical address range of > - memory allocations. For more information, see > + memory allocations. A value of 0 disables CMA > + altogether. For more information, see > include/linux/dma-contiguous.h > > cmo_free_hint= [PPC] Format: { yes | no } > --- linux-3.17-rc7.orig/drivers/base/Kconfig 2014-09-12 16:23:14.911353676 +0200 > +++ linux-3.17-rc7/drivers/base/Kconfig 2014-10-04 13:41:37.672347240 +0200 > @@ -231,6 +231,9 @@ config DMA_CMA > to allocate big physically-contiguous blocks of memory for use with > hardware components that do not support I/O map nor scatter-gather. > > + You can disable CMA by specifying "cma=0" on the kernel's command > + line. > + > For more information see <include/linux/dma-contiguous.h>. > If unsure, say "n". > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] cma: make default CMA area size zero for x86 @ 2014-10-05 13:25 ` Akinobu Mita 0 siblings, 0 replies; 6+ messages in thread From: Akinobu Mita @ 2014-10-05 13:25 UTC (permalink / raw) To: Chuck Ebbert Cc: LKML, Andrew Morton, Peter Hurley, Marek Szyprowski, Konrad Rzeszutek Wilk, David Woodhouse, Don Dutile, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Andi Kleen, Yinghai Lu, x86, iommu, Jean Delvare 2014-10-05 19:47 GMT+09:00 Chuck Ebbert <cebbert.lkml@gmail.com>: > On Sun, 5 Oct 2014 15:02:56 +0900 > Akinobu Mita <akinobu.mita@gmail.com> wrote: > >> This makes CMA memory area size zero for x86 in default configuration >> (doesn't change on the other architectures). If default CMA size is >> zero, DMA_CMA is disabled. It can be enabled by passing cma= to the >> kernel. >> >> This makes less impact on x86. Because there is no mainline driver that >> requires it for x86, and Peter Hurley reported the performance >> regression, as this is trying to drive _all_ dma mapping allocations >> through a _very_ small window. >> >> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> >> Reported-by: Peter Hurley <peter@hurleysoftware.com> >> Cc: Peter Hurley <peter@hurleysoftware.com> >> Cc: Chuck Ebbert <cebbert.lkml@gmail.com> >> Cc: Marek Szyprowski <m.szyprowski@samsung.com> >> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> >> Cc: David Woodhouse <dwmw2@infradead.org> >> Cc: Don Dutile <ddutile@redhat.com> >> Cc: Thomas Gleixner <tglx@linutronix.de> >> Cc: Ingo Molnar <mingo@redhat.com> >> Cc: "H. Peter Anvin" <hpa@zytor.com> >> Cc: Andi Kleen <andi@firstfloor.org> >> Cc: Yinghai Lu <yinghai@kernel.org> >> Cc: x86@kernel.org >> Cc: iommu@lists.linux-foundation.org >> --- >> drivers/base/Kconfig | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig >> index 4e7f0ff..92a5987e 100644 >> --- a/drivers/base/Kconfig >> +++ b/drivers/base/Kconfig >> @@ -240,6 +240,7 @@ comment "Default contiguous memory area size:" >> config CMA_SIZE_MBYTES >> int "Size in Mega Bytes" >> depends on !CMA_SIZE_SEL_PERCENTAGE >> + default 0 if X86 >> default 16 >> help >> Defines the size (in MiB) of the default memory area for Contiguous >> @@ -248,6 +249,7 @@ config CMA_SIZE_MBYTES >> config CMA_SIZE_PERCENTAGE >> int "Percentage of total memory" >> depends on !CMA_SIZE_SEL_MBYTES >> + default 0 if X86 >> default 10 >> help >> Defines the size of the default memory area for Contiguous Memory > > You probably need to add some documentation too. Jean Delvare proposed > the below, before your change. If the default is going to be zero on > x86, that information and some further help should be added to this. OK, I'll add information in help text for CONFIG_CMA_SIZE_MBYTES and CONFIG_CMA_SIZE_PERCENTAGE. Jean's patch adds information in CONFIG_DMA_CMA, so this change doesn't conflict his patch. > ------------------------ > > From: Jean Delvare <jdelvare@suse.de> > Subject: [PATCH] CMA: Document cma=0 > > It isn't obvious that CMA can be disabled on the kernel's command > line, so document it. > > Signed-off-by: Jean Delvare <jdelvare@suse.de> > Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > --- > Documentation/kernel-parameters.txt | 3 ++- > drivers/base/Kconfig | 3 +++ > 2 files changed, 5 insertions(+), 1 deletion(-) > > --- linux-3.17-rc7.orig/Documentation/kernel-parameters.txt 2014-09-23 13:19:06.644838292 +0200 > +++ linux-3.17-rc7/Documentation/kernel-parameters.txt 2014-10-04 14:10:03.257579721 +0200 > @@ -656,7 +656,8 @@ bytes respectively. Such letter suffixes > Sets the size of kernel global memory area for > contiguous memory allocations and optionally the > placement constraint by the physical address range of > - memory allocations. For more information, see > + memory allocations. A value of 0 disables CMA > + altogether. For more information, see > include/linux/dma-contiguous.h > > cmo_free_hint= [PPC] Format: { yes | no } > --- linux-3.17-rc7.orig/drivers/base/Kconfig 2014-09-12 16:23:14.911353676 +0200 > +++ linux-3.17-rc7/drivers/base/Kconfig 2014-10-04 13:41:37.672347240 +0200 > @@ -231,6 +231,9 @@ config DMA_CMA > to allocate big physically-contiguous blocks of memory for use with > hardware components that do not support I/O map nor scatter-gather. > > + You can disable CMA by specifying "cma=0" on the kernel's command > + line. > + > For more information see <include/linux/dma-contiguous.h>. > If unsure, say "n". > ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-10-05 13:25 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-05 6:02 [PATCH] cma: make default CMA area size zero for x86 Akinobu Mita
2014-10-05 6:02 ` Akinobu Mita
[not found] ` <1412488976-3885-1-git-send-email-akinobu.mita-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-10-05 10:47 ` Chuck Ebbert
2014-10-05 10:47 ` Chuck Ebbert
2014-10-05 13:25 ` Akinobu Mita
2014-10-05 13:25 ` Akinobu Mita
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.