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 298053 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]
Don't perform unnecessarily swiotlb copies
linux-2.6.18-xen-swiotlb-check-bounce-range.patch (text/plain), 3.12 KB, created by
Stephen Tweedie
on 2008-03-14 14:27:53 UTC
(
hide
)
Description:
Don't perform unnecessarily swiotlb copies
Filename:
MIME Type:
Creator:
Stephen Tweedie
Created:
2008-03-14 14:27:53 UTC
Size:
3.12 KB
patch
obsolete
>commit a571047896444f92cf6a489943e7f595b084e4ab >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 swiotlb_map_sg() code 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/swiotlb.c b/arch/i386/kernel/swiotlb.c >index ae9e3b7..68a6b33 100644 >--- a/arch/i386/kernel/swiotlb.c >+++ b/arch/i386/kernel/swiotlb.c >@@ -516,6 +516,25 @@ swiotlb_sync_single_for_device(struct device *hwdev, dma_addr_t dev_addr, > sync_single(hwdev, bus_to_virt(dev_addr), size, dir); > } > >+static int check_pages_physically_contiguous(struct page *page, >+ unsigned int offset, >+ unsigned int length) >+{ >+ unsigned long pfn, next_mfn; >+ int i; >+ int nr_pages; >+ >+ pfn = page_to_pfn(page); >+ 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; >+} >+ > /* > * Map a set of buffers described by scatterlist in streaming mode for DMA. > * This is the scatter-gather version of the above swiotlb_map_single >@@ -545,8 +564,10 @@ swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nelems, > > for (i = 0; i < nelems; i++, sg++) { > dev_addr = SG_ENT_PHYS_ADDRESS(sg); >- if (range_straddles_page_boundary(page_to_pseudophys(sg->page) >- + sg->offset, sg->length) >+ if ((range_straddles_page_boundary(page_to_pseudophys(sg->page) >+ + sg->offset, sg->length) && >+ !check_pages_physically_contiguous(sg->page, sg->offset, >+ sg->length)) > || address_needs_mapping(hwdev, dev_addr)) { > buffer.page = sg->page; > buffer.offset = sg->offset;
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