2020-05-08 14:52:40 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2020-04-23 20:47:21 +00:00
|
|
|
From: Jiri Benc <jbenc@redhat.com>
|
|
|
|
Date: Wed, 19 Feb 2020 11:52:21 +0100
|
|
|
|
Subject: [PATCH] redhat: rh_kabi: deduplication friendly structs
|
|
|
|
MIME-Version: 1.0
|
|
|
|
Content-Type: text/plain; charset=UTF-8
|
|
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
|
|
|
|
RH-Acked-by: Bruno Meneguele <bmeneg@redhat.com>
|
|
|
|
RH-Acked-by: Jesper Brouer <brouer@redhat.com>
|
|
|
|
RH-Acked-by: Prarit Bhargava <prarit@redhat.com>
|
|
|
|
RH-Acked-by: Jiri Olsa <jolsa@redhat.com>
|
|
|
|
RH-Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
|
|
|
|
|
|
|
|
Upstream status: RHEL only
|
|
|
|
|
|
|
|
We don't really need the field names to be globally unique, it is enough
|
|
|
|
when they are unique in the given struct. Since structs do not generally
|
|
|
|
span mutliple files, using the line number is enough to ensure an unique
|
|
|
|
identifier. It means that we can't use two RH_KABI_RENAME macros on the same
|
|
|
|
line but that's not happening anyway.
|
|
|
|
|
|
|
|
This allows pahole to deduplicate the type info of structs using kABI
|
|
|
|
macros, lowering the size of vmlinuz from 26M to 8.5M.
|
|
|
|
|
|
|
|
Upstream Status: RHEL only
|
|
|
|
Signed-off-by: Jiri Benc <jbenc@redhat.com>
|
|
|
|
---
|
|
|
|
include/linux/rh_kabi.h | 6 ++++--
|
|
|
|
1 file changed, 4 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/include/linux/rh_kabi.h b/include/linux/rh_kabi.h
|
|
|
|
index b90601e8a657..ea9c136bf884 100644
|
|
|
|
--- a/include/linux/rh_kabi.h
|
|
|
|
+++ b/include/linux/rh_kabi.h
|
|
|
|
@@ -163,6 +163,8 @@
|
|
|
|
# define __RH_KABI_CHECK_SIZE(_item, _size)
|
|
|
|
#endif
|
2020-06-30 14:24:22 +00:00
|
|
|
|
2020-04-23 20:47:21 +00:00
|
|
|
+#define RH_KABI_UNIQUE_ID __PASTE(rh_kabi_hidden_, __LINE__)
|
|
|
|
+
|
|
|
|
# define _RH_KABI_DEPRECATE(_type, _orig) _type rh_reserved_##_orig
|
|
|
|
# define _RH_KABI_DEPRECATE_FN(_type, _orig, _args...) \
|
|
|
|
_type (* rh_reserved_##_orig)(_args)
|
|
|
|
@@ -171,7 +173,7 @@
|
|
|
|
_new; \
|
|
|
|
struct { \
|
|
|
|
_orig; \
|
|
|
|
- } __UNIQUE_ID(rh_kabi_hide); \
|
|
|
|
+ } RH_KABI_UNIQUE_ID; \
|
|
|
|
__RH_KABI_CHECK_SIZE_ALIGN(_orig, _new); \
|
|
|
|
}
|
|
|
|
# define _RH_KABI_REPLACE_UNSAFE(_orig, _new) _new
|
|
|
|
@@ -218,7 +220,7 @@
|
|
|
|
#define RH_KABI_EXTEND_WITH_SIZE(_new, _size) \
|
|
|
|
RH_KABI_EXTEND(union { \
|
|
|
|
_new; \
|
|
|
|
- unsigned long __UNIQUE_ID(rh_kabi_reserved)[_size]; \
|
|
|
|
+ unsigned long RH_KABI_UNIQUE_ID[_size]; \
|
|
|
|
__RH_KABI_CHECK_SIZE(_new, 8 * (_size)); \
|
|
|
|
})
|
2020-06-30 14:24:22 +00:00
|
|
|
|
2020-04-23 20:47:21 +00:00
|
|
|
--
|
2020-06-30 14:24:22 +00:00
|
|
|
2.26.2
|
2020-04-23 20:47:21 +00:00
|
|
|
|