remove ipipe_root_domain indirection
PATCH 1/1 remove ipipe_root_domain indirection
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
--- include/linux/ipipe.h | 6 +++++- include/linux/preempt.h | 5 +++-- kernel/ipipe/core.c | 6 ++---- 3 files changed, 10 insertions(+), 7 deletions(-)
include/linux/ipipe.h +5 -1
@@ -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;
kernel/ipipe/core.c +2 -4
@@ -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);
include/linux/preempt.h +3 -2
@@ -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 */
Philippe Gerum
AppliedQuoted 5 lines · Jan Kiszka
This simple patch removes an unneeded indirection by mapping
ipipe_root_domainto&ipipe_root. Saves more than 7k kernel size with my setup here whenCONFIG_PREEMPTis enabled, and I bet it requires a few cycles less as well.
Merged, thanks.
Quoted 5 lines
Jan
_______________________________________________
Adeos-main mailing list
[email protected]
https://mail.gna.org/listinfo/adeos-main
Signature · 1 line
Philippe.