On Mon, Sep 15, 2014 at 09:50:36AM +0200, Miroslav Suchý wrote:
On 09/12/2014 07:09 PM, Reindl Harald wrote:
>never worked relieable here on multiple machines
>
>it often showed nothing where i knew the thing
>which should be restarted without looking and
>"lsof" proved it
I am one of those guys who refuse to reboot after each upgrade (and
it works for me) and needs-restarting is ugly and insufficient to
me.
Therefore I initiated this project:
https://github.com/FrostyX/tracer
http://copr.fedoraproject.org/coprs/frostyx/tracer/
It is still not finished and ready for announcement, but if you are
looking for some other way than offline-upgrade, this might be worth
of participating.
It wasn't clear to me how tracer works for non-C programs.
However there was some Red Hat only discussion recently about how to
do this for Python programs, with minimal overhead. Below I'm just
reproducing a technique (untested) that I think will work for Python.
It requires a small patch to the Python interpreter, and a similar
patch to any other language interpreters (eg. Perl, Ruby).
Rich.
-------
For each module (*.py or *.pyc) that it imports, have it mmap the
first page of that file into its memory.
The mmap would be PROT_NONE because it's not actually used, and the
associated file descriptor should be closed.
This will appear in /proc/PID/maps, with a "(deleted)" flag if the
underlying file gets deleted (and hence the process needs restarting).
The cost should be almost nothing:
- 4K of virtual memory, no real memory
- an extra mmap syscall on import
- an extra segment in the kernel's VM AVL
-------
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW