2013-04-22 15:23:54

by vinayak menon

[permalink] [raw]
Subject: [PATCH] mm: add an option to disable bounce

From: Vinayak Menon <[email protected]>

There are times when HIGHMEM is enabled, but
we don't prefer CONFIG_BOUNCE to be enabled.
CONFIG_BOUNCE can reduce the block device
throughput, and this is not ideal for machines
where we don't gain much by enabling it. So
provide an option to deselect CONFIG_BOUNCE. The
observation was made while measuring eMMC throughput
using iozone on an ARM device with 1GB RAM.

Signed-off-by: Vinayak Menon <[email protected]>
---
mm/Kconfig | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/mm/Kconfig b/mm/Kconfig
index 3bea74f..29f9736 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -263,8 +263,14 @@ config ZONE_DMA_FLAG
default "1"

config BOUNCE
+ bool "Enable bounce buffers"
def_bool y
depends on BLOCK && MMU && (ZONE_DMA || HIGHMEM)
+ help
+ Enable bounce buffers for devices that cannot access
+ the full range of memory available to the CPU. Enabled
+ by default when ZONE_DMA or HIGMEM is selected, but you
+ may say n to override this.

# On the 'tile' arch, USB OHCI needs the bounce pool since tilegx will often
# have more than 4GB of memory, but we don't currently use the IOTLB to present
--
1.7.10.4


2013-04-22 16:58:36

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH] mm: add an option to disable bounce

On 04/22/13 08:23, [email protected] wrote:
> From: Vinayak Menon <[email protected]>
>
> There are times when HIGHMEM is enabled, but
> we don't prefer CONFIG_BOUNCE to be enabled.
> CONFIG_BOUNCE can reduce the block device
> throughput, and this is not ideal for machines
> where we don't gain much by enabling it. So
> provide an option to deselect CONFIG_BOUNCE. The
> observation was made while measuring eMMC throughput
> using iozone on an ARM device with 1GB RAM.
>
> Signed-off-by: Vinayak Menon <[email protected]>
> ---
> mm/Kconfig | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/mm/Kconfig b/mm/Kconfig
> index 3bea74f..29f9736 100644
> --- a/mm/Kconfig
> +++ b/mm/Kconfig
> @@ -263,8 +263,14 @@ config ZONE_DMA_FLAG
> default "1"
>
> config BOUNCE
> + bool "Enable bounce buffers"
> def_bool y
> depends on BLOCK && MMU && (ZONE_DMA || HIGHMEM)
> + help
> + Enable bounce buffers for devices that cannot access
> + the full range of memory available to the CPU. Enabled
> + by default when ZONE_DMA or HIGMEM is selected, but you

HIGHMEM

> + may say n to override this.
>
> # On the 'tile' arch, USB OHCI needs the bounce pool since tilegx will often
> # have more than 4GB of memory, but we don't currently use the IOTLB to present
>


--
~Randy

2013-04-22 17:38:01

by vinayak menon

[permalink] [raw]
Subject: Re: [PATCH] mm: add an option to disable bounce

On Monday 22 April 2013 10:28 PM, Randy Dunlap wrote:

> On 04/22/13 08:23, [email protected] wrote:
>> From: Vinayak Menon <[email protected]>
>>
>> There are times when HIGHMEM is enabled, but
>> we don't prefer CONFIG_BOUNCE to be enabled.
>> CONFIG_BOUNCE can reduce the block device
>> throughput, and this is not ideal for machines
>> where we don't gain much by enabling it. So
>> provide an option to deselect CONFIG_BOUNCE. The
>> observation was made while measuring eMMC throughput
>> using iozone on an ARM device with 1GB RAM.
>>
>> Signed-off-by: Vinayak Menon <[email protected]>
>> ---
>> mm/Kconfig | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/mm/Kconfig b/mm/Kconfig
>> index 3bea74f..29f9736 100644
>> --- a/mm/Kconfig
>> +++ b/mm/Kconfig
>> @@ -263,8 +263,14 @@ config ZONE_DMA_FLAG
>> default "1"
>>
>> config BOUNCE
>> + bool "Enable bounce buffers"
>> def_bool y
>> depends on BLOCK && MMU && (ZONE_DMA || HIGHMEM)
>> + help
>> + Enable bounce buffers for devices that cannot access
>> + the full range of memory available to the CPU. Enabled
>> + by default when ZONE_DMA or HIGMEM is selected, but you
>
> HIGHMEM


Thanks. I will correct this.

>
>> + may say n to override this.
>>
>> # On the 'tile' arch, USB OHCI needs the bounce pool since tilegx will often
>> # have more than 4GB of memory, but we don't currently use the IOTLB to present
>>
>
>

2013-04-22 17:47:27

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH] mm: add an option to disable bounce

On Mon, Apr 22, 2013 at 08:53:00PM +0530, [email protected] wrote:
> From: Vinayak Menon <[email protected]>
>
> There are times when HIGHMEM is enabled, but
> we don't prefer CONFIG_BOUNCE to be enabled.
> CONFIG_BOUNCE can reduce the block device
> throughput, and this is not ideal for machines
> where we don't gain much by enabling it. So
> provide an option to deselect CONFIG_BOUNCE. The
> observation was made while measuring eMMC throughput
> using iozone on an ARM device with 1GB RAM.
>
> Signed-off-by: Vinayak Menon <[email protected]>
> ---
> mm/Kconfig | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/mm/Kconfig b/mm/Kconfig
> index 3bea74f..29f9736 100644
> --- a/mm/Kconfig
> +++ b/mm/Kconfig
> @@ -263,8 +263,14 @@ config ZONE_DMA_FLAG
> default "1"
>
> config BOUNCE
> + bool "Enable bounce buffers"
> def_bool y
> depends on BLOCK && MMU && (ZONE_DMA || HIGHMEM)

I don't think this is correct. You shouldn't use "bool" with "def_bool".
Sure, add the "bool", but also change "def_bool" to "default".

2013-04-22 18:19:05

by vinayak menon

[permalink] [raw]
Subject: Re: [PATCH] mm: add an option to disable bounce

On Monday 22 April 2013 11:17 PM, Russell King - ARM Linux wrote:

> On Mon, Apr 22, 2013 at 08:53:00PM +0530, [email protected] wrote:
>> From: Vinayak Menon <[email protected]>
>>
>> There are times when HIGHMEM is enabled, but
>> we don't prefer CONFIG_BOUNCE to be enabled.
>> CONFIG_BOUNCE can reduce the block device
>> throughput, and this is not ideal for machines
>> where we don't gain much by enabling it. So
>> provide an option to deselect CONFIG_BOUNCE. The
>> observation was made while measuring eMMC throughput
>> using iozone on an ARM device with 1GB RAM.
>>
>> Signed-off-by: Vinayak Menon <[email protected]>
>> ---
>> mm/Kconfig | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/mm/Kconfig b/mm/Kconfig
>> index 3bea74f..29f9736 100644
>> --- a/mm/Kconfig
>> +++ b/mm/Kconfig
>> @@ -263,8 +263,14 @@ config ZONE_DMA_FLAG
>> default "1"
>>
>> config BOUNCE
>> + bool "Enable bounce buffers"
>> def_bool y
>> depends on BLOCK && MMU && (ZONE_DMA || HIGHMEM)
>
> I don't think this is correct. You shouldn't use "bool" with "def_bool".
> Sure, add the "bool", but also change "def_bool" to "default".


Yes. I will change it to "default" and this looks to be correct
even from the definition in kconfig-language.txt. But I see other
instances in mm/Kconfig, where bool and def_bool are used together. When
I had tested this patch with def_bool, it worked as expected.

2013-04-29 20:46:21

by KOSAKI Motohiro

[permalink] [raw]
Subject: Re: [PATCH] mm: add an option to disable bounce

(4/22/13 11:23 AM), [email protected] wrote:
> From: Vinayak Menon <[email protected]>
>
> There are times when HIGHMEM is enabled, but
> we don't prefer CONFIG_BOUNCE to be enabled.
> CONFIG_BOUNCE can reduce the block device
> throughput, and this is not ideal for machines
> where we don't gain much by enabling it. So
> provide an option to deselect CONFIG_BOUNCE. The
> observation was made while measuring eMMC throughput
> using iozone on an ARM device with 1GB RAM.
>
> Signed-off-by: Vinayak Menon <[email protected]>
> ---
> mm/Kconfig | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/mm/Kconfig b/mm/Kconfig
> index 3bea74f..29f9736 100644
> --- a/mm/Kconfig
> +++ b/mm/Kconfig
> @@ -263,8 +263,14 @@ config ZONE_DMA_FLAG
> default "1"
>
> config BOUNCE
> + bool "Enable bounce buffers"
> def_bool y
> depends on BLOCK && MMU && (ZONE_DMA || HIGHMEM)
> + help
> + Enable bounce buffers for devices that cannot access
> + the full range of memory available to the CPU. Enabled
> + by default when ZONE_DMA or HIGMEM is selected, but you
> + may say n to override this.

This should depend on CONFIG_EXPERT. Because this makes typically worse result
on typical desktop machine.