From: Tobias Hunger Subject: Code size vs. linux source code compatibility in the hypervisor Date: Sat, 29 Jan 2005 12:31:53 +0100 Message-ID: <200501291231.59144.tobias@aquazul.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2581944.Jzb23sGeB0"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Return-path: Sender: xen-devel-admin@lists.sourceforge.net Errors-To: xen-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: xen-devel@lists.sourceforge.net List-Id: xen-devel@lists.xenproject.org --nextPart2581944.Jzb23sGeB0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello there! I recently spend some time trying to better understand the hypervisor part = of=20 xen and decided to dive into the code in the xen subdirectory. David A.=20 Wheeler's 'SLOCCount' reports about 53k lines of C code there. My first impression was that much of the code is in fact unused by Xen and= =20 mostly there, because it was salvaged from the Linux kernel. To aid my=20 understanding of Xen I started to trim down on macros and functions. I was= =20 surprised to be able to actually remove about 8k lines of code and 1.5k mac= ro=20 definitions from the ACPI part! Xen still builds and runs for me:-) Since t= he=20 compiler will optimize out unused code this reduction is not reflected in t= he=20 compiled size of the hypervisor (mine is identical in size to the one build= =20 from yesterdays unstable tarball). My question is: What is the stance of the core team on the issue of code si= ze=20 vs. linux source code compatibility? The less code the easier it is for=20 others to get into the project, while keeping the complete linux code aroun= d=20 might make moving new code over to xen easier. Are you interested in patche= s=20 to remove unused code? Mine currently removes almost all the header files i= n=20 include/acpi... What do you think about #if 0 in code? I personally hate that: There is=20 version tracking, so there is no reason to keep old code visible that way.= =20 What about all those "#ifdef CONFIG_FOO" lines from the linux kernel?=20 Currently xen is rather fixed in the configuration it supports and uses. Is= =20 that a feature of xen (then those #ifdefs can go IMHO) or supposed to chang= e=20 over time? As you might have noticed I have not used C too much for the last couple of= =20 years and never was a fan of cpp in the first place:-) This code rewriting= =20 all over the place keeps knocking me out of the flow of understanding what = is=20 happening. =2D-=20 Gruss, Tobias =2D----------------------------------------------------------- Tobias Hunger The box said: 'Windows 95 or better' tobias@aquazul.com So I installed Linux. =2D----------------------------------------------------------- --nextPart2581944.Jzb23sGeB0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQBB+3Qvv0FZW3NyoqURAp3qAKCPAr56feRnlNSVG3NSpZMuvZYJ3QCgt8Hh A2Y53QrBx9CIlm8jhM4+Ht4= =iXJV -----END PGP SIGNATURE----- --nextPart2581944.Jzb23sGeB0-- ------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl