From: Jim Cromie <jim.cromie@gmail.com>
To: linux-kernel@vger.kernel.org, jbaron@akamai.com,
gregkh@linuxfoundation.org
Cc: Jim Cromie <jim.cromie@gmail.com>
Subject: [PATCH 2/2] vmlinux.lds.h: place optional header space in BOUNDED_SECTION
Date: Sat, 22 Oct 2022 16:56:37 -0600 [thread overview]
Message-ID: <20221022225637.1406715-3-jim.cromie@gmail.com> (raw)
In-Reply-To: <20221022225637.1406715-1-jim.cromie@gmail.com>
Extend recently added BOUNDED_SECTION(_name) macro by adding a
KEEP(*(.gnu.linkonce.##_name)) before the KEEP(*(_name)).
This does nothing by itself, vmlinux is the same before and after this
patch. But if a developer adds a .gnu.linkonce.foo record, that
record is placed in the front of the section, where it can be used as
a header for the table.
The intent is to create an up-link to another organizing struct, from
where related tables can be referenced. And since every item in a
table has a known offset from its header, that same offset can be used
to fetch records from the related tables.
By itself, this doesnt gain much, unless maybe the pattern of access
is to scan 1 or 2 fields in each fat record, but with 2 16 bit .map*
fields added, we could de-duplicate 2 related tables.
The use case here is struct _ddebug, which has 3 pointers (function,
file, module) with substantial repetition; respectively 53%, 90%, and
the module column is fully recoverable after dynamic_debug_init()
splits the table into a linked list of "module" chunks.
On a DYNAMIC_DEBUG=y kernel with 5k pr_debugs, the memory savings
should be ~100 KiB.
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
? does this need a new name ? HEADERED_SECTION ?
---
include/asm-generic/vmlinux.lds.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 9f6352171f88..b3ca56ac163f 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -195,11 +195,13 @@
#define BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _s_, _e_) \
_s_##_label_ = .; \
+ KEEP(*(.gnu.linkonce.##_sec_)) \
KEEP(*(_sec_)) \
_e_##_label_ = .;
#define BOUNDED_SECTION_POST_LABEL(_sec_, _label_, _s_, _e_) \
_label_##_s_ = .; \
+ KEEP(*(.gnu.linkonce.##_sec_)) \
KEEP(*(_sec_)) \
_label_##_e_ = .;
--
2.37.3
next prev parent reply other threads:[~2022-10-22 22:56 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-22 22:56 [PATCH 0/2] RESEND vmlinux.lds.h tweaks Jim Cromie
2022-10-22 22:56 ` [PATCH 1/2] vmlinux.lds.h: add BOUNDED_SECTION* macros Jim Cromie
2022-10-22 22:56 ` Jim Cromie [this message]
2022-11-10 18:09 ` [PATCH 0/2] RESEND vmlinux.lds.h tweaks Greg KH
2022-11-11 22:36 ` jim.cromie
2022-11-17 0:20 ` [driver-core-next] vmlinux.lds.h fix Jim Cromie
2022-11-17 0:20 ` [PATCH 1/2] vmlinux.lds.h: fix BOUNDED_SECTION_(PRE|POST)_LABEL macros Jim Cromie
2022-11-17 6:29 ` Greg KH
2022-11-17 16:43 ` jim.cromie
2022-11-17 17:16 ` [driver-core-next] vmlinux.lds.h fix (corrected) Jim Cromie
2022-11-17 17:16 ` [PATCH 1/2] vmlinux.lds.h: fix BOUNDED_SECTION_(PRE|POST)_LABEL macros Jim Cromie
2022-11-17 17:16 ` [PATCH 2/2] vmlinux.lds.h: add HEADERED_SECTION_* macros Jim Cromie
2022-11-17 18:38 ` [driver-core-next] vmlinux.lds.h fix (corrected) Greg KH
2022-11-17 0:20 ` [PATCH 2/2] vmlinux.lds.h: add HEADERED_SECTION_* macros Jim Cromie
2022-12-16 16:25 ` Alexander Lobakin
2022-12-16 18:11 ` Alexander Lobakin
-- strict thread matches above, loose matches on Subject: below --
2022-10-22 22:53 [PATCH 0/2] vmlinux.lds.h tweaks Jim Cromie
2022-10-22 22:53 ` [PATCH 2/2] vmlinux.lds.h: place optional header space in BOUNDED_SECTION Jim Cromie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221022225637.1406715-3-jim.cromie@gmail.com \
--to=jim.cromie@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jbaron@akamai.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®