Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Mar 2013 21:22:32 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Adrian Chadd <adrian@freebsd.org>
Cc:        freebsd-embedded@freebsd.org, Ian Lepore <ian@freebsd.org>
Subject:   Re: FreeBSD on the AP121 (AR9330)
Message-ID:  <B649B0AC-21B7-4C12-8114-E363134E8198@bsdimp.com>
In-Reply-To: <CAJ-VmokKnWLYUvUkxf-H_drMMw4P0VqenZU2GXLkHKLyFne-fg@mail.gmail.com>
References:  <CAJ-Vmom8sbMJvFn1ucGBSiptWtKPC0kE1Ss22Kj-WGVSkP_8ag@mail.gmail.com> <1364404612.36972.59.camel@revolution.hippie.lan> <CAJ-VmokJ40LDF4WeuAENkZR89iStEmnTGkojeA6brSRkSKgJ1w@mail.gmail.com> <65064C0E-1C1F-4C07-9CFB-DEEC1638A78D@bsdimp.com> <CAJ-VmokXmycjeBv=3qOyiwdq4hqQ9ubwuxCEFpA_UPKtQ%2BAYFQ@mail.gmail.com> <CAJ-Vmo=HFgWfd0HRNfcXRVPL6X-_gbg4Hs1Fbnj5TAGa-j6GNQ@mail.gmail.com> <CAJ-VmokKnWLYUvUkxf-H_drMMw4P0VqenZU2GXLkHKLyFne-fg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> -r-xr-xr-x  1 adrian  wheel   4638057 Mar 27 17:34 =
/tftpboot/kernel.AP121
>=20
> http://people.freebsd.org/~adrian/ath/AP121-nodebug.txt
>=20
> Yes, it's bigger without -g.

I was able to save about 40k by uninlining mutexes, etc. But that took =
the AP96 kernel from 6.5MB to 6.4MB.

4680311	 266388	1576752	6523451	 638a3b	=
/dune/imp/obj/mips.mips/dune/imp/FreeBSD/sys/AP96/kernel
4641469	 266372	1576624	6484465	 62f1f1	=
/dune/imp/obj/mips.mips/dune/imp/FreeBSD/sys/AP96/kernel

svn diff sys/mips/conf
Index: sys/mips/conf/AP96
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/mips/conf/AP96	(revision 248804)
+++ sys/mips/conf/AP96	(working copy)
@@ -43,3 +43,11 @@
=20
 device		etherswitch
 device		arswitch
+
+# Disable the inlining of mutex, rwlock and sx locks.  These eat up a =
lot
+# of space.
+options 	MUTEX_NOINLINE
+options 	RWLOCK_NOINLINE
+options 	SX_NOINLINE
+options 	NO_FFS_SNAPSHOT
+options 	NO_SWAPPING


Here's the top 10 in terms of text size:

  57344	    160	  49184	 106688	  1a0c0	=
/dune/imp/obj/mips.mips/dune/imp/FreeBSD/sys/AP96/kern_umtx.o
  57004	    848	     64	  57916	   e23c	=
/dune/imp/obj/mips.mips/dune/imp/FreeBSD/sys/AP96/pci.o
  48956	  10672	     80	  59708	   e93c	=
/dune/imp/obj/mips.mips/dune/imp/FreeBSD/sys/AP96/scsi_all.o
  48664	   1680	    256	  50600	   c5a8	=
/dune/imp/obj/mips.mips/dune/imp/FreeBSD/sys/AP96/vfs_subr.o
  45156	    624	      0	  45780	   b2d4	=
/dune/imp/obj/mips.mips/dune/imp/FreeBSD/sys/AP96/if_ath.o
  44932	   2000	    320	  47252	   b894	=
/dune/imp/obj/mips.mips/dune/imp/FreeBSD/sys/AP96/vfs_bio.o
  41796	    992	    192	  42980	   a7e4	=
/dune/imp/obj/mips.mips/dune/imp/FreeBSD/sys/AP96/ffs_alloc.o
  41376	      0	      0	  41376	   a1a0	=
/dune/imp/obj/mips.mips/dune/imp/FreeBSD/sys/AP96/if_ath_tx.o
  38272	   5120	     80	  43472	   a9d0	=
/dune/imp/obj/mips.mips/dune/imp/FreeBSD/sys/AP96/kern_jail.o
  34340	    752	    192	  35284	   89d4	=
/dune/imp/obj/mips.mips/dune/imp/FreeBSD/sys/AP96/cam_xpt.o

two of which you might be able to do something about. One suspects that =
PCIe support could be compiled out of pci.o, and there's two from CAM, =
and another three from file systems... Maybe there's a smaller subset of =
CAM that can be compiled in for the USB drive support?

Last time I fought this battle, it was a battle of attrition: 20k here, =
20k there, 5k over there. Sadly, you'll need about 100 of these.  Also, =
inlining can cause significant bloat, and we inline a lot...

Warner




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B649B0AC-21B7-4C12-8114-E363134E8198>