l4-hurd
[Top][All Lists]
Advanced

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

Re: Another question about self-paging


From: olafBuddenhagen
Subject: Re: Another question about self-paging
Date: Fri, 4 Nov 2005 06:52:59 +0100
User-agent: Mutt/1.5.9i

Hi,

> It is pretty clear that one program alone mustn't decide whether a
> cache may be freed, as this would eventually reduce other program's
> cache hit rate.
[...]
> Imagine dynamic linking of libraries. To save space the text segment
> of the library exists only once in memory and is mapped read-only into
> the application's AS (while checking this now I remember that the
> complete exists only once in memory). So if on memory pressure an
> application has to select a page to evict and selects a page of the
> ro-mapped text-segment, two things happen:
> 
> 1. To really make the eviction useful the page has to be unmapped from
> every application that has mapped it (and paged out). This breaks the
> self-paging idea, IMHO, as the applications didn't even have a chance
> to influence this.

Obviously this is not what happens :-) As you pointed out above, a
single process does *not* decide alone when a page is abdannoned. The
page is hold by several processes, it is payed by several processes, and
all the processes have an influence on whether it is kept.

This is an interesting problem, but actually not that hard.

In the simplest case, each process decides individually whether it still
wants to pay its share of the page cost. If not, it drops its reference,
and the remaining holders will have to afford the page. Only when the
last one drops out, the page is actually removed from memory.

In a more sophisticated setup, all involved processes decide whether
they want to afford the page *together*. This is not as complicated as
it sounds, if you have a central instance, which we do have in the
market based approach. Within this abstraction, it is actually quite
obvious.

There are several ways how the market could work in detail, but it
always boils down to a simple principle: The processes decide how much
they are willing to pay for some resource. (In our example, depending on
how likely they will need the library soon, and how much they care about
it being available quickly). If the "market price" resulting from the
system load rises above that limit, the resource is abdannoned.

So, when is a shared resource abdannoned? Simple: Once the price rises
above the limit all involved processes are willing to pay
*collectively*.

-antrik-




reply via email to

[Prev in Thread] Current Thread [Next in Thread]