GNU OS suggestion -- memory "advice"

Andrew Klossner andrew at frip.WV.TEK.COM
Tue Jun 6 05:46:16 AEST 1989


[]

	"Programmers can often predict what areas of a program or
	chunks of data space are going to be used more often than
	others, yet there is generally no way for the programmer to say
	that a chunk of code is or is not needed often, or is only
	called at a point at which speed is not critical."

Some research in the 1970s, when demand paging was new (to many of us),
suggested that programmers cannot do as good a job as they think they
can in predicting memory access behavior.  In general, totally
uninformed, dynamic LRU memory migration was found to win over
extensively tweaked, programmed memory migration.  (This was reported
in a CACM in about mid-decade; sorry I can't quote chapter and verse
from memory.)

	"In one case, a developer described a case in which a large
	array was being scanned a number of times in both row-major and
	column-major order.  He noticed that the slowdown came in the
	latter case since the OS was paging his data in an inefficient
	manner."

Well, sure; in column-major order (assuming a non-Fortran language),
the program is stepping to a new page much more often than in row-major
order.  If a single row is a page or more in size, column-major order
will touch a new page with every single index iteration.  No amount of
memory advise to the OS can mitigate the result of this pathological
behavior.

  -=- Andrew Klossner   (uunet!tektronix!orca!frip!andrew)      [UUCP]
                        (andrew%frip.wv.tek.com at relay.cs.net)   [ARPA]



More information about the Comp.unix.wizards mailing list