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] [xen-unstable] minios: Optimize mmap(open("/dev/mem"))

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] minios: Optimize mmap(open("/dev/mem"))
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 23 Oct 2009 02:40:09 -0700
Delivery-date: Fri, 23 Oct 2009 02:40:20 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1256288385 -3600
# Node ID 4a65bd76e09b152053202b2e58b536264935e6ef
# Parent  37829fd7c1e3faf19f77058ab604fd79dee194d0
minios: Optimize mmap(open("/dev/mem"))

Set map_frames_ex's stride parameter to 0 and increment to 1 to avoid
building an explicit list of mfns.

Signed-Off-By: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
---
 extras/mini-os/lib/sys.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff -r 37829fd7c1e3 -r 4a65bd76e09b extras/mini-os/lib/sys.c
--- a/extras/mini-os/lib/sys.c  Wed Oct 21 16:08:28 2009 +0100
+++ b/extras/mini-os/lib/sys.c  Fri Oct 23 09:59:45 2009 +0100
@@ -1256,11 +1256,8 @@ void *mmap(void *start, size_t length, i
         unsigned long zero = 0;
         return map_frames_ex(&zero, n, 0, 0, 1, DOMID_SELF, 0, 0);
     } else if (files[fd].type == FTYPE_MEM) {
-        int i;
-        unsigned long mfns[n];
-        for (i = 0; i < n; i++)
-            mfns[i] = ((unsigned long) offset + (i * PAGE_SIZE)) >> PAGE_SHIFT;
-        return map_frames_ex(mfns, n, 1, 0, 1, DOMID_IO, 0, 
_PAGE_PRESENT|_PAGE_RW);
+        unsigned long first_mfn = offset >> PAGE_SHIFT;
+        return map_frames_ex(&first_mfn, n, 0, 1, 1, DOMID_IO, 0, 
_PAGE_PRESENT|_PAGE_RW);
     } else ASSERT(0);
 }
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] minios: Optimize mmap(open("/dev/mem")), Xen patchbot-unstable <=