summaryrefslogtreecommitdiff
path: root/debian/patches/Add-some-padding-to-make-objects-fit-a-single-cache-.patch
blob: f2de6915fbc718d213db981b53c24a6020a8b44e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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