mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
Linux kernel source tree
Based on pahole, 2 holes can be combined in the 'struct lock_class'. This
saves 8 bytes in the structure on my x86_64.
On a x86_64 configured with allmodconfig, this saves ~64kb of memory in
'kernel/locking/lockdep.o':
text data bss dec filename
Before: 102,501 1,912,490 11,531,636 13,546,627 kernel/locking/lockdep.o
After: 102,181 1,912,490 11,466,100 13,480,771 kernel/locking/lockdep.o
because of:
struct lock_class lock_classes[MAX_LOCKDEP_KEYS];
After the reorder, pahole gives:
struct lock_class {
struct hlist_node hash_entry; /* 0 16 */
struct list_head lock_entry; /* 16 16 */
struct list_head locks_after; /* 32 16 */
struct list_head locks_before; /* 48 16 */
/* --- cacheline 1 boundary (64 bytes) --- */
const struct lockdep_subclass_key * key; /* 64 8 */
lock_cmp_fn cmp_fn; /* 72 8 */
lock_print_fn print_fn; /* 80 8 */
unsigned int subclass; /* 88 4 */
unsigned int dep_gen_id; /* 92 4 */
long unsigned int usage_mask; /* 96 8 */
const struct lock_trace * usage_traces[10]; /* 104 80 */
/* --- cacheline 2 boundary (128 bytes) was 56 bytes ago --- */
const char * name; /* 184 8 */
/* --- cacheline 3 boundary (192 bytes) --- */
int name_version; /* 192 4 */
u8 wait_type_inner; /* 196 1 */
u8 wait_type_outer; /* 197 1 */
u8 lock_type; /* 198 1 */
/* XXX 1 byte hole, try to pack */
long unsigned int contention_point[4]; /* 200 32 */
long unsigned int contending_point[4]; /* 232 32 */
/* size: 264, cachelines: 5, members: 18 */
/* sum members: 263, holes: 1, sum holes: 1 */
/* last cacheline: 8 bytes */
};
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Waiman Long <longman@redhat.com>
Link: https://lore.kernel.org/r/801258371fc4101f96495a5aaecef638d6cbd8d3.1700988869.git.christophe.jaillet@wanadoo.fr
|
||
|---|---|---|
| arch | ||
| block | ||
| certs | ||
| crypto | ||
| Documentation | ||
| drivers | ||
| fs | ||
| include | ||
| init | ||
| io_uring | ||
| ipc | ||
| kernel | ||
| lib | ||
| LICENSES | ||
| mm | ||
| net | ||
| rust | ||
| samples | ||
| scripts | ||
| security | ||
| sound | ||
| tools | ||
| usr | ||
| virt | ||
| .clang-format | ||
| .cocciconfig | ||
| .get_maintainer.ignore | ||
| .gitattributes | ||
| .gitignore | ||
| .mailmap | ||
| .rustfmt.toml | ||
| COPYING | ||
| CREDITS | ||
| Kbuild | ||
| Kconfig | ||
| MAINTAINERS | ||
| Makefile | ||
| README | ||
Linux kernel
============
There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.
In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``. The formatted documentation can also be read online at:
https://www.kernel.org/doc/html/latest/
There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.