Re: journaling & VM (was: Re: reiserfs being part of the kernel: it'snot just the code)

From: Rik van Riel (riel@conectiva.com.br)
Date: Wed Jun 07 2000 - 16:14:53 EST


On 7 Jun 2000, Juan J. Quintela wrote:
> >>>>> "sct" == Stephen C Tweedie <sct@redhat.com> writes:
>
> >> I'd like to be able to keep stuff simple in the shrink_mmap
> >> "equivalent" I'm working on. Something like:
> >>
> >> if (PageDirty(page) && page->mapping && page->mapping->flush)
> >> maxlaunder -= page->mapping->flush();
>
> sct> That looks ideal.
>
> But this is supposed to flush that _page_, at least in the
> normal case.

But not *just* that page ...

In the ideal case the flush() function will search around
memory for objects to cluster and write out together with
this page.

I'll probably write an example page->mapping->flush()
function for swap. The function will do the following:
- find other swap pages to cluster with this page,
  those must be:
        - contiguous with this page
        - inactive or seldomly used active pages
        - dirty (duh)
- flush out the collection of pages
- return the number of INACTIVE pages we flushed,
  ignoring the number of active pages

That last point is very important because:
- if we mainly flushed active pages, we should not give
  shrink_mmap (or similar) the illusion that we cleared
  up the inactive list ... don't pretend we made a lot
  of progress cleaning inactive pages if we didn't
- since we wrote the pages in the same disk seek, writing
  the active pages was essentially for free so it doesn't
  matter that we don't report having written them ...
  (having written that page and potentially saving some IO
  later, otoh, definately does matter)

regards,

Rik

--
The Internet is not a network of computers. It is a network
of people. That is its real strength.

Wanna talk about the kernel? irc.openprojects.net / #kernelnewbies http://www.conectiva.com/ http://www.surriel.com/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jun 15 2000 - 21:00:15 EST