]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/suse-2.6.27.25/patches.xen/xen-swiotlb-heuristics
Updated xen patches taken from suse.
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.xen / xen-swiotlb-heuristics
1 From: jbeulich@novell.com
2 Subject: adjust Xen's swiotlb default size setting
3 Patch-mainline: obsolete
4
5 --- sle11-2009-02-05.orig/lib/swiotlb-xen.c 2009-02-05 11:18:17.000000000 +0100
6 +++ sle11-2009-02-05/lib/swiotlb-xen.c 2009-02-05 11:18:23.000000000 +0100
7 @@ -224,8 +224,8 @@ swiotlb_init_with_default_size(size_t de
8 void __init
9 swiotlb_init(void)
10 {
11 - long ram_end;
12 - size_t defsz = 64 * (1 << 20); /* 64MB default size */
13 + unsigned long ram_end;
14 + size_t defsz = 64 << 20; /* 64MB default size */
15
16 if (swiotlb_force == 1) {
17 swiotlb = 1;
18 @@ -234,8 +234,12 @@ swiotlb_init(void)
19 is_initial_xendomain()) {
20 /* Domain 0 always has a swiotlb. */
21 ram_end = HYPERVISOR_memory_op(XENMEM_maximum_ram_page, NULL);
22 - if (ram_end <= 0x7ffff)
23 - defsz = 2 * (1 << 20); /* 2MB on <2GB on systems. */
24 + if (ram_end <= 0x1ffff)
25 + defsz = 2 << 20; /* 2MB on <512MB systems. */
26 + else if (ram_end <= 0x3ffff)
27 + defsz = 4 << 20; /* 4MB on <1GB systems. */
28 + else if (ram_end <= 0x7ffff)
29 + defsz = 8 << 20; /* 8MB on <2GB systems. */
30 swiotlb = 1;
31 }
32