summaryrefslogtreecommitdiffstats
path: root/0001-redhat-rh_kabi-deduplication-friendly-structs.patch
diff options
context:
space:
mode:
authorJeremy Cline <jcline@redhat.com>2020-04-23 16:47:21 -0400
committerJeremy Cline <jcline@redhat.com>2020-04-23 16:47:21 -0400
commitd1b6f8c7af0eb9a0a44b2d4723e58dde5eafa236 (patch)
tree842b7a6410c2572bc8c1643196f83d2e19d80e1e /0001-redhat-rh_kabi-deduplication-friendly-structs.patch
parent4f478aae8055f932b9a8fdd88d93db6b9da5709e (diff)
downloadkernel-d1b6f8c7af0eb9a0a44b2d4723e58dde5eafa236.tar.gz
kernel-d1b6f8c7af0eb9a0a44b2d4723e58dde5eafa236.tar.xz
kernel-d1b6f8c7af0eb9a0a44b2d4723e58dde5eafa236.zip
kernel-5.7.0-0.rc2.20200423git7adc4b399952.1
* Thu Apr 23 2020 CKI@GitLab <cki-project@redhat.com> [5.7.0-0.rc2.20200423git7adc4b399952.1] - 7adc4b399952 rebase - Match template format in kernel.spec.template ("Justin M. Forbes") - Break out the Patches into individual files for dist-git ("Justin M. Forbes") - Break the Red Hat patch into individual commits (Jeremy Cline) - Adjust module filtering so CONFIG_DRM_DP_CEC can be set (Jeremy Cline) - Add a script to generate release tags and branches (Jeremy Cline) - Set CONFIG_VDPA for fedora ("Justin M. Forbes") - Provide defaults in ark-rebase-patches.sh (Jeremy Cline) - Default ark-rebase-patches.sh to not report issues (Jeremy Cline) Resolves: rhbz# Signed-off-by: Jeremy Cline <jcline@redhat.com>
Diffstat (limited to '0001-redhat-rh_kabi-deduplication-friendly-structs.patch')
-rw-r--r--0001-redhat-rh_kabi-deduplication-friendly-structs.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/0001-redhat-rh_kabi-deduplication-friendly-structs.patch b/0001-redhat-rh_kabi-deduplication-friendly-structs.patch
new file mode 100644
index 000000000..1e1edd71e
--- /dev/null
+++ b/0001-redhat-rh_kabi-deduplication-friendly-structs.patch
@@ -0,0 +1,65 @@
+From 712d5caafb841524ec3a5e9499e5ab9f4818d9ca 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.0
+