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

From: Jon Mason
Date: Mon May 08 2006 - 00:54:52 EST


On Sun, May 07, 2006 at 11:50:36AM +0300, Muli Ben-Yehuda wrote:
> 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@xxxxxxxxxx>
>
> Acked-by: Muli Ben-Yehuda <muli@xxxxxxxxxx>
>
> > 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';

I completely agree with both nits, but the changes follow the style
currently in the files. I'll do a clean-up patch to both of the
files in question. :)

Thanks,
Jon

>
> Cheers,
> Muli
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/