Hi Ingo, On Fri, Dec 30, 2005 at 11:14:43AM +0100, Ingo Molnar wrote: > > * Ingo Molnar <mingo@elte.hu> wrote: > > [...] The queue is at: > > http://redhat.com/~mingo/debloating-patches/ > I was curious and applied among others the uninline-capable patch, with the result that modules complain about an unknown symbol "capable". The attached patch is a manually adapted version of yours, extended by the EXPORT_SYMBOL_GPL required for modules to load again. The code with the EXPORT_SYMBOL_GPL line works (I am currently running that kernel) and the patch should apply cleanly. Regards, Chris
Subject: uninline capable() uninline capable(). Saves 2K of kernel text on a generic .config, and 1K on a tiny config. Signed-off-by: Ingo Molnar <mingo@elte.hu> ---- include/linux/sched.h | 15 ++------------- kernel/sys.c | 11 +++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-) Index: linux-gcc.q/include/linux/sched.h =================================================================== --- linux-gcc.q.orig/include/linux/sched.h +++ linux-gcc.q/include/linux/sched.h @@ -1102,19 +1102,8 @@ static inline int sas_ss_flags(unsigned } -#ifdef CONFIG_SECURITY -/* code is in security.c */ -extern int capable(int cap); -#else -static inline int capable(int cap) -{ - if (cap_raised(current->cap_effective, cap)) { - current->flags |= PF_SUPERPRIV; - return 1; - } - return 0; -} -#endif +/* code is in security.c or kernel/sys.c if !SECURITY */ +extern int FASTCALL(capable(int cap)); /* * Routines for handling mm_structs Index: linux-gcc.q/kernel/sys.c =================================================================== --- linux-gcc.q.orig/kernel/sys.c +++ linux-gcc.q/kernel/sys.c @@ -222,6 +222,18 @@ int unregister_reboot_notifier(struct no EXPORT_SYMBOL(unregister_reboot_notifier); +#ifndef CONFIG_SECURITY +int fastcall capable(int cap) +{ + if (cap_raised(current->cap_effective, cap)) { + current->flags |= PF_SUPERPRIV; + return 1; + } + return 0; +} +EXPORT_SYMBOL_GPL(capable); +#endif + static int set_one_prio(struct task_struct *p, int niceval, int error) { int no_nice;
Attachment:
pgpMVv4A9dXzZ.pgp
Description: PGP signature
- References:
- Re: [patch 00/2] improve .text size on gcc 4.0 and newer compilers
- From: Linus Torvalds <torvalds@osdl.org>
- Re: [patch 00/2] improve .text size on gcc 4.0 and newer compilers
- From: Ingo Molnar <mingo@elte.hu>
- Re: [patch 00/2] improve .text size on gcc 4.0 and newer compilers
- From: Ingo Molnar <mingo@elte.hu>
- Re: [patch 00/2] improve .text size on gcc 4.0 and newer compilers
- From: Christoph Hellwig <hch@infradead.org>
- Re: [patch 00/2] improve .text size on gcc 4.0 and newer compilers
- From: Arjan van de Ven <arjan@infradead.org>
- Re: [patch 00/2] improve .text size on gcc 4.0 and newer compilers
- From: Adrian Bunk <bunk@stusta.de>
- Re: [patch 00/2] improve .text size on gcc 4.0 and newer compilers
- From: Jakub Jelinek <jakub@redhat.com>
- Re: [patch 00/2] improve .text size on gcc 4.0 and newer compilers
- From: Andi Kleen <ak@suse.de>
- Re: [patch 00/2] improve .text size on gcc 4.0 and newer compilers
- From: Ingo Molnar <mingo@elte.hu>
- Re: [patch 00/2] improve .text size on gcc 4.0 and newer compilers
- From: Ingo Molnar <mingo@elte.hu>
- Re: [patch 00/2] improve .text size on gcc 4.0 and newer compilers
- Prev by Date: system keeps freezing once every 24 hours / random apps crashing
- Next by Date: Re: system keeps freezing once every 24 hours / random apps crashing
- Previous by thread: Re: [patch 00/2] improve .text size on gcc 4.0 and newer compilers
- Next by thread: Re: [patch 00/2] improve .text size on gcc 4.0 and newer compilers
- Index(es):
![]() |