* [Adeos-main] [PATCH] remove ipipe_root_domain indirection
@ 2006-09-24 18:07 Jan Kiszka
2006-09-24 21:16 ` Philippe Gerum
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2006-09-24 18:07 UTC (permalink / raw)
To: adeos-main
[-- 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 --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Adeos-main] [PATCH] remove ipipe_root_domain indirection
2006-09-24 18:07 [Adeos-main] [PATCH] remove ipipe_root_domain indirection Jan Kiszka
@ 2006-09-24 21:16 ` Philippe Gerum
0 siblings, 0 replies; 2+ messages in thread
From: Philippe Gerum @ 2006-09-24 21:16 UTC (permalink / raw)
To: Jan Kiszka; +Cc: adeos-main
On Sun, 2006-09-24 at 20:07 +0200, Jan Kiszka wrote:
> 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.
>
Merged, thanks.
> Jan
> _______________________________________________
> Adeos-main mailing list
> Adeos-main@domain.hid
> https://mail.gna.org/listinfo/adeos-main
--
Philippe.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-09-24 21:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-24 18:07 [Adeos-main] [PATCH] remove ipipe_root_domain indirection Jan Kiszka
2006-09-24 21:16 ` Philippe Gerum
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.