linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: remove IOMMU_VMERGE config option
@ 2010-03-02 23:54 FUJITA Tomonori
  2010-03-03  0:13 ` Michael Ellerman
  0 siblings, 1 reply; 3+ messages in thread
From: FUJITA Tomonori @ 2010-03-02 23:54 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linux-kernel, benh, arnd, davem

Seems that IOMMU_VMERGE option description gives the false
information:

http://marc.info/?l=linux-sparc&m=126753808727669&w=2
http://marc.info/?l=linux-sparc&m=126753880528825&w=2

IOMMU_VMERGE is unnecessary nowadays so how about removing it?

=
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Subject: [PATCH] powerpc: remove IOMMU_VMERGE config option

The description says:

 Cause IO segments sent to a device for DMA to be merged virtually
 by the IOMMU when they happen to have been allocated contiguously.
 This doesn't add pressure to the IOMMU allocator. However, some
 drivers don't support getting large merged segments coming back
 from *_map_sg().

 Most drivers don't have this problem; it is safe to say Y here.

It's out of date. Long ago, drivers didn't have a way to tell IOMMUs
about their segment length limit (that is, the maximum segment length
that they can handle). So IOMMUs merged as many segments as possible
and gave too large segments to drivers.

dma_get_max_seg_size() was introduced to solve the above
problem. Device drives can use the API to tell IOMMU about the maximum
segment length that they can handle. The powerpc IOMMU supports
dma_get_max_seg_size() properly. In addition, the default limit (64K)
should be safe for everyone.

So this config option seems to be unnecessary.

Note that this config option just enables users to disable the virtual
merging by default (powerpc enables it by default). Users can still
disable the virtual merging by the boot parameter.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
 arch/powerpc/Kconfig |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 155d571..2dfa83b 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -314,17 +314,8 @@ config 8XX_MINIMAL_FPEMU
 	  It is recommended that you build a soft-float userspace instead.
 
 config IOMMU_VMERGE
-	bool "Enable IOMMU virtual merging"
+	def_bool y
 	depends on PPC64
-	default y
-	help
-	  Cause IO segments sent to a device for DMA to be merged virtually
-	  by the IOMMU when they happen to have been allocated contiguously.
-	  This doesn't add pressure to the IOMMU allocator. However, some
-	  drivers don't support getting large merged segments coming back
-	  from *_map_sg().
-
-	  Most drivers don't have this problem; it is safe to say Y here.
 
 config IOMMU_HELPER
 	def_bool PPC64
-- 
1.6.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc: remove IOMMU_VMERGE config option
  2010-03-02 23:54 [PATCH] powerpc: remove IOMMU_VMERGE config option FUJITA Tomonori
@ 2010-03-03  0:13 ` Michael Ellerman
  2010-03-03  0:25   ` FUJITA Tomonori
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Ellerman @ 2010-03-03  0:13 UTC (permalink / raw)
  To: FUJITA Tomonori; +Cc: linuxppc-dev, davem, linux-kernel, arnd, benh

[-- Attachment #1: Type: text/plain, Size: 1280 bytes --]

On Wed, 2010-03-03 at 08:54 +0900, FUJITA Tomonori wrote:
> Seems that IOMMU_VMERGE option description gives the false
> information:
> 
> http://marc.info/?l=linux-sparc&m=126753808727669&w=2
> http://marc.info/?l=linux-sparc&m=126753880528825&w=2
> 
> IOMMU_VMERGE is unnecessary nowadays so how about removing it?

Except you didn't remove it, you just made it uneditable? Why not get
rid of it entirely.

cheers

> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 155d571..2dfa83b 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -314,17 +314,8 @@ config 8XX_MINIMAL_FPEMU
>  	  It is recommended that you build a soft-float userspace instead.
>  
>  config IOMMU_VMERGE
> -	bool "Enable IOMMU virtual merging"
> +	def_bool y
>  	depends on PPC64
> -	default y
> -	help
> -	  Cause IO segments sent to a device for DMA to be merged virtually
> -	  by the IOMMU when they happen to have been allocated contiguously.
> -	  This doesn't add pressure to the IOMMU allocator. However, some
> -	  drivers don't support getting large merged segments coming back
> -	  from *_map_sg().
> -
> -	  Most drivers don't have this problem; it is safe to say Y here.
>  
>  config IOMMU_HELPER
>  	def_bool PPC64



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc: remove IOMMU_VMERGE config option
  2010-03-03  0:13 ` Michael Ellerman
@ 2010-03-03  0:25   ` FUJITA Tomonori
  0 siblings, 0 replies; 3+ messages in thread
From: FUJITA Tomonori @ 2010-03-03  0:25 UTC (permalink / raw)
  To: michael; +Cc: arnd, linux-kernel, fujita.tomonori, linuxppc-dev, davem

On Wed, 03 Mar 2010 11:13:52 +1100
Michael Ellerman <michael@ellerman.id.au> wrote:

> On Wed, 2010-03-03 at 08:54 +0900, FUJITA Tomonori wrote:
> > Seems that IOMMU_VMERGE option description gives the false
> > information:
> > 
> > http://marc.info/?l=linux-sparc&m=126753808727669&w=2
> > http://marc.info/?l=linux-sparc&m=126753880528825&w=2
> > 
> > IOMMU_VMERGE is unnecessary nowadays so how about removing it?
> 
> Except you didn't remove it, you just made it uneditable? Why not get
> rid of it entirely.

Oops, yeah, I should have. Here's the second version.

Thanks,

=
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Subject: [PATCH] powerpc: remove IOMMU_VMERGE config option

The description says:

 Cause IO segments sent to a device for DMA to be merged virtually
 by the IOMMU when they happen to have been allocated contiguously.
 This doesn't add pressure to the IOMMU allocator. However, some
 drivers don't support getting large merged segments coming back
 from *_map_sg().

 Most drivers don't have this problem; it is safe to say Y here.

It's out of date. Long ago, drivers didn't have a way to tell IOMMUs
about their segment length limit (that is, the maximum segment length
that they can handle). So IOMMUs merged as many segments as possible
and gave too large segments to drivers.

dma_get_max_seg_size() was introduced to solve the above
problem. Device drives can use the API to tell IOMMU about the maximum
segment length that they can handle. In addition, the default limit
(64K) should be safe for everyone.

So this config option seems to be unnecessary.

Note that this config option just enables users to disable the virtual
merging by default. Users can still disable the virtual merging by the
boot parameter.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
 arch/powerpc/Kconfig        |   13 -------------
 arch/powerpc/kernel/iommu.c |    7 +------
 2 files changed, 1 insertions(+), 19 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 155d571..c984bc5 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -313,19 +313,6 @@ config 8XX_MINIMAL_FPEMU
 
 	  It is recommended that you build a soft-float userspace instead.
 
-config IOMMU_VMERGE
-	bool "Enable IOMMU virtual merging"
-	depends on PPC64
-	default y
-	help
-	  Cause IO segments sent to a device for DMA to be merged virtually
-	  by the IOMMU when they happen to have been allocated contiguously.
-	  This doesn't add pressure to the IOMMU allocator. However, some
-	  drivers don't support getting large merged segments coming back
-	  from *_map_sg().
-
-	  Most drivers don't have this problem; it is safe to say Y here.
-
 config IOMMU_HELPER
 	def_bool PPC64
 
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
index 5547ae6..ec94f90 100644
--- a/arch/powerpc/kernel/iommu.c
+++ b/arch/powerpc/kernel/iommu.c
@@ -42,12 +42,7 @@
 
 #define DBG(...)
 
-#ifdef CONFIG_IOMMU_VMERGE
-static int novmerge = 0;
-#else
-static int novmerge = 1;
-#endif
-
+static int novmerge;
 static int protect4gb = 1;
 
 static void __iommu_free(struct iommu_table *, dma_addr_t, unsigned int);
-- 
1.6.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-03  0:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-02 23:54 [PATCH] powerpc: remove IOMMU_VMERGE config option FUJITA Tomonori
2010-03-03  0:13 ` Michael Ellerman
2010-03-03  0:25   ` FUJITA Tomonori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).