|
Re: x86_64: 2.6.14-rc4 swiotlb broken: msg#00098linux.ports.x86-64.general
On Mon, Oct 17, 2005 at 02:11:20PM -0700, Linus Torvalds wrote: > > > On Mon, 17 Oct 2005, Andrew Morton wrote: > > > > There seem to be a lot of proposed solutions floating about and I fear that > > different people will try to fix this in different ways. Do we all agree > > that this patch is the correct solution to this problem, or is something > > more needed? > > I think this will fix it. > I just tried Yasunori-sans patch on our x460. It doesn't fix the problem. Attaching the dmesg capture. However, the patch to iterate over nodes and allocate bootmem works, and should work for ia64s, boxes with insufficient memory on node 0, nodes with just cpus etc. I have requested Alex to try this on the superdome (although the the use of swiotlb on superdomes seem to be optional). If this works on superdomes, then please apply. This has been tested on x460. Thanks, Kiran Signed-off-by: Ravikiran Thirumalai <kiran@xxxxxxxxxxxx> Index: linux-2.6.14-rc4/arch/ia64/lib/swiotlb.c =================================================================== --- linux-2.6.14-rc4.orig/arch/ia64/lib/swiotlb.c 2005-10-17 13:27:35.000000000 -0700 +++ linux-2.6.14-rc4/arch/ia64/lib/swiotlb.c 2005-10-17 16:00:44.000000000 -0700 @@ -106,6 +106,8 @@ __setup("swiotlb=", setup_io_tlb_npages); /* make io_tlb_overflow tunable too? */ +#define IS_LOWPAGES(paddr, size) ((paddr < 0xffffffff) && ((paddr+size) < 0xffffffff)) + /* * Statically reserve bounce buffer space and initialize bounce buffer data * structures for the software IO TLB used to implement the PCI DMA API. @@ -114,17 +116,32 @@ swiotlb_init_with_default_size (size_t default_size) { unsigned long i; + unsigned long iotlbsz; + int node; if (!io_tlb_nslabs) { io_tlb_nslabs = (default_size >> IO_TLB_SHIFT); io_tlb_nslabs = ALIGN(io_tlb_nslabs, IO_TLB_SEGSIZE); } + iotlbsz = io_tlb_nslabs * (1 << IO_TLB_SHIFT); + /* - * Get IO TLB memory from the low pages + * Get IO TLB memory from the 0-4G range */ - io_tlb_start = alloc_bootmem_low_pages(io_tlb_nslabs * - (1 << IO_TLB_SHIFT)); + + for_each_node(node) { + io_tlb_start = alloc_bootmem_node(NODE_DATA(node), iotlbsz); + if (io_tlb_start) { + if (IS_LOWPAGES(virt_to_phys(io_tlb_start), iotlbsz)) + break; + free_bootmem_node(NODE_DATA(node), + virt_to_phys(io_tlb_start), iotlbsz); + io_tlb_start = NULL; + } + } + + if (!io_tlb_start) panic("Cannot allocate SWIOTLB buffer"); io_tlb_end = io_tlb_start + io_tlb_nslabs * (1 << IO_TLB_SHIFT);
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: [discuss] Re: x86_64: 2.6.14-rc4 swiotlb broken: 00098, David Lang |
|---|---|
| Next by Date: | Re: [discuss] Re: x86_64: 2.6.14-rc4 swiotlb broken: 00098, Yasunori Goto |
| Previous by Thread: | Re: x86_64: 2.6.14-rc4 swiotlb brokeni: 00098, Linus Torvalds |
| Next by Thread: | Re: x86_64: 2.6.14-rc4 swiotlb broken: 00098, Andi Kleen |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |