Skip to content

Commit

Permalink
module: remove 64 bit alignment padding from struct module with CONFI…
Browse files Browse the repository at this point in the history
…G_TRACE*

Reorder struct module to remove 24 bytes of alignment padding on 64 bit
builds when the CONFIG_TRACE options are selected. This allows the
structure to fit into one fewer cache lines, and its size drops from 592
to 568 on x86_64.

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
Richard Kennedy authored and Rusty Russell committed May 19, 2011
1 parent 9b73a58 commit a288bd6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions include/linux/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,34 +368,35 @@ struct module
struct module_notes_attrs *notes_attrs;
#endif

/* The command line arguments (may be mangled). People like
keeping pointers to this stuff */
char *args;

#ifdef CONFIG_SMP
/* Per-cpu data. */
void __percpu *percpu;
unsigned int percpu_size;
#endif

/* The command line arguments (may be mangled). People like
keeping pointers to this stuff */
char *args;
#ifdef CONFIG_TRACEPOINTS
struct tracepoint * const *tracepoints_ptrs;
unsigned int num_tracepoints;
struct tracepoint * const *tracepoints_ptrs;
#endif
#ifdef HAVE_JUMP_LABEL
struct jump_entry *jump_entries;
unsigned int num_jump_entries;
#endif
#ifdef CONFIG_TRACING
const char **trace_bprintk_fmt_start;
unsigned int num_trace_bprintk_fmt;
const char **trace_bprintk_fmt_start;
#endif
#ifdef CONFIG_EVENT_TRACING
struct ftrace_event_call **trace_events;
unsigned int num_trace_events;
#endif
#ifdef CONFIG_FTRACE_MCOUNT_RECORD
unsigned long *ftrace_callsites;
unsigned int num_ftrace_callsites;
unsigned long *ftrace_callsites;
#endif

#ifdef CONFIG_MODULE_UNLOAD
Expand Down

0 comments on commit a288bd6

Please sign in to comment.