Posted May 8, 2008 14:09 UTC (Thu) by forthy (guest, #1525)
[Link]
Interactive programming languages typically have this feature, i.e.
Lisp, Smalltalk, and to some extent Forth (Forth usually does not change
old functions when you redefine one, but it's often possible to patch
whatever old function to point to a newer one if you like to). You just
reload your source.
This is only so tricky, because Linux is written in C, a language that
has no intention to generate, replace, or modify code at run-time (it's a
classical batch-oriented edit-compile-link-go language). Therefore, the
programmers have no idea how to do that properly - it's fairly trivial if
done right, but needs the support of the language. Changing e.g. GCC to
add (on x86) a simple 5-byte noop in front of each function to be patched
with a jmp to the replacement function would allow seamless patching of
the kernel - you don't have to wait for the previous call to this
function to complete, since the replacement is somewhere else, and all
further callers of this function will call the replacement instead.
Ksplice: kernel patches without reboots
Posted May 8, 2008 19:55 UTC (Thu) by nix (subscriber, #2304)
[Link]
How do you ensure that concurrent callers on other CPUs aren't located
inside those five bytes?