Tobias Hunger
2005-Jan-29 11:31 UTC
[Xen-devel] Code size vs. linux source code compatibility in the hypervisor
Hello there! I recently spend some time trying to better understand the hypervisor part of xen and decided to dive into the code in the xen subdirectory. David A. 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 mostly there, because it was salvaged from the Linux kernel. To aid my understanding of Xen I started to trim down on macros and functions. I was surprised to be able to actually remove about 8k lines of code and 1.5k macro definitions from the ACPI part! Xen still builds and runs for me:-) Since the compiler will optimize out unused code this reduction is not reflected in the compiled size of the hypervisor (mine is identical in size to the one build from yesterdays unstable tarball). My question is: What is the stance of the core team on the issue of code size vs. linux source code compatibility? The less code the easier it is for others to get into the project, while keeping the complete linux code around might make moving new code over to xen easier. Are you interested in patches to remove unused code? Mine currently removes almost all the header files in include/acpi... What do you think about #if 0 in code? I personally hate that: There is version tracking, so there is no reason to keep old code visible that way. What about all those "#ifdef CONFIG_FOO" lines from the linux kernel? Currently xen is rather fixed in the configuration it supports and uses. Is that a feature of xen (then those #ifdefs can go IMHO) or supposed to change over time? As you might have noticed I have not used C too much for the last couple of years and never was a fan of cpp in the first place:-) This code rewriting all over the place keeps knocking me out of the flow of understanding what is happening. -- Gruss, Tobias ------------------------------------------------------------ Tobias Hunger The box said: ''Windows 95 or better'' tobias@aquazul.com So I installed Linux. ------------------------------------------------------------
Neugebauer, Rolf
2005-Jan-29 12:24 UTC
RE: [Xen-devel] Code size vs. linux source code compatibility in the hypervisor
As part of the next release we plan to move most of the platform init code into dom0. This includes PCI & IO-APIC setup etc for which we currently need the ACPI parts. So hopefully most of the unnecessary code you identified and probably more will disappear. rolf> -----Original Message----- > From: xen-devel-admin@lists.sourceforge.net [mailto:xen-devel- > admin@lists.sourceforge.net] On Behalf Of Tobias Hunger > Sent: 29 January 2005 11:32 > To: xen-devel@lists.sourceforge.net > Subject: [Xen-devel] Code size vs. linux source code compatibility inthe> hypervisor > > Hello there! > > I recently spend some time trying to better understand the hypervisorpart> of > xen and decided to dive into the code in the xen subdirectory. DavidA.> 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 Xenand> mostly there, because it was salvaged from the Linux kernel. To aid my > understanding of Xen I started to trim down on macros and functions. Iwas> surprised to be able to actually remove about 8k lines of code and1.5k> macro > definitions from the ACPI part! Xen still builds and runs for me:-)Since> the > compiler will optimize out unused code this reduction is not reflectedin> the > compiled size of the hypervisor (mine is identical in size to the one > build > from yesterdays unstable tarball). > > My question is: What is the stance of the core team on the issue ofcode> size > vs. linux source code compatibility? The less code the easier it isfor> others to get into the project, while keeping the complete linux code > around > might make moving new code over to xen easier. Are you interested in > patches > to remove unused code? Mine currently removes almost all the headerfiles> in > include/acpi... > > What do you think about #if 0 in code? I personally hate that: Thereis> version tracking, so there is no reason to keep old code visible thatway.> What about all those "#ifdef CONFIG_FOO" lines from the linux kernel? > Currently xen is rather fixed in the configuration it supports anduses.> Is > that a feature of xen (then those #ifdefs can go IMHO) or supposed to > change > over time? > > As you might have noticed I have not used C too much for the lastcouple> of > years and never was a fan of cpp in the first place:-) This coderewriting> all over the place keeps knocking me out of the flow of understandingwhat> is > happening. > > -- > Gruss, > Tobias > > ------------------------------------------------------------ > Tobias Hunger The box said: ''Windows 95 or better'' > tobias@aquazul.com So I installed Linux. > ------------------------------------------------------------------------------------------------------------------- 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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Tobias Hunger
2005-Jan-29 14:33 UTC
Re: [Xen-devel] Code size vs. linux source code compatibility in the hypervisor
On Saturday 29 January 2005 13:24, Neugebauer, Rolf wrote:> As part of the next release we plan to move most of the platform init > code into dom0. This includes PCI & IO-APIC setup etc for which we > currently need the ACPI parts. So hopefully most of the unnecessary code > you identified and probably more will disappear. > rolfGreat! Is there any paper available about the distribution of responsibilities between xen, dom0 and other domains in the next release? I saw several hints at that here on the list, but I''d like to get the big picture. I am really curious what you guys here came up with. Is there a list of tasks and or bugs that can help newbies to get into xen? I''d love to contribute to your project, but so far I have not really found a good starting place. -- Gruss, Tobias ------------------------------------------------------------ Tobias Hunger The box said: ''Windows 95 or better'' tobias@aquazul.com So I installed Linux. ------------------------------------------------------------