l4-hurd
[Top][All Lists]
Advanced

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

Re: some other memory considerations.


From: Marcus Brinkmann
Subject: Re: some other memory considerations.
Date: Tue, 26 Oct 2004 15:02:30 +0200
User-agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/21.3 (i386-pc-linux-gnu) MULE/5.0 (SAKAKI)

At Tue, 26 Oct 2004 02:24:57 -0400,
Rian Hunter <address@hidden> wrote:
> How will copy-on-write from untrusted-task to untrusted-task work?

The filesystem makes a logical copy of the page from its cache into
the container provided by the client, marked copy-on-write.  Then the
page can be mapped into the client (read-only).  When a write page
fault arises, and the client forces a writable mapping, physmem will
make the physical copy.  So, COW is implemented lazily.

Note that copying from container to container is usually not a memcpy,
but a logical copy of frame references.

> Complications that arise with copy-on-write through physmem would be if 
> the translator that actually owns the page is killed somehow, then the 
> task server would be required to notify the physmem server to actually 
> copy whatever pages are copy-on-write from that translator to the client 
> tasks.

The trick is to not have the page owned by only the translator, but by
both the translator and the user.  Both must pay the full cost of a
whole page for the whole time of the transaction.  The result is that
either of them can at any point drop the page (or be forced to drop
it, with kill -9 for example), without the other side losing it, and
without having nobody to pay for it.

> Another complication is how would a copy-on-write page be classified to 
> a client task? Would it be considered owned by it and count toward it's 
> total page count,

Yes.

> or will physmem not count it, unless it actually gets 
> copied. In the case that a copy-on-write page is suddenly copied into 
> the client task, but the client task has already exceeded its allowed 
> number of pages and the physmem server is doing an audit, what would 
> happen? Would it count toward a guaranteed frame or extra?

The client pays for the page in advance, when creating the container.
Then the logical copy from the filesystem's cache to the client
replaces the paid dummy page by the real data page.  It is already
being paid for, the whole time through the transaction and beyond.

Thanks,
Marcus





reply via email to

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