Re: [K12OSN] Doesn't add up

Eric Harrison (eharrison@mail.mesd.k12.or.us)
Sun, 20 Oct 2002 14:44:09 -0700 (PDT)


On Sun, 20 Oct 2002, Jay Kline wrote:

>Close, anyway.  Every time you execute an application, it gets loaded into 
>memory, even if its already there.  The kernel loader has no way of knowing 
>if the program it is loading is the same as one already there.

Not terribly on-topic here, but it is interesting stuff ;-)

I'm definately not an expert (not even a novice) in this area, but this
runs contrary to what I've always heard over the years.

A quick google search didn't turn up anything clearly definitive. I don't know
enough to point at the kernel code and say "look right here".

The various system utilities do show a difference between the first instance
of an executable and later instances of the code. For example, I fired up
mozilla under my account and then fired up mozilla from a dummy account & root.
lsof (list open files) shows that the kernel knows that the device and inode
associated with the executable, and as such could at least in theory know
that the program was already running. Note that in the example below, the
file descriptor type (FD) is different between the first instance and the 
later instances. (mem=memory mapped, txt=program text).


# /usr/sbin/lsof | grep mozilla-bin      # edited/trimmed down for clarity
COMMAND     PID      USER   FD   TYPE     DEVICE    SIZE       NODE NAME
mozilla-b 15327 eharrison  mem    REG       34,6  279490     557472 /usr/lib/mozilla-1.0.0/mozilla-bin
mozilla-b 15435  testuser  txt    REG       34,6  279490     557472 /usr/lib/mozilla-1.0.0/mozilla-bin
mozilla-b 15619      root  txt    REG       34,6  279490     557472 /usr/lib/mozilla-1.0.0/mozilla-bin


I've been wonding how Mosix deals with this. Say two instances of an app are
sharing executable code, one chewing up a lot of resources and one idle,
would mosix migrate the idle process along with the resource intensive process
or would the shared code be duplicated? What about libraries, I assume a
copy of glibc would have to migrated? (otherwise all members of the clusters
would have to have exactly the same software installed).

Back I go to doing something productive... ;-)

-Eric



_______________________________________________
K12OSN mailing list
K12OSN@redhat.com
https://listman.redhat.com/mailman/listinfo/k12osn
For more info see