Re: 2.1.76, nfs client, and memory fragmentation

kwrohrer@enteract.com
Thu, 1 Jan 1998 16:45:35 -0600 (CST)


And lo, Linus Torvalds saith unto me:
> On Wed, 31 Dec 1997 kwrohrer@enteract.com wrote:
> > I can definitely feel pauses (it feels like more pauses than there ought
> > to be) but they are of finite length so far.
> Yes. That was why I'm nervous about it. I'll put it into 2.1.77 now that I
> did it anyway, to get more people to test it out and comment on it, but
> we'll have to keep this in mind.
vmscan.c must swap until the high-order free hunks are restored, not just
until num_free_pages >= min_free_pages. Without a reverse page table,
every page you swap out is a shot in the dark, but at least the pages will
only go as far as the swap cache until they're needed one way or the other.

> > Meanwhile, is there a semblance of reverse page table I haven't found yet?
> > I can find the pages I want to shuffle around by physical address, but I
> > need the task and page structs in order to do it, and brute-force searching
> > just isn't worth it...
> No, no reverse page tables. The data structures to keep them up-to-date
> worries me (it would essentially involve doubling all the page tables).

One word: Eh?

Based on what I did with Nachos it would take only one page table entry *
per page of physical memory; (alternately, the order-0 free bitmap [cw]ould
grow by a factor of sizeof(pointer)), unless you also need a struct task *
that's not present in the struct page. To maintain this you'd only need one
written word per page freed by free_pages_ok or allocated by __get_free_pages
(though the latter function doesn't have the data it would need, so the
stuff in vmalloc.c would have to do it again). Kernel pages (with no virtual
mapping, and thus no way to transparently remap them) and free pages (duh)
would have magic "addresses" for their reverse page table entries, of
course.

> It
> comes up every once in a while, but I'd really like to avoid it if at all
> possible.
Right now I see it as a cheap and elegant solution to the fragmentation
problem which involves low-coefficient O(1) work to maintain and one kbyte
of storage per megabyte of physical memory. My 32M machine can certainly
trade 32k it can't use when it needs it, for 16k (and larger) fragments
on demand...

Keith (been here, done this, graded the papers)