Re: [PATCH 2/3] swiotlb: create __alloc_bootmem_low_nopanic and add support in SWIOTLB

From: Muli Ben-Yehuda <muli_at_il.ibm.com>
Date: 2006-05-07 18:50:36
On Thu, May 04, 2006 at 03:59:29PM -0500, Jon Mason wrote:

> Per Andi Kleen's suggestion in the review of our Calgary IOMMU code, I
> tried to use the alloc_bootmem_nopanic that Andi recently added.
> Unfortunately, it needs low mem for our translation tables, so we needed
> a new function to do this.
> 
> I have updated swiotlb to take advantage of this new function (and
> added an error path to lib/swiotlb.c and resulting fallout from
> calling functions).
> 
> This patch has been tested individually and cumulatively on x86_64 and
> cross-compile tested on IA64.  Since I have no IA64 hardware, any
> testing on that platform would be appreciated.

A couple of minor nits below, otherwise looks good.

> Signed-off-by: Jon Mason <jdmason@us.ibm.com>

Acked-by: Muli Ben-Yehuda <muli@il.ibm.com>

> diff -r b5bb5fea7490 -r 62dc1eb0c5e2 include/linux/bootmem.h
> --- a/include/linux/bootmem.h	Tue Apr 25 18:18:55 2006
> +++ b/include/linux/bootmem.h	Wed Apr 26 16:12:39 2006
> @@ -46,6 +46,7 @@
>  extern void __init free_bootmem (unsigned long addr, unsigned long size);
>  extern void * __init __alloc_bootmem (unsigned long size, unsigned long align, unsigned long goal);
>  extern void * __init __alloc_bootmem_nopanic (unsigned long size, unsigned long align, unsigned long goal);
> +extern void * __init __alloc_bootmem_low_nopanic(unsigned long size, unsigned long align, unsigned long goal);

Would be nice to convert this and the preceding declarations to 80
chars per line, please.

> diff -r b5bb5fea7490 -r 62dc1eb0c5e2 mm/bootmem.c
> --- a/mm/bootmem.c	Tue Apr 25 18:18:55 2006
> +++ b/mm/bootmem.c	Wed Apr 26 16:12:39 2006
> @@ -463,3 +463,16 @@
>  {
>  	return __alloc_bootmem_core(pgdat->bdata, size, align, goal, LOW32LIMIT);
>  }
> +
> +void * __init __alloc_bootmem_low_nopanic(unsigned long size, 
> +					unsigned long align, unsigned long goal)
> +{
> +	bootmem_data_t *bdata;
> +	void *ptr;
> +
> +	list_for_each_entry(bdata, &bdata_list, list)
> +		if ((ptr = __alloc_bootmem_core(bdata, size, align, goal, 
> +						LOW32LIMIT)))
> +			return(ptr);

This should be 'return ptr';

Cheers,
Muli
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Sun May 07 18:51:13 2006

This archive was generated by hypermail 2.1.8 : 2006-05-07 18:51:29 EST