From owner-freebsd-embedded@FreeBSD.ORG Thu Mar 28 03:22:35 2013 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 181CCC09 for ; Thu, 28 Mar 2013 03:22:35 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ia0-x22e.google.com (mail-ia0-x22e.google.com [IPv6:2607:f8b0:4001:c02::22e]) by mx1.freebsd.org (Postfix) with ESMTP id DAF7539C for ; Thu, 28 Mar 2013 03:22:34 +0000 (UTC) Received: by mail-ia0-f174.google.com with SMTP id b35so7791068iac.19 for ; Wed, 27 Mar 2013 20:22:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer:x-gm-message-state; bh=uqLi8bpclgmSwYlXdLTsJWaEOmr2zAQMlKcB5WkgBHA=; b=Ld9eeF7GUEmfEvFQoMtqTBKW+Ln8zQY8sXkCuWTF1EpfG+CCpluu+4xxxlWuaJMtKW LNTwGxHGIG3w5B5iGqzR9ZtfY7tfRIUpnTSlM5AhIeAPUoq5RQw3D3fbLJRvU8Ln5h5c LCDv5cdXyeXpIyUXF2FZftTbuBi8imyzyzaxkYklXxCZPIYQnEDbh9tbkDDM1NEq1hDa AWWSsLUSAlZidlpkHj5nEPBflmpIDmp+HgmyVkn/+/K+wQ031ziz9+4hfW3bth9CEk50 0J/pOufYG+Z+Xg1bq2jFnEQWvnrBv6xTk+bYr+7HD1fvefn46/g9JZiStMpB/sXu8grB xoMw== X-Received: by 10.43.118.2 with SMTP id fo2mr13291337icc.41.1364440954345; Wed, 27 Mar 2013 20:22:34 -0700 (PDT) Received: from 53.imp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPS id ua6sm9151220igb.0.2013.03.27.20.22.33 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Mar 2013 20:22:33 -0700 (PDT) Sender: Warner Losh Subject: Re: FreeBSD on the AP121 (AR9330) Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Wed, 27 Mar 2013 21:22:32 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <1364404612.36972.59.camel@revolution.hippie.lan> <65064C0E-1C1F-4C07-9CFB-DEEC1638A78D@bsdimp.com> To: Adrian Chadd X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQmYRHezrQtlwfITWlLrioaAr4ij0tEzryPSwU3VqmBsdJHFWOO9EJNyU+cGJIh4LwtlqNgX Cc: freebsd-embedded@freebsd.org, Ian Lepore X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Mar 2013 03:22:35 -0000 > -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