Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* Kernel stripping question
@ 1995-05-02  4:00 Peter Mardahl
  1995-05-03  4:00 ` Daniel S. Riley
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Peter Mardahl @ 1995-05-02  4:00 UTC (permalink / raw)




DEC UNIX's (aka osf1) kernel is very huge and consumes
lots of precious RAM--8M if you use an out-of-the-box
kernel and 5M as I've configured the kernel.

I've considered stripping the /vmunix binary to reduce
its usage of RAM.

Screwing up the kernel is a big nightmare so I'm not
going to experiment without asking first:

so here goes:

Will a stripped kernel work?

What besides ps, uptime will break?

Is my theory that a smaller /vmunix on disk will cause
the RAM used to be smaller correct?

I noticed that the Makefile for the kernel has the
flags -g3 and some defines having to do with profiling,
can I obtain a kernel which doesn't have this stuff in it,
but which is fully functional?

Anyone have any suggestions on how else to create a 
leaner, faster kernel?


Please email as well as post.

Peter Mardahl
peterm@langmuir.eecs.berkeley.edu




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Kernel stripping question
  1995-05-02  4:00 Kernel stripping question Peter Mardahl
@ 1995-05-03  4:00 ` Daniel S. Riley
  1995-05-03  4:00 ` Joerg Lehners
  1995-05-03  4:00 ` A Kinder, Gentler Kernel Michael C. Grant
  2 siblings, 0 replies; 5+ messages in thread
From: Daniel S. Riley @ 1995-05-03  4:00 UTC (permalink / raw)



In article <3o6b5t$bmg@agate.berkeley.edu>,
peterm@tonks.EECS.Berkeley.EDU (Peter Mardahl) writes:
peterm> Is my theory that a smaller /vmunix on disk will cause
peterm> the RAM used to be smaller correct?

No.  Debug symbol tables do not get loaded into memory; all stripping
gains you is disk space, not RAM.  If you want to see the non-dynamic
component of an executable's memory usage, use the size command; 'ls'
is not a useful indicator of memory usage.

peterm> I noticed that the Makefile for the kernel has the flags -g3
peterm> and some defines having to do with profiling, can I obtain a
peterm> kernel which doesn't have this stuff in it, but which is fully
peterm> functional?

Changing the '-g3' flag will only change the size of the small number
of objects that are recompiled at kernel build time--it will not
affect the bulk of the kernel which is shipped as pre-compiled objects.
The only really effective way to slim down the kernel is to remove
"options" you do not need (but be warned that most of the "options"
in the DEC OSF/1 kernel config file are mandatory...).

-- 
Dan Riley                          Internet:  dsr@lns598.lns.cornell.edu
Wilson Lab, Cornell University     HEPNET/SPAN: lns598::dsr (44630::dsr)
	      "Distance means nothing/To me." -Kate Bush



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Kernel stripping question
  1995-05-02  4:00 Kernel stripping question Peter Mardahl
  1995-05-03  4:00 ` Daniel S. Riley
@ 1995-05-03  4:00 ` Joerg Lehners
  1995-05-03  4:00   ` Peter Mardahl
  1995-05-03  4:00 ` A Kinder, Gentler Kernel Michael C. Grant
  2 siblings, 1 reply; 5+ messages in thread
From: Joerg Lehners @ 1995-05-03  4:00 UTC (permalink / raw)
  Cc: peterm

In <3o6b5t$bmg@agate.berkeley.edu> peterm@tonks.EECS.Berkeley.EDU (Peter Mardahl) writes:
>DEC UNIX's (aka osf1) kernel is very huge and consumes
>lots of precious RAM--8M if you use an out-of-the-box
>kernel and 5M as I've configured the kernel.
>I've considered stripping the /vmunix binary to reduce
>its usage of RAM.

You can't reduce RAM usage by stripping (in the sense of /usr/bin/strip)
the kernel. You could free some RAM by removing unneeded device drivers
and optional features, although the installations procedures should have
done it for you (doconfig and friends).

You can free some disk space by not including all non global
symbols into the /vmunix symbol table: I got the /vmunix down
to around 3 MB disk space by using
makeoptions     LDOPTS="-x"
in the kernel config file. (This is for a DEC 3000 Model 300)
But beware: this might be unsupported by Digital and it makes some
kernel debugging tools useless.

>Screwing up the kernel is a big nightmare so I'm not
>going to experiment without asking first:

Either have /genvmunix around on the root file system or a bootable
CD and a CD ROM player.

>so here goes:
>Will a stripped kernel work?
>What besides ps, uptime will break?

Stripping in the sense of /usr/bin/strip: no, it won't work,
too much of /sbin/init.d/* depends on 'ps' to work.

>Is my theory that a smaller /vmunix on disk will cause
>the RAM used to be smaller correct?

No, the symbol table will not be loaded into memory and will
not consume RAM.

>[...]

  Joerg Lehners
-- 
Mail: Joerg.Lehners@arbi.Informatik.Uni-Oldenburg.DE
Real: Joerg Lehners, FB 10 Informatik ARBI, Uni Oldenburg, D-26111 Oldenburg



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Kernel stripping question
  1995-05-03  4:00 ` Joerg Lehners
@ 1995-05-03  4:00   ` Peter Mardahl
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Mardahl @ 1995-05-03  4:00 UTC (permalink / raw)


In article <1995May3.201127.4969@arbi.Informatik.Uni-Oldenburg.DE>,
Joerg Lehners <Joerg.Lehners@arbi.informatik.uni-oldenburg.de> wrote:
>In <3o6b5t$bmg@agate.berkeley.edu> peterm@tonks.EECS.Berkeley.EDU (Peter Mardahl) writes:


... reply deleted ....

thanks for the reply.  I'm going to summarize some of the
responses I got from people:

1) no, stripping the kernel will NOT reduce the RAM usage.
It WILL break ps and related programs.

2)  using 'makeoptions LDOPTS="-x"'  (maybe mispelled?)
reduced the disk image of the kernel to about 1/2 without
breaking anything.  This strips out local debugging info
but not global symbol information, according to the manpage.

3) removing options you don't need DOES reduce the RAM usage.
However, you can't go very far in this direction.  (All the
DEC people who wrote me remarked on this.)

4) reducing maxusers also seemed to reduce RAM usage:  mine
was 32 and is now 16.  I'm not sure how much this really helps.

Thanks to all who have responded.

Regards,

PeterM



^ permalink raw reply	[flat|nested] 5+ messages in thread

* A Kinder, Gentler Kernel
  1995-05-02  4:00 Kernel stripping question Peter Mardahl
  1995-05-03  4:00 ` Daniel S. Riley
  1995-05-03  4:00 ` Joerg Lehners
@ 1995-05-03  4:00 ` Michael C. Grant
  2 siblings, 0 replies; 5+ messages in thread
From: Michael C. Grant @ 1995-05-03  4:00 UTC (permalink / raw)


In article <3o6b5t$bmg@agate.berkeley.edu> 
peterm@tonks.EECS.Berkeley.EDU (Peter Mardahl) writes:
   I noticed that the Makefile for the kernel has the
   flags -g3 and some defines having to do with profiling,
   can I obtain a kernel which doesn't have this stuff in it,
   but which is fully functional?

If you look in the config file for your kernel, you'll see a
couple of 'makeoptions' lines. One of them adds debugging info
to the kernel, the other adds profiling info (methinks). 

Anyway, I commented them both out and added

makeoptions	LDOPTS="-x"

and it seems to work just fine. My kernel's about 4MB.

For grins, I'll post my config file. Your mileage may
vary---DON'T USE IT unless you understand it REALLY well.
If anyone else out there has suggestions for trimming it
down in any significant fashion, I'd love to hear it.

Mike

P.S. This is for an AlphaStation 200.

ident		"WHEEZER"

options		GENERIC
options		UERF
options		OSF
options		_LMF_
options		ULT_BIN_COMPAT
options		BIN_COMPAT
options		COMPAT_43
options		MACH
options		MACH_IPC_TCACHE
options		MACH_IPC_WWA
options		MACH_IPC_XXXHACK 
options		STREAMS
options		BUFCACHE_STATS
options		INOCACHE_STATS
options		STAT_TIME
options		VAGUE_STATS
options		UFS
options		NFS
options		LDTTY
options		STRKINFO
options		INET
options		UIPC
options		SYSV_COFF
options		SYSV_ELF
options		QUOTA
options		LABELS
options		DLI
options		BSD_TTY
options		DLB
options		MSFS
options		PACKETFILTER
options		CDFS
#
# Standard options.
#
options		UNIX_LOCKS
options		SER_COMPAT
options		RT_PREEMPT
options		RT_SCHED
options		RT_SCHED_RQ
options		RT_PML
options		RT_TIMER
options		RT_SEM
options		RT_CSEM
options		RT_IPC
#
makeoptions	LDOPTS="-x"
# makeoptions	CDEBUGOPTS="-g3"
# makeoptions	PROFOPTS="-DPROFILING -DPROFTYPE=4"
#
# Max number of processors in the system (DO NOT CHANGE)
#
processors	16

#
# Special options (see configuring the kernel chapter
# in the Guide to System Administration)
#
timezone	0 dst 0
dfldsiz		134217728
maxdsiz		1073741824
dflssiz		2097152
maxssiz		33554432
cpu		"DEC2100_A50"
maxusers	8
# maxusers	32
machine		alpha

config		vmunix	swap generic

bus             pci0       at nexus?    
callout after_c "../bin/mkdata pci"
bus             psiop0     at pci0      slot  6 vector    psiopintr 
controller      scsi0      at psiop0    slot  0 
device disk     rz0        at scsi0     drive     0 
device disk     rz4        at scsi0     drive     32 
bus             isa0       at pci0      slot  7 
callout after_c "../bin/mkdata isa"
controller      gpc0       at isa0      slot  0 vector    gpcintr 
controller      ace0       at isa0      slot  2 vector    aceintr 
controller      ace1       at isa0      slot  3 vector    aceintr 
controller      lp0        at isa0      slot  4 vector    lpintr 
controller      fdi0       at isa0      slot  5 vector    fdintr 
device disk     fd0        at fdi0      drive     0 
controller      msb0       at isa0      slot  6 vector    msbintr 
controller      tu0        at pci0      slot  11 vector    tuintr 
controller      tga0       at pci0      slot  13 vector    tgaintr 


scs_sysid	1
pseudo-device	sysv_hab
pseudo-device	svid_three_hab
pseudo-device	svr_four_hab
pseudo-device	soe_two_hab
pseudo-device	rt_hab
pseudo-device	rpty	255
pseudo-device	ether
pseudo-device	sl	2
pseudo-device	loop
pseudo-device	strpush	16
#
# Max number of processors in the system (DO NOT CHANGE)
#
pseudo-device	cpus	16
pseudo-device	ws
--
Michael C. Grant           Information Systems Laboratory, Stanford University
mcgrant@isl.stanford.edu       <A HREF="http://www-isl.stanford.edu/~mcgrant">
------------------------------------------------------------------------------
"When you get right down to it, your           "Long hair, short hair---what's
average pervert is really quite                 the difference once the head's
thoughtful." (David Letterman)                    blowed off?" (Nat'l Lampoon)



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1995-05-03  4:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-05-02  4:00 Kernel stripping question Peter Mardahl
1995-05-03  4:00 ` Daniel S. Riley
1995-05-03  4:00 ` Joerg Lehners
1995-05-03  4:00   ` Peter Mardahl
1995-05-03  4:00 ` A Kinder, Gentler Kernel Michael C. Grant

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox