It is technically possible to automate this, using the same trick as
copy_from_user. spin_unlock generates worst case code and stores the
start and end of the code in yet another ELF section. Kernel boot code
decides which version to use, runs the data in the new ELF section and
patches the code before starting the second processor. insmod does the
same thing. Cost is extra storage in zImage and modules, the extra
section would be discarded after loading so it does not bloat the
running kernel. Binary modules (yuck) compiled with the old
spin_unlock would not have the optimized code but they would still
work.
Whether this is a desirable thing to do is another question ;).
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/