lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 5 Oct 2014 05:47:58 -0500
From:	Chuck Ebbert <cebbert.lkml@...il.com>
To:	Akinobu Mita <akinobu.mita@...il.com>
Cc:	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
	Peter Hurley <peter@...leysoftware.com>,
	Marek Szyprowski <m.szyprowski@...sung.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
	David Woodhouse <dwmw2@...radead.org>,
	Don Dutile <ddutile@...hat.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>, Andi Kleen <andi@...stfloor.org>,
	Yinghai Lu <yinghai@...nel.org>, x86@...nel.org,
	iommu@...ts.linux-foundation.org, Jean Delvare <jdelvare@...e.de>
Subject: Re: [PATCH] cma: make default CMA area size zero for x86

On Sun,  5 Oct 2014 15:02:56 +0900
Akinobu Mita <akinobu.mita@...il.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@...il.com>
> Reported-by: Peter Hurley <peter@...leysoftware.com>
> Cc: Peter Hurley <peter@...leysoftware.com>
> Cc: Chuck Ebbert <cebbert.lkml@...il.com>
> Cc: Marek Szyprowski <m.szyprowski@...sung.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
> Cc: David Woodhouse <dwmw2@...radead.org>
> Cc: Don Dutile <ddutile@...hat.com>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: "H. Peter Anvin" <hpa@...or.com>
> Cc: Andi Kleen <andi@...stfloor.org>
> Cc: Yinghai Lu <yinghai@...nel.org>
> Cc: x86@...nel.org
> Cc: iommu@...ts.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@...e.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@...e.de>
Cc: Joonsoo Kim <iamjoonsoo.kim@....com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.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".
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists