lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 29 May 2008 21:08:35 -0700
From:	Max Krasnyansky <maxk@...lcomm.com>
To:	Paul Jackson <pj@....com>
CC:	mingo@...e.hu, a.p.zijlstra@...llo.nl,
	linux-kernel@...r.kernel.org, menage@...gle.com,
	rostedt@...dmis.org
Subject: Re: [PATCH] sched: Move cpu masks from kernel/sched.c into kernel/cpu.c



Paul Jackson wrote:
> Max wrote:
>> kernel/cpu.c is now built for the UP kernel too, but it does not
>> affect the size the kernel sections.
> 
> I don't think this is possible.  It must affect the size.
> 
> The patch moves kernel/cpu.o from being included only if CONFIG_SMP,
> to being included always:
> 
>      obj-y     = sched.o fork.o exec_domain.o panic.o printk.o profile.o \
>     -	    exit.o itimer.o time.o softirq.o resource.o \
>     +	    cpu.o exit.o itimer.o time.o softirq.o resource.o \
> 		sysctl.o capability.o ptrace.o timer.o user.o \
> 		signal.o sys.o kmod.o workqueue.o pid.o \
> 		rcupdate.o extable.o params.o posix-timers.o \
>     @@ -27,7 +27,7 @@ obj-$(CONFIG_RT_MUTEXES) += rtmutex.o
>      obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o
>      obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o
>      obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
>     -obj-$(CONFIG_SMP) += cpu.o spinlock.o
>     +obj-$(CONFIG_SMP) += spinlock.o
> 
> The kernel/cpu.o object file is non-empty; it has size,
> perhaps 1 or 2 kbytes of text, and a little bit of data.
> 
> So adding it to builds which disabled SMP must add to the
> size of the resultant kernel, by my thinking anyway.

All the code is ifdefed under CONFIG_SMP. So there is no code in the !SMP
case, just three masks. When you mentioned it first time I went back and
rebuilt the !SMP kernel with and without the patch. Luckily I have a
ridiculously fast 8way box here so I went ahead and verified it again.

Before:
size vmlinux
   text	   data	    bss	    dec	    hex	filename
3305622	 306420	 310352	3922393	 3bd9d9	vmlinux

size kernel/cpu.o
size: 'kernel/cpu.o': No such file

After:
size vmlinux
   text	   data	    bss	    dec	    hex	filename
3305621	 306420	 310352	3922393	 3bd9d9	vmlinux

size kernel/cpu.o
   text	   data	    bss	    dec	    hex	filename
     96	     24	      0	    120	     78	kernel/cpu.o

Max
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ