vimage.sysvipc. If you want to work on anything before this use the 'vimage' p4 branch (//depot/projects/vimage/…).*REALITY* Step 2 was committed DECEMBER 10
1. [DONE] Apply the V_ macro prefix:
1.5. [DONE] Further style changes (NOP) bringing in more infrastructure:
2.[DONE] Move the globals into a struct (g.v):
3. Apply virtualization (g→v):
4. Finish more subsystems
jail_*.I (julian) have been testing going backwards and forwards using the VIMAGE_GLOBALS option and have see no significant performance changes between the original code and the same code compiled with a set of global structures. Looking at the generated code I can see that the compiler is resolving the locations of each field in the structures and the resulting instructions are almost identical with only the addesses being differnet. This gives me confidence that when VIMAGE is compiled out the performance numbers are in practice, as we had postulated, identical to teh original numbers. This makes VIMAGE a much more attractive feature if those who do need the performance and don't need multiple contexts can be confident we will not be hurting them.
You can use nm(1) on your kernel/object files. Use something like:
nm *.o | awk '/ [bd] / { print $3 }' | sort | uniq -c | awk '{ if ($1 > 1) { print $0 } }'
cd /sys/<arch>/conf make LINT
Generate a VIMAGE_LINT (or an equivalent for GENERIC):
include LINT ident VIMAGE-LINT nooptions INVARIANTS nooptions INVARIANT_SUPPORT
__FreeBSD_version in unpatched tree (to match the patched tree) if needed.__LINE__ appears in some .o files via macros, so whitespace needs to be added to unpatched files that are modified by e.g. addition of #include <sys/vimage.h>. Prepending blank lines to the top of the file should be good enough at least for most of them. If it is not, for example at a later stage, you need to prepare a 'counterpatch' that adds the same whitespace to the plain kernel as the vimage diff adds new lines to its tree. You may also need to add some temporary whitespace to the vimage tree in case you remove lines and do not add new ones back. To avoid to much empty line shuffling you may want to change the lock line number to a static like:--- sys/sys/lock.h.orig 2008-09-25 22:21:06.000000000 +0000
+++ sys/sys/lock.h 2008-09-25 22:21:49.000000000 +0000
@@ -132,4 +132,4 @@ struct lock_class {
#if LOCK_DEBUG > 0
#define LOCK_FILE __FILE__
-#define LOCK_LINE __LINE__
+#define LOCK_LINE 0xc0defeed
#else
config VIMAGE_LINT cd ../compile/VIMAGE_LINT make -s cleandepend __MAKE_CONF=/dev/null SRCCONF=/dev/null make -s depend __MAKE_CONF=/dev/null SRCCONF=/dev/null make -s __MAKE_CONF=/dev/null SRCCONF=/dev/null
or run following from src/
make buildkernel KERNCONF=VIMAGE_LINT __MAKE_CONF=/dev/null SRCCONF=/dev/null
find . -type f -name "*.o" -print | xargs -n 1 strip
find . -type f -name "*.o" -print | xargs md5 | sort > /tmp/VIMAGE_LINT.{plain,vimage}
diff -u /tmp/VIMAGE_LINT.plain /tmp/VIMAGE_LINT.vimage