Re: journaling & VM

John Fremlin
2000-06-07T16:35:13Z

"Stephen C. Tweedie" <sct@redhat.com> writes:
[...]
> > There are two issues to address:
> >
> > 1) If a buffer needs to be flushed to disk, how do we let the FS flush
> > everything else that it is optimal to flush at the same time as that buffer.
> > zam's allocate on flush code addresses that issue for reiserfs, and he has some
> > general hooks implemented also. He is guessed to be two weeks away.
>
> That's easy to deal with using address_space callbacks from shrink_mmap.
> shrink_mmap just calls into the filesystem to tell it that something
> needs to be done. The filesystem can, in response, flush as much data
> as it wants to in addition to the page requested --- or can flush none
> at all if the page is pinned. The address_space callbacks should be
> thought of as hints from the VM that the filesystem needs to do
> something. shrink_mmap will keep on trying until it finds something
> to free if nothing happens on the first call.
>
I don't understand the idea behind this. (Clueless newbie alert.)

You are saying, that the MM system maintains a list of pages, then
when it wants to free some memory it goes down the list seeing which
subsystem owns each page, and asks it to free some memory. (Correct me
if I am wrong).
That is, each filesystem or whatever can basically implement its own
MM. If so, why not simply have a list of subsystems that own memory
with some sort of measure of how much space they're wasting, and ask
the ones with a lot to free some?

--