Skip to content

Commit c554aa9

Browse files
tititiou36Peter Zijlstra
authored andcommitted
uprobes: Re-order struct uprobe_task to save some space
On x86_64, with allmodconfig, struct uprobe_task is 72 bytes long, with a hole and some padding. /* size: 72, cachelines: 2, members: 7 */ /* sum members: 64, holes: 1, sum holes: 4 */ /* padding: 4 */ /* forced alignments: 1, forced holes: 1, sum forced holes: 4 */ /* last cacheline: 8 bytes */ Reorder the structure to fill the hole and avoid the padding. This way, the whole structure fits in a single cacheline and some memory is saved when it is allocated. /* size: 64, cachelines: 1, members: 7 */ /* forced alignments: 1 */ Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: "Masami Hiramatsu (Google)" <[email protected]> Link: https://lore.kernel.org/r/a9f541d0cedf421f765c77a1fb93d6a979778a88.1730495562.git.christophe.jaillet@wanadoo.fr
1 parent 2e71e8b commit c554aa9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/linux/uprobes.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ struct hprobe {
121121
struct uprobe_task {
122122
enum uprobe_task_state state;
123123

124+
unsigned int depth;
125+
struct return_instance *return_instances;
126+
124127
union {
125128
struct {
126129
struct arch_uprobe_task autask;
@@ -138,9 +141,6 @@ struct uprobe_task {
138141
unsigned long xol_vaddr;
139142

140143
struct arch_uprobe *auprobe;
141-
142-
struct return_instance *return_instances;
143-
unsigned int depth;
144144
};
145145

146146
struct return_consumer {

0 commit comments

Comments
 (0)