From: Jan Kiszka <jan.kiszka@domain.hid>
To: adeos-main@gna.org
Subject: [Adeos-main] [PATCH] remove ipipe_root_domain indirection
Date: Sun, 24 Sep 2006 20:07:19 +0200 [thread overview]
Message-ID: <4516C957.60605@domain.hid> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 237 bytes --]
This simple patch removes an unneeded indirection by mapping
ipipe_root_domain to &ipipe_root. Saves more than 7k kernel size with my
setup here when CONFIG_PREEMPT is enabled, and I bet it requires a few
cycles less as well.
Jan
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: remove-ipipe_root_domain.patch --]
[-- Type: text/x-patch; name="remove-ipipe_root_domain.patch", Size: 2493 bytes --]
---
include/linux/ipipe.h | 6 +++++-
include/linux/preempt.h | 5 +++--
kernel/ipipe/core.c | 6 ++----
3 files changed, 10 insertions(+), 7 deletions(-)
Index: linux-2.6.17.13/include/linux/ipipe.h
===================================================================
--- linux-2.6.17.13.orig/include/linux/ipipe.h
+++ linux-2.6.17.13/include/linux/ipipe.h
@@ -313,7 +313,11 @@ do { \
local_irq_restore_hw(flags); \
} while (0)
-extern struct ipipe_domain *ipipe_percpu_domain[], *ipipe_root_domain;
+extern struct ipipe_domain *ipipe_percpu_domain[];
+
+extern struct ipipe_domain ipipe_root;
+
+#define ipipe_root_domain (&ipipe_root)
extern unsigned __ipipe_printk_virq;
Index: linux-2.6.17.13/kernel/ipipe/core.c
===================================================================
--- linux-2.6.17.13.orig/kernel/ipipe/core.c
+++ linux-2.6.17.13/kernel/ipipe/core.c
@@ -29,12 +29,10 @@
#include <linux/proc_fs.h>
#endif /* CONFIG_PROC_FS */
-static struct ipipe_domain ipipe_root =
+struct ipipe_domain ipipe_root =
{ .cpudata = {[0 ... IPIPE_NR_CPUS-1] =
{ .status = (1<<IPIPE_STALL_FLAG) } } };
-struct ipipe_domain *ipipe_root_domain = &ipipe_root;
-
struct ipipe_domain *ipipe_percpu_domain[IPIPE_NR_CPUS] =
{[0 ... IPIPE_NR_CPUS - 1] = &ipipe_root };
@@ -1038,7 +1036,7 @@ EXPORT_SYMBOL(ipipe_control_irq);
EXPORT_SYMBOL(ipipe_suspend_domain);
EXPORT_SYMBOL(ipipe_alloc_virq);
EXPORT_SYMBOL(ipipe_percpu_domain);
-EXPORT_SYMBOL(ipipe_root_domain);
+EXPORT_SYMBOL(ipipe_root);
EXPORT_SYMBOL(ipipe_stall_pipeline_from);
EXPORT_SYMBOL(ipipe_test_and_stall_pipeline_from);
EXPORT_SYMBOL(ipipe_unstall_pipeline_from);
Index: linux-2.6.17.13/include/linux/preempt.h
===================================================================
--- linux-2.6.17.13.orig/include/linux/preempt.h
+++ linux-2.6.17.13/include/linux/preempt.h
@@ -29,8 +29,9 @@ asmlinkage void preempt_schedule(void);
#ifdef CONFIG_IPIPE
#include <asm/ipipe.h>
-extern struct ipipe_domain *ipipe_percpu_domain[], *ipipe_root_domain;
-#define ipipe_preempt_guard() (ipipe_percpu_domain[ipipe_processor_id()] == ipipe_root_domain)
+extern struct ipipe_domain *ipipe_percpu_domain[];
+extern struct ipipe_domain ipipe_root;
+#define ipipe_preempt_guard() (ipipe_percpu_domain[ipipe_processor_id()] == &ipipe_root)
#else /* !CONFIG_IPIPE */
#define ipipe_preempt_guard() 1
#endif /* CONFIG_IPIPE */
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]
next reply other threads:[~2006-09-24 18:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-24 18:07 Jan Kiszka [this message]
2006-09-24 21:16 ` [Adeos-main] [PATCH] remove ipipe_root_domain indirection Philippe Gerum
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=4516C957.60605@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=adeos-main@gna.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.