[coyotos-dev] Page pinning
Neal H. Walfield
neal at walfield.org
Wed May 21 04:45:59 CDT 2008
At Wed, 21 May 2008 04:28:56 -0400,
Jonathan S. Shapiro wrote:
> It basically looks straightforward to implement pinning. There are
> complications when competing requests to pin arise, but the basic
> resolution on that is that (a) a page can only be in one place at a
> time,
I'm not sure I understand this. Do you mean, when should happen when
a process has pinned a page at a particular address and another
process comes along later and wants to pin it at a second address?
If so, my first question is: is this a problem in practice? As far as
I am aware, there are three main reasons for controlling placement:
DMA issues, cache coloring and NUMA. Generally, these require the
selection of a frame from a particular set of frames, not a specific
frame. I don't think you are terrible interested in cache coloring
and NUMA. That leaves only DMA issues. This only effects data
buffers. Will such data be shared during a DMA request, and, more
importantly, will more than one process try to pin it simultaneously
to specific addresses at this time? (I can imagine that multiple
processes might want to pin at the same time, but then not necessarily
to a specific address.)
> What happens when somebody forgets to "drop" a pin request?
>
> A partial defense lies in the fact that there is a bounded number of pin
> request objects. A bad driver can "leak" pins, but this won't compromise
> overall system integrity, and eventually we will notice. That is: we can
> view this as a storage leak on the pin objects, and treat it as a bug to
> be fixed.
>
> A second partial defense lies in the fact that the pin objects can be
> revoked, at which point the associated pin is canceled.
>
> These two considerations may be entirely good enough, and for the moment
> I propose to see whether that is all we need, but I wanted to point out
> that this is a special case of a more general issue, which is the
> "notify on last capability drop" issue.
Almost. The even more general issue is drop when there are no *live
references*, i.e., it's a garbage collection problem, not a reference
counting problem. The tension you seem to be exploring is whether to
do explicit management or garbage collection.
More information about the coyotos-dev
mailing list