kernel/0001-redhat-rh_kabi-deduplication-friendly-structs.patch
Justin M. Forbes 67f313c852 kernel-5.7.0-0.rc3.20200429git1d2cc5ac6f66.1
* Wed Apr 29 2020 CKI@GitLab <cki-project@redhat.com> [5.7.0-0.rc3.20200429git1d2cc5ac6f66.1]
- 1d2cc5ac6f66 rebase
- Add cec to the filter overrides ("Justin M. Forbes")
- Add overrides to filter-modules.sh ("Justin M. Forbes")
- Copy Makefile.rhelver as a source file rather than a patch (Jeremy Cline)
- Move the sed to clear the patch templating outside of conditionals ("Justin M. Forbes")
- Only include open merge requests with "Include in Releases" label (Jeremy Cline)
- Exit non-zero if the tag already exists for a release (Jeremy Cline)
- Adjust the changelog update script to not push anything (Jeremy Cline)
- Drop --target noarch from the rh-rpms make target (Jeremy Cline)
Resolves: rhbz#

Signed-off-by: Justin M. Forbes <jforbes@fedoraproject.org>
2020-04-29 16:12:02 -05:00

66 lines
2.1 KiB
Diff

From 91c23fffe0d253ad886fc37ea48699da4d8a8b57 Mon Sep 17 00:00:00 2001
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
+#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)); \
})
--
2.26.2