ia64/xen-unstable

view stubdom/caml/main-caml.c @ 18732:4413d53a8320

x86: highmem handling assistance hypercalls

While looking at the origin of very frequently executed hypercalls I
realized that the high page accessor functions in Linux would be good
candidates to handle in the hypervisor - clearing or copying to/from
a high page is a pretty frequent operation (provided there's enough
memory in the domain). While prior to the first submission I only
measured kernel builds (where the results are not hinting at a
meaningful improvement), I now found time to do a more specific
analysis: page clearing is being improved by about 20%, page copying
doesn't seem to significantly benefit (though that may be an effect of
the simplistic copy_page() implementation Xen currently uses) -
nevertheless I would think that if one function is supported by the
hypervisor, then the other should also be.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Oct 27 13:29:35 2008 +0000 (2008-10-27)
parents 460f72ca97b6
children
line source
1 /*
2 * Caml bootstrap
3 *
4 * Samuel Thibault <Samuel.Thibault@eu.citrix.net>, January 2008
5 */
7 #include <stdio.h>
8 #include <errno.h>
10 #include <caml/mlvalues.h>
11 #include <caml/callback.h>
12 #include <unistd.h>
14 /* Ugly binary compatibility with Linux */
15 FILE *_stderr asm("stderr");
16 int *__errno_location;
17 /* Will probably break everything, probably need to fetch from glibc */
18 void *__ctype_b_loc;
20 int main(int argc, char *argv[], char *envp[])
21 {
22 value *val;
24 /* Get current thread's value */
25 _stderr = stderr;
26 __errno_location = &errno;
28 printf("starting caml\n");
30 /* Wait before things might hang up */
31 sleep(1);
33 caml_startup(argv);
34 val = caml_named_value("main");
35 if (!val) {
36 printf("Couldn't find Caml main");
37 return 1;
38 }
39 caml_callback(*val, Val_int(0));
40 printf("callback returned\n");
41 return 0;
42 }