public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: Remove dma32_reserve_bootmem
@ 2011-03-28 17:56 Yinghai Lu
  2011-04-12 16:11 ` Jesse Barnes
  0 siblings, 1 reply; 8+ messages in thread
From: Yinghai Lu @ 2011-03-28 17:56 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Jesse Barnes
  Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org


That is workaround for holding dma32 buf when early bootmem could use up
those range on system that have lots of RAM.

Now x86 is using memblock, and even nobootmem wrapper do top-down allocation.

So We could remove those not needed code now.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
  arch/x86/include/asm/pci.h |    2 -
  arch/x86/kernel/pci-dma.c  |   64 ---------------------------------------------
  arch/x86/kernel/setup.c    |    1
  3 files changed, 67 deletions(-)

Index: linux-2.6/arch/x86/include/asm/pci.h
===================================================================
--- linux-2.6.orig/arch/x86/include/asm/pci.h
+++ linux-2.6/arch/x86/include/asm/pci.h
@@ -135,8 +135,6 @@ void default_teardown_msi_irqs(struct pc
  #include "pci_64.h"
  #endif
  
-void dma32_reserve_bootmem(void);
-
  /* implement the pci_ DMA API in terms of the generic device dma_ one */
  #include <asm-generic/pci-dma-compat.h>
  
Index: linux-2.6/arch/x86/kernel/pci-dma.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/pci-dma.c
+++ linux-2.6/arch/x86/kernel/pci-dma.c
@@ -68,74 +68,10 @@ int dma_set_mask(struct device *dev, u64
  }
  EXPORT_SYMBOL(dma_set_mask);
  
-#if defined(CONFIG_X86_64) && !defined(CONFIG_NUMA)
-static __initdata void *dma32_bootmem_ptr;
-static unsigned long dma32_bootmem_size __initdata = (128ULL<<20);
-
-static int __init parse_dma32_size_opt(char *p)
-{
-	if (!p)
-		return -EINVAL;
-	dma32_bootmem_size = memparse(p, &p);
-	return 0;
-}
-early_param("dma32_size", parse_dma32_size_opt);
-
-void __init dma32_reserve_bootmem(void)
-{
-	unsigned long size, align;
-	if (max_pfn <= MAX_DMA32_PFN)
-		return;
-
-	/*
-	 * check aperture_64.c allocate_aperture() for reason about
-	 * using 512M as goal
-	 */
-	align = 64ULL<<20;
-	size = roundup(dma32_bootmem_size, align);
-	dma32_bootmem_ptr = __alloc_bootmem_nopanic(size, align,
-				 512ULL<<20);
-	/*
-	 * Kmemleak should not scan this block as it may not be mapped via the
-	 * kernel direct mapping.
-	 */
-	kmemleak_ignore(dma32_bootmem_ptr);
-	if (dma32_bootmem_ptr)
-		dma32_bootmem_size = size;
-	else
-		dma32_bootmem_size = 0;
-}
-static void __init dma32_free_bootmem(void)
-{
-
-	if (max_pfn <= MAX_DMA32_PFN)
-		return;
-
-	if (!dma32_bootmem_ptr)
-		return;
-
-	free_bootmem(__pa(dma32_bootmem_ptr), dma32_bootmem_size);
-
-	dma32_bootmem_ptr = NULL;
-	dma32_bootmem_size = 0;
-}
-#else
-void __init dma32_reserve_bootmem(void)
-{
-}
-static void __init dma32_free_bootmem(void)
-{
-}
-
-#endif
-
  void __init pci_iommu_alloc(void)
  {
  	struct iommu_table_entry *p;
  
-	/* free the range so iommu could get some range less than 4G */
-	dma32_free_bootmem();
-
  	sort_iommu_table(__iommu_table, __iommu_table_end);
  	check_iommu_entries(__iommu_table, __iommu_table_end);
  
Index: linux-2.6/arch/x86/kernel/setup.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/setup.c
+++ linux-2.6/arch/x86/kernel/setup.c
@@ -988,7 +988,6 @@ void __init setup_arch(char **cmdline_p)
  
  	initmem_init();
  	memblock_find_dma_reserve();
-	dma32_reserve_bootmem();
  
  #ifdef CONFIG_KVM_CLOCK
  	kvmclock_init();

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

* Re: [PATCH] x86: Remove dma32_reserve_bootmem
  2011-03-28 17:56 [PATCH] x86: Remove dma32_reserve_bootmem Yinghai Lu
@ 2011-04-12 16:11 ` Jesse Barnes
  2011-04-12 17:20   ` [PATCH -v2] " Yinghai Lu
  0 siblings, 1 reply; 8+ messages in thread
From: Jesse Barnes @ 2011-04-12 16:11 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org

On Mon, 28 Mar 2011 10:56:53 -0700
Yinghai Lu <yinghai@kernel.org> wrote:

> 
> That is workaround for holding dma32 buf when early bootmem could use up
> those range on system that have lots of RAM.
> 
> Now x86 is using memblock, and even nobootmem wrapper do top-down allocation.
> 
> So We could remove those not needed code now.
> 
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> 

Looks like a nice cleanup, can you re-send based on my linux-next
branch?

Thanks,
-- 
Jesse Barnes, Intel Open Source Technology Center

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

* [PATCH -v2] x86: Remove dma32_reserve_bootmem
  2011-04-12 16:11 ` Jesse Barnes
@ 2011-04-12 17:20   ` Yinghai Lu
  2011-04-12 17:47     ` Jesse Barnes
  0 siblings, 1 reply; 8+ messages in thread
From: Yinghai Lu @ 2011-04-12 17:20 UTC (permalink / raw)
  To: Jesse Barnes
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org


That is workaround for holding dma32 buf when early bootmem could use up
those range on system that have lots of RAM.

Now x86 is using memblock, and even nobootmem wrapper do top-down allocation.

So We could remove those not needed code now.

-v2: rebase on pci-next

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
  arch/x86/include/asm/pci.h |    2 -
  arch/x86/kernel/pci-dma.c  |   64 ---------------------------------------------
  arch/x86/kernel/setup.c    |    1
  3 files changed, 67 deletions(-)

Index: linux-2.6/arch/x86/include/asm/pci.h
===================================================================
--- linux-2.6.orig/arch/x86/include/asm/pci.h
+++ linux-2.6/arch/x86/include/asm/pci.h
@@ -135,8 +135,6 @@ void default_teardown_msi_irqs(struct pc
  #include "pci_64.h"
  #endif
  
-void dma32_reserve_bootmem(void);
-
  /* implement the pci_ DMA API in terms of the generic device dma_ one */
  #include <asm-generic/pci-dma-compat.h>
  
Index: linux-2.6/arch/x86/kernel/pci-dma.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/pci-dma.c
+++ linux-2.6/arch/x86/kernel/pci-dma.c
@@ -68,74 +68,10 @@ int dma_set_mask(struct device *dev, u64
  }
  EXPORT_SYMBOL(dma_set_mask);
  
-#if defined(CONFIG_X86_64) && !defined(CONFIG_NUMA)
-static __initdata void *dma32_bootmem_ptr;
-static unsigned long dma32_bootmem_size __initdata = (128ULL<<20);
-
-static int __init parse_dma32_size_opt(char *p)
-{
-	if (!p)
-		return -EINVAL;
-	dma32_bootmem_size = memparse(p, &p);
-	return 0;
-}
-early_param("dma32_size", parse_dma32_size_opt);
-
-void __init dma32_reserve_bootmem(void)
-{
-	unsigned long size, align;
-	if (max_pfn <= MAX_DMA32_PFN)
-		return;
-
-	/*
-	 * check aperture_64.c allocate_aperture() for reason about
-	 * using 512M as goal
-	 */
-	align = 64ULL<<20;
-	size = roundup(dma32_bootmem_size, align);
-	dma32_bootmem_ptr = __alloc_bootmem_nopanic(size, align,
-				 512ULL<<20);
-	/*
-	 * Kmemleak should not scan this block as it may not be mapped via the
-	 * kernel direct mapping.
-	 */
-	kmemleak_ignore(dma32_bootmem_ptr);
-	if (dma32_bootmem_ptr)
-		dma32_bootmem_size = size;
-	else
-		dma32_bootmem_size = 0;
-}
-static void __init dma32_free_bootmem(void)
-{
-
-	if (max_pfn <= MAX_DMA32_PFN)
-		return;
-
-	if (!dma32_bootmem_ptr)
-		return;
-
-	free_bootmem(__pa(dma32_bootmem_ptr), dma32_bootmem_size);
-
-	dma32_bootmem_ptr = NULL;
-	dma32_bootmem_size = 0;
-}
-#else
-void __init dma32_reserve_bootmem(void)
-{
-}
-static void __init dma32_free_bootmem(void)
-{
-}
-
-#endif
-
  void __init pci_iommu_alloc(void)
  {
  	struct iommu_table_entry *p;
  
-	/* free the range so iommu could get some range less than 4G */
-	dma32_free_bootmem();
-
  	sort_iommu_table(__iommu_table, __iommu_table_end);
  	check_iommu_entries(__iommu_table, __iommu_table_end);
  
Index: linux-2.6/arch/x86/kernel/setup.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/setup.c
+++ linux-2.6/arch/x86/kernel/setup.c
@@ -966,7 +966,6 @@ void __init setup_arch(char **cmdline_p)
  
  	initmem_init();
  	memblock_find_dma_reserve();
-	dma32_reserve_bootmem();
  
  #ifdef CONFIG_KVM_CLOCK
  	kvmclock_init();

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

* Re: [PATCH -v2] x86: Remove dma32_reserve_bootmem
  2011-04-12 17:20   ` [PATCH -v2] " Yinghai Lu
@ 2011-04-12 17:47     ` Jesse Barnes
  2011-04-12 17:54       ` Yinghai Lu
  0 siblings, 1 reply; 8+ messages in thread
From: Jesse Barnes @ 2011-04-12 17:47 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org

On Tue, 12 Apr 2011 10:20:48 -0700
Yinghai Lu <yinghai@kernel.org> wrote:

> 
> That is workaround for holding dma32 buf when early bootmem could use up
> those range on system that have lots of RAM.
> 
> Now x86 is using memblock, and even nobootmem wrapper do top-down allocation.
> 
> So We could remove those not needed code now.
> 
> -v2: rebase on pci-next
> 
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> 

Hm, still didn't apply cleanly, I guess the patch got corrupted.  I
fixed it up by hand and applied to linux-next though, thanks.

-- 
Jesse Barnes, Intel Open Source Technology Center

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

* Re: [PATCH -v2] x86: Remove dma32_reserve_bootmem
  2011-04-12 17:47     ` Jesse Barnes
@ 2011-04-12 17:54       ` Yinghai Lu
  2011-04-12 17:58         ` Jesse Barnes
  0 siblings, 1 reply; 8+ messages in thread
From: Yinghai Lu @ 2011-04-12 17:54 UTC (permalink / raw)
  To: Jesse Barnes
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org

On 04/12/2011 10:47 AM, Jesse Barnes wrote:
> On Tue, 12 Apr 2011 10:20:48 -0700
> Yinghai Lu<yinghai@kernel.org>  wrote:
>
>>
>> That is workaround for holding dma32 buf when early bootmem could use up
>> those range on system that have lots of RAM.
>>
>> Now x86 is using memblock, and even nobootmem wrapper do top-down allocation.
>>
>> So We could remove those not needed code now.
>>
>> -v2: rebase on pci-next
>>
>> Signed-off-by: Yinghai Lu<yinghai@kernel.org>
>>
>
> Hm, still didn't apply cleanly, I guess the patch got corrupted.  I
> fixed it up by hand and applied to linux-next though, thanks.

sorry for that. looks like recent thunderbird upgrade convert TAB to space..

Thanks

Yinghai Lu

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

* Re: [PATCH -v2] x86: Remove dma32_reserve_bootmem
  2011-04-12 17:54       ` Yinghai Lu
@ 2011-04-12 17:58         ` Jesse Barnes
  2011-04-12 19:25           ` Yinghai Lu
  0 siblings, 1 reply; 8+ messages in thread
From: Jesse Barnes @ 2011-04-12 17:58 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org

On Tue, 12 Apr 2011 10:54:14 -0700
Yinghai Lu <yinghai@kernel.org> wrote:

> On 04/12/2011 10:47 AM, Jesse Barnes wrote:
> > On Tue, 12 Apr 2011 10:20:48 -0700
> > Yinghai Lu<yinghai@kernel.org>  wrote:
> >
> >>
> >> That is workaround for holding dma32 buf when early bootmem could use up
> >> those range on system that have lots of RAM.
> >>
> >> Now x86 is using memblock, and even nobootmem wrapper do top-down allocation.
> >>
> >> So We could remove those not needed code now.
> >>
> >> -v2: rebase on pci-next
> >>
> >> Signed-off-by: Yinghai Lu<yinghai@kernel.org>
> >>
> >
> > Hm, still didn't apply cleanly, I guess the patch got corrupted.  I
> > fixed it up by hand and applied to linux-next though, thanks.
> 
> sorry for that. looks like recent thunderbird upgrade convert TAB to space..

Thanks for checking.  I wonder why every mailer (and some MTAs!) feel
the need to molest message content so thoroughly...

-- 
Jesse Barnes, Intel Open Source Technology Center

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

* Re: [PATCH -v2] x86: Remove dma32_reserve_bootmem
  2011-04-12 17:58         ` Jesse Barnes
@ 2011-04-12 19:25           ` Yinghai Lu
  2011-04-12 20:18             ` Yinghai Lu
  0 siblings, 1 reply; 8+ messages in thread
From: Yinghai Lu @ 2011-04-12 19:25 UTC (permalink / raw)
  To: Jesse Barnes
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org

On Tue, Apr 12, 2011 at 10:58 AM, Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
> On Tue, 12 Apr 2011 10:54:14 -0700
> Yinghai Lu <yinghai@kernel.org> wrote:
>
>> On 04/12/2011 10:47 AM, Jesse Barnes wrote:
>> > On Tue, 12 Apr 2011 10:20:48 -0700
>> > Yinghai Lu<yinghai@kernel.org>  wrote:
>> >
>> >>
>> >> That is workaround for holding dma32 buf when early bootmem could use up
>> >> those range on system that have lots of RAM.
>> >>
>> >> Now x86 is using memblock, and even nobootmem wrapper do top-down allocation.
>> >>
>> >> So We could remove those not needed code now.
>> >>
>> >> -v2: rebase on pci-next
>> >>
>> >> Signed-off-by: Yinghai Lu<yinghai@kernel.org>
>> >>
>> >
>> > Hm, still didn't apply cleanly, I guess the patch got corrupted.  I
>> > fixed it up by hand and applied to linux-next though, thanks.
>>
>> sorry for that. looks like recent thunderbird upgrade convert TAB to space..
>
> Thanks for checking.  I wonder why every mailer (and some MTAs!) feel
> the need to molest message content so thoroughly...
>

looks like patchwork and LKML have tab instead of spaces.

https://patchwork.kernel.org/patch/701342/

https://lkml.org/lkml/2011/4/12/358

also it is very interesting: in thunderbox inbox/send box, some mails
are viewed with TAB as spaces.
but source does have TAB.

Yinghai


Yinghai

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

* Re: [PATCH -v2] x86: Remove dma32_reserve_bootmem
  2011-04-12 19:25           ` Yinghai Lu
@ 2011-04-12 20:18             ` Yinghai Lu
  0 siblings, 0 replies; 8+ messages in thread
From: Yinghai Lu @ 2011-04-12 20:18 UTC (permalink / raw)
  To: Jesse Barnes
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org

On Tue, Apr 12, 2011 at 12:25 PM, Yinghai Lu <yinghai@kernel.org> wrote:
> On Tue, Apr 12, 2011 at 10:58 AM, Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
>> On Tue, 12 Apr 2011 10:54:14 -0700
>> Yinghai Lu <yinghai@kernel.org> wrote:
>>
>>> On 04/12/2011 10:47 AM, Jesse Barnes wrote:
>>> > On Tue, 12 Apr 2011 10:20:48 -0700
>>> > Yinghai Lu<yinghai@kernel.org>  wrote:
>>> >
>>> >>
>>> >> That is workaround for holding dma32 buf when early bootmem could use up
>>> >> those range on system that have lots of RAM.
>>> >>
>>> >> Now x86 is using memblock, and even nobootmem wrapper do top-down allocation.
>>> >>
>>> >> So We could remove those not needed code now.
>>> >>
>>> >> -v2: rebase on pci-next
>>> >>
>>> >> Signed-off-by: Yinghai Lu<yinghai@kernel.org>
>>> >>
>>> >
>>> > Hm, still didn't apply cleanly, I guess the patch got corrupted.  I
>>> > fixed it up by hand and applied to linux-next though, thanks.
>>>
>>> sorry for that. looks like recent thunderbird upgrade convert TAB to space..
>>
>> Thanks for checking.  I wonder why every mailer (and some MTAs!) feel
>> the need to molest message content so thoroughly...
>>
>
> looks like patchwork and LKML have tab instead of spaces.
>
> https://patchwork.kernel.org/patch/701342/
>
> https://lkml.org/lkml/2011/4/12/358
>
> also it is very interesting: in thunderbox inbox/send box, some mails
> are viewed with TAB as spaces.
> but source does have TAB.
>

while using thunderbird 3.1.8 to send patch, need to set

mailnews.send_plaintext_flowed

to false.

otherwise viewer could show TAB as spaces.

Yinghai

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

end of thread, other threads:[~2011-04-12 20:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-28 17:56 [PATCH] x86: Remove dma32_reserve_bootmem Yinghai Lu
2011-04-12 16:11 ` Jesse Barnes
2011-04-12 17:20   ` [PATCH -v2] " Yinghai Lu
2011-04-12 17:47     ` Jesse Barnes
2011-04-12 17:54       ` Yinghai Lu
2011-04-12 17:58         ` Jesse Barnes
2011-04-12 19:25           ` Yinghai Lu
2011-04-12 20:18             ` Yinghai Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox