summaryrefslogtreecommitdiff
path: root/debian/patches
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-04-30 16:52:38 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-04-30 16:52:38 +0200
commit3ccbc8d0edcea8224bde6e7c84bd70db5f47005e (patch)
treee02b75c1752d718bfaa5e4e55eae4e69524749c0 /debian/patches
parent365e44bb46b55b11946852b4ce30a94de5572a40 (diff)
some mem layout tuning
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/0001-vm-make-struct-vm_map-fit-into-a-cache-line.patch36
-rw-r--r--debian/patches/0002-Add-some-padding-to-make-objects-fit-a-single-cache-.patch58
-rw-r--r--debian/patches/series2
3 files changed, 96 insertions, 0 deletions
diff --git a/debian/patches/0001-vm-make-struct-vm_map-fit-into-a-cache-line.patch b/debian/patches/0001-vm-make-struct-vm_map-fit-into-a-cache-line.patch
new file mode 100644
index 0000000..41a3ca4
--- /dev/null
+++ b/debian/patches/0001-vm-make-struct-vm_map-fit-into-a-cache-line.patch
@@ -0,0 +1,36 @@
+From 02f3fe277a80a4f32ffae04b061808a8bdf5bd59 Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Wed, 30 Apr 2014 15:23:36 +0200
+Subject: [PATCH 1/2] vm: make struct vm_map fit into a cache line
+
+Currently, the size of struct vm_map is 68 bytes. By using a bit
+field for the boolean flags, it can be made fit into a cache line.
+
+* vm/vm_map.h (struct vm_map): Use a bit field for the boolean flags
+wait_for_space and wiring_required.
+---
+ vm/vm_map.h | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/vm/vm_map.h b/vm/vm_map.h
+index b6bc177..b8103eb 100644
+--- a/vm/vm_map.h
++++ b/vm/vm_map.h
+@@ -175,9 +175,12 @@ struct vm_map {
+ vm_map_entry_t hint; /* hint for quick lookups */
+ decl_simple_lock_data(, hint_lock) /* lock for hint storage */
+ vm_map_entry_t first_free; /* First free space hint */
+- boolean_t wait_for_space; /* Should callers wait
++
++ /* Flags */
++ unsigned int wait_for_space:1, /* Should callers wait
+ for space? */
+- boolean_t wiring_required;/* All memory wired? */
++ /* boolean_t */ wiring_required:1; /* All memory wired? */
++
+ unsigned int timestamp; /* Version number */
+ };
+
+--
+1.9.2
+
diff --git a/debian/patches/0002-Add-some-padding-to-make-objects-fit-a-single-cache-.patch b/debian/patches/0002-Add-some-padding-to-make-objects-fit-a-single-cache-.patch
new file mode 100644
index 0000000..f2de691
--- /dev/null
+++ b/debian/patches/0002-Add-some-padding-to-make-objects-fit-a-single-cache-.patch
@@ -0,0 +1,58 @@
+From 065a76b5dfc8e495b6ed170df57a1ce86894ead0 Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Wed, 30 Apr 2014 16:15:34 +0200
+Subject: [PATCH 2/2] Add some padding to make objects fit a single cache line
+
+Add four bytes of padding to struct ipc_space, struct vm_fault_state,
+and struct vm_map_entry.
+
+XXX vm_map_entry one is kinda expensive
+
+* ipc/ipc_space.h (struct ipc_space): Add four bytes of padding.
+* vm/vm_fault.c (struct vm_fault_state): Likewise.
+* vm/vm_map.h (struct vm_map_entry): Likewise.
+---
+ ipc/ipc_space.h | 1 +
+ vm/vm_fault.c | 1 +
+ vm/vm_map.h | 1 +
+ 3 files changed, 3 insertions(+)
+
+diff --git a/ipc/ipc_space.h b/ipc/ipc_space.h
+index c4683d2..278b4c9 100644
+--- a/ipc/ipc_space.h
++++ b/ipc/ipc_space.h
+@@ -79,6 +79,7 @@ struct ipc_space {
+ ipc_entry_num_t is_tree_total; /* number of entries in the tree */
+ ipc_entry_num_t is_tree_small; /* # of small entries in the tree */
+ ipc_entry_num_t is_tree_hash; /* # of hashed entries in the tree */
++ char padding[4]; /* pad to cacheline size */
+ };
+
+ #define IS_NULL ((ipc_space_t) 0)
+diff --git a/vm/vm_fault.c b/vm/vm_fault.c
+index 686156c..431480e 100644
+--- a/vm/vm_fault.c
++++ b/vm/vm_fault.c
+@@ -82,6 +82,7 @@ typedef struct vm_fault_state {
+ vm_offset_t vmfp_offset;
+ struct vm_page *vmfp_first_m;
+ vm_prot_t vmfp_access;
++ char padding[4]; /* pad to cacheline size */
+ } vm_fault_state_t;
+
+ struct kmem_cache vm_fault_state_cache;
+diff --git a/vm/vm_map.h b/vm/vm_map.h
+index b8103eb..ac5f109 100644
+--- a/vm/vm_map.h
++++ b/vm/vm_map.h
+@@ -126,6 +126,7 @@ struct vm_map_entry {
+ -1 for non-persistent kernel map projected buffer entry;
+ pointer to corresponding kernel map entry for user map
+ projected buffer entry */
++ char padding[4]; /* pad to cacheline size */
+ };
+
+ typedef struct vm_map_entry *vm_map_entry_t;
+--
+1.9.2
+
diff --git a/debian/patches/series b/debian/patches/series
index 9825c75..e5010ab 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,5 @@
70_dde.patch
protected_payload.patch
+0001-vm-make-struct-vm_map-fit-into-a-cache-line.patch
+0002-Add-some-padding-to-make-objects-fit-a-single-cache-.patch