From: Andi Kleen <andi@firstfloor.org>
To: linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org, Andi Kleen <ak@linux.intel.com>
Subject: [PATCH 3/8] list: Out of line INIT_LIST_HEAD and list_del
Date: Fri, 16 May 2014 14:43:10 -0700 [thread overview]
Message-ID: <1400276595-6965-4-git-send-email-andi@firstfloor.org> (raw)
In-Reply-To: <1400276595-6965-1-git-send-email-andi@firstfloor.org>
From: Andi Kleen <ak@linux.intel.com>
Out of lining these two inlines saves ~21k on my vmlinux
14152713 2003976 1507328 17664017 10d8811 vmlinux-before-list
14131431 2008136 1507328 17646895 10d452f vmlinux-list
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
include/linux/list.h | 15 ++++-----------
lib/Makefile | 2 +-
lib/list.c | 22 ++++++++++++++++++++++
3 files changed, 27 insertions(+), 12 deletions(-)
create mode 100644 lib/list.c
diff --git a/include/linux/list.h b/include/linux/list.h
index ef95941..8297885 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -21,11 +21,8 @@
#define LIST_HEAD(name) \
struct list_head name = LIST_HEAD_INIT(name)
-static inline void INIT_LIST_HEAD(struct list_head *list)
-{
- list->next = list;
- list->prev = list;
-}
+/* Out of line to save space */
+void INIT_LIST_HEAD(struct list_head *list);
/*
* Insert a new entry between two known consecutive entries.
@@ -101,12 +98,8 @@ static inline void __list_del_entry(struct list_head *entry)
__list_del(entry->prev, entry->next);
}
-static inline void list_del(struct list_head *entry)
-{
- __list_del(entry->prev, entry->next);
- entry->next = LIST_POISON1;
- entry->prev = LIST_POISON2;
-}
+/* Out of line to save space */
+void list_del(struct list_head *entry);
#else
extern void __list_del_entry(struct list_head *entry);
extern void list_del(struct list_head *entry);
diff --git a/lib/Makefile b/lib/Makefile
index 0cd7b68..8b744f7 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -13,7 +13,7 @@ lib-y := ctype.o string.o vsprintf.o cmdline.o \
sha1.o md5.o irq_regs.o reciprocal_div.o argv_split.o \
proportions.o flex_proportions.o prio_heap.o ratelimit.o show_mem.o \
is_single_threaded.o plist.o decompress.o kobject_uevent.o \
- earlycpio.o
+ earlycpio.o list.o
obj-$(CONFIG_ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS) += usercopy.o
lib-$(CONFIG_MMU) += ioremap.o
diff --git a/lib/list.c b/lib/list.c
new file mode 100644
index 0000000..298768f
--- /dev/null
+++ b/lib/list.c
@@ -0,0 +1,22 @@
+#include <linux/list.h>
+#include <linux/module.h>
+
+/*
+ * Out of line versions of common list.h functions that bloat the
+ * kernel too much.
+ */
+
+void INIT_LIST_HEAD(struct list_head *list)
+{
+ list->next = list;
+ list->prev = list;
+}
+EXPORT_SYMBOL(INIT_LIST_HEAD);
+
+void list_del(struct list_head *entry)
+{
+ __list_del(entry->prev, entry->next);
+ entry->next = LIST_POISON1;
+ entry->prev = LIST_POISON2;
+}
+EXPORT_SYMBOL(list_del);
--
1.9.0
next prev parent reply other threads:[~2014-05-16 21:45 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-16 21:43 Fix some common inline bloat Andi Kleen
2014-05-16 21:43 ` [PATCH 1/8] ixgbe: Out of line ixgbe_read/write_reg Andi Kleen
2014-05-19 9:14 ` David Laight
2014-05-19 22:00 ` Rustad, Mark D
2014-05-19 23:25 ` Andi Kleen
2014-05-20 17:06 ` Rustad, Mark D
2014-05-16 21:43 ` [PATCH 2/8] radeonfb: Out of line errata workarounds Andi Kleen
2014-05-16 21:43 ` Andi Kleen [this message]
2014-05-17 0:03 ` [PATCH 3/8] list: Out of line INIT_LIST_HEAD and list_del Dave Jones
2014-05-17 2:37 ` Andi Kleen
2014-05-17 0:03 ` Eric Dumazet
2014-05-16 21:43 ` [PATCH 4/8] e1000e: Out of line __ew32_prepare/__ew32 Andi Kleen
2014-05-17 3:23 ` Stephen Hemminger
2014-05-16 21:43 ` [PATCH 5/8] x86: Out of line get_dma_ops Andi Kleen
2014-05-16 21:43 ` [PATCH 6/8] ftrace: Out of line ftrace_trigger_soft_disabled Andi Kleen
2014-05-16 21:43 ` [PATCH 7/8] radeon: Out of line radeon_get_ib_value Andi Kleen
2014-05-20 16:16 ` Marek Olšák
2014-05-20 17:04 ` Andi Kleen
2014-05-20 18:14 ` Christian König
2014-05-16 21:43 ` [PATCH 8/8] Kbuild: add inline-account tool to find inline bloat Andi Kleen
2014-05-17 8:31 ` Sam Ravnborg
2014-05-17 9:36 ` Sam Ravnborg
2014-05-17 16:51 ` Andi Kleen
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=1400276595-6965-4-git-send-email-andi@firstfloor.org \
--to=andi@firstfloor.org \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--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
Powered by JetHome