WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [linux-2.6.18-xen] [IA64] avoid unnecessarily SWIOTLB bo

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] [IA64] avoid unnecessarily SWIOTLB bounce buffering
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 20 May 2008 08:30:44 -0700
Delivery-date: Tue, 20 May 2008 08:32:17 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1207152177 21600
# Node ID ec6e3e18ea314e9520ee6bba898e30228bf3bda4
# Parent  ad7ad9af265e3276d084f8074192bec9d3867747
[IA64] avoid unnecessarily SWIOTLB bounce buffering

x86 improved range_straddles_page_boundary() by the c/s 501:5486a234923d.
The same discussion applies to ia64. This patch is ia64 counter part of it.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 arch/ia64/xen/xen_dma.c  |   35 +++++++++++++++++++++++++++++++++++
 include/asm-ia64/maddr.h |   12 +-----------
 2 files changed, 36 insertions(+), 11 deletions(-)

diff -r ad7ad9af265e -r ec6e3e18ea31 arch/ia64/xen/xen_dma.c
--- a/arch/ia64/xen/xen_dma.c   Tue Apr 01 11:29:31 2008 -0600
+++ b/arch/ia64/xen/xen_dma.c   Wed Apr 02 10:02:57 2008 -0600
@@ -37,6 +37,41 @@ do {                                                         
\
        }                                                       \
 } while (0)
 
+static int check_pages_physically_contiguous(unsigned long pfn, 
+                                            unsigned int offset,
+                                            size_t length)
+{
+       unsigned long next_bus;
+       int i;
+       int nr_pages;
+
+       next_bus = pfn_to_mfn_for_dma(pfn);
+       nr_pages = (offset + length + PAGE_SIZE-1) >> PAGE_SHIFT;
+
+       for (i = 1; i < nr_pages; i++) {
+               if (pfn_to_mfn_for_dma(++pfn) != ++next_bus) 
+                       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 (!is_running_on_xen())
+               return 0;
+
+       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;
+}
 
 /*
  * This should be broken out of swiotlb and put in a common place
diff -r ad7ad9af265e -r ec6e3e18ea31 include/asm-ia64/maddr.h
--- a/include/asm-ia64/maddr.h  Tue Apr 01 11:29:31 2008 -0600
+++ b/include/asm-ia64/maddr.h  Wed Apr 02 10:02:57 2008 -0600
@@ -108,17 +108,7 @@ typedef unsigned long paddr_t;
 #endif
 
 #ifdef CONFIG_XEN
-static inline int
-range_straddles_page_boundary(paddr_t p, size_t size)
-{
-       extern unsigned long *contiguous_bitmap;
-
-       if (!is_running_on_xen())
-               return 0;
-
-       return ((((p & ~PAGE_MASK) + size) > PAGE_SIZE) &&
-               !test_bit(p >> PAGE_SHIFT, contiguous_bitmap));
-}
+int range_straddles_page_boundary(paddr_t p, size_t size);
 #else
 #define range_straddles_page_boundary(addr, size)      (0)
 #endif

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] [IA64] avoid unnecessarily SWIOTLB bounce buffering, Xen patchbot-linux-2.6.18-xen <=