[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A suggestion about working sets

In a discussion I once had with Michael Greenwald
of Symbolics, I suggested that the lispm should implement
some form of working set mechanism to keep the poor
paging performance of one process from affecting another.
He commented that this is hard when all processes share
the same address space as ownership of storage is not
meaningfull. While this is true, it is possible to make
one assumption which is usually a good approximation
of reality: Processes usually do not share data so
an object belongs to the process that created it,
at least for the purpose of determining the total
storage in use by a process. Thus tagging objects
with the process of their creator would allow two
tallys to be kept per process, one: the total
ammount of virtual memory in use by that process and,
two: the total ammount of real memory in use by that
process. Actually, these tallys would have to be
updated both by storage allocation, GC, and paging.

The tallys would allow two additional types of firewalling
that most conventional systems *DO* provide which
the Symbolics *DOES NOT* (despite the claims about greater
firewalling provided by the 3600 architecture).
First, it would allow me to set a limit on the amount
of virtual storage that a process can use. A process
that exceeds this would signal an error (perhaps with
a proceed option to increase that limit and continue)
rather than allowing a run-away process to trash my
machine with all of its valuable state in other
processes. (It takes me over two hours to reboot my
machine these days and load all of my environment.)
Second, it would allow me to set working set guidlines
for the pager and scheduler to increase performance of
interactive tasks while still allowing background
tasks to run. Often, I run many tasks at once, such
as reading my Babyl file in Zmail (my Babyl file
is over 4 megabytes long and takes an hour to read),
running LaTeX in one Lisp Listener, running some
Lisp program in another, and trying to edit a file
in Zmacs. Although the preemptive schedular can (and
presumably does) give a higher priority to the
interactive task of editing, the thrashing caused by
other proceeses paging and reducing the working set
of the editor causes the editor to be painfully
slow. If the working set of the higher priority tasks
is made larger than lower priority ones, then they
can page all they want, at a lower priority, without
causing poor paging performance for my interactive

Now I know that the overhead of storing a pointer to
the creating procees in each object would be large.
But if we make another assumption that there are
usually at most 15 (or 31) processes ever started
in a lisp world from boot to reboot then only 4 or 5
bits of tag need to be added to each object (or word).
When that runs out the remaining code can be used as
an overflow code indicating that the storage ower is
anonymous. This method would require hardware not
available in the 36xx architecture, but perhaps
something like the area mechanism can be adapted
to automatically have each process cons in a different
area. I don't know if the I-machine architecture
has the capability to support the ideas discussed
here but perhaps the next machine (the J-machine?)