Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 299461 Details for
Bug 433554
[RHEL5 U2] Kernel-xen PCI-DMA: Out of SW-IOMMU space for 57344 bytes at device 0000:03:04.0
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Detect physically-contiguous pages when determining if memory spans a page boundary
linux-2.6-xen-fix-swiommu-page-spans.patch (text/plain), 3.61 KB, created by
Stephen Tweedie
on 2008-03-28 13:10:55 UTC
(
hide
)
Description:
Detect physically-contiguous pages when determining if memory spans a page boundary
Filename:
MIME Type:
Creator:
Stephen Tweedie
Created:
2008-03-28 13:10:55 UTC
Size:
3.61 KB
patch
obsolete
>commit 952c63d05820a0ac730a8e0a6d902df5cafd6aff >Author: Stephen Tweedie <sct@redhat.com> >Date: Thu Mar 13 17:49:28 2008 +0000 > > xen dma: avoid unnecessarily SWIOTLB bounce buffering. > > On Xen kernels, BIOVEC_PHYS_MERGEABLE permits merging of disk IOs that > span multiple pages, provided that the pages are both pseudophysically- > AND machine-contiguous --- > > (((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2))) && \ > ((bvec_to_pseudophys((vec1)) + (vec1)->bv_len) == \ > bvec_to_pseudophys((vec2)))) > > However, this best-effort merging of adjacent pages can occur in > regions of dom0 memory which just happen, by virtue of having been > initially set up that way, to be machine-contiguous. Such pages > which occur outside of a range created by xen_create_contiguous_ > region won't be seen as contiguous by range_straddles_page_boundary(), > so the pci-dma-xen.c code for dma_map_sg() will send these regions > to the swiotlb for bounce buffering. > > In RHEL-5.1 this did not happen, because we did not have the check > for range_straddles_page_boundary() in that code. Now that that check > has been added, these SG ranges --- which ARE machine contiguous and > which can perfectly well be sent to a dma engine --- are being bounce- > buffered in the swiotlb instead, causing a performance overhead and > potentially leading to early swiotlb exhaustion. > > This patch adds a new check, check_pages_physically_contiguous(), > to the test for pages stradding page boundaries both in > swiotlb_map_sg() and dma_map_sg(), to capture these ranges and map > them directly via virt_to_bus() mapping rather than through the > swiotlb. > > Signed-off-by: Stephen Tweedie <sct@redhat.com> > >diff --git a/arch/i386/kernel/pci-dma-xen.c b/arch/i386/kernel/pci-dma-xen.c >index cdeda5a..14f3539 100644 >--- a/arch/i386/kernel/pci-dma-xen.c >+++ b/arch/i386/kernel/pci-dma-xen.c >@@ -110,6 +110,39 @@ do { \ > } \ > } while (0) > >+static int check_pages_physically_contiguous(unsigned long pfn, >+ unsigned int offset, >+ size_t length) >+{ >+ unsigned long next_mfn; >+ int i; >+ int nr_pages; >+ >+ next_mfn = pfn_to_mfn(pfn); >+ nr_pages = (offset + length + PAGE_SIZE-1) >> PAGE_SHIFT; >+ >+ for (i = 1; i < nr_pages; i++) { >+ if (pfn_to_mfn(++pfn) != ++next_mfn) >+ return 0; >+ } >+ return 1; >+} >+ >+int range_straddles_page_boundary(paddr_t p, size_t size) >+{ >+ extern unsigned long *contiguous_bitmap; >+ unsigned long pfn = p >> PAGE_SHIFT; >+ unsigned int offset = p & ~PAGE_MASK; >+ >+ if (offset + size <= PAGE_SIZE) >+ return 0; >+ if (test_bit(pfn, contiguous_bitmap)) >+ return 0; >+ if (check_pages_physically_contiguous(pfn, offset, size)) >+ return 0; >+ return 1; >+} >+ > int > dma_map_sg(struct device *hwdev, struct scatterlist *sg, int nents, > enum dma_data_direction direction) >diff --git a/include/asm-i386/mach-xen/asm/dma-mapping.h b/include/asm-i386/mach-xen/asm/dma-mapping.h >index 18b1a0d..fc917f2 100644 >--- a/include/asm-i386/mach-xen/asm/dma-mapping.h >+++ b/include/asm-i386/mach-xen/asm/dma-mapping.h >@@ -22,13 +22,7 @@ address_needs_mapping(struct device *hwdev, dma_addr_t addr) > return (addr & ~mask) != 0; > } > >-static inline int >-range_straddles_page_boundary(paddr_t p, size_t size) >-{ >- extern unsigned long *contiguous_bitmap; >- return ((((p & ~PAGE_MASK) + size) > PAGE_SIZE) && >- !test_bit(p >> PAGE_SHIFT, contiguous_bitmap)); >-} >+extern int range_straddles_page_boundary(paddr_t p, size_t size); > > #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) > #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 433554
:
295354
|
295355
|
295526
|
298053
| 299461