[Top][All Lists]

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

Re: proxy memory objects patch

From: Marcus Brinkmann
Subject: Re: proxy memory objects patch
Date: Fri, 13 Dec 2002 19:32:22 +0100
User-agent: Mutt/1.4i

On Thu, Dec 05, 2002 at 05:33:07AM -0500, Roland McGrath wrote:
> > Mmh, I was actually thinking of a hole as being anonymously allocated
> > memory, ie, zero filled.
> Oh, that's not what I was talking about.  That's not a hole, it's an
> anonymous memory object.  I guess that is the appropriate semantic to match
> vm_map, as Thomas says.  I suppose if you need a real hole you could make
> an empty real memory object, e.g. default_pager_object_set_size to zero.
> > Do we really need actual holes, ie, invalid pages?  Can we use
> I don't think you can send MACH_PORT_DEAD (you just receive it when a dead
> name you didn't already have was sent).  The only simple interface for it I
> can think of is some kludge like offset=-1 when memobj=MACH_PORT_NULL.

Well, so far there is no offset argument ;)  but something like "start = -1"
and "size" being the size of the hole _would_ be possible, although it is
certainly a horrible kludge.
> I seem to have a desire to have an interface for a hole without using a
> real memory object, but I can't think of a use for it.  (But then, I can't
> really think of a use for zero-fill regions in a proxy object.)

Well, I see only two ways, beside the kludges above where we overload the
MACH_PORT_NULL object giving start/size special meanings:

* Have an array of offset arguments, which are used in the way you wanted it
  to be originally.  Then we would need start, end and offset.  The
  advantage is arbitrary holes, the disadvantage is complex calculation of
  offsets necessary (both user and kernel side actually).  Or, instead
  "offset" just "pregap_size" to specify holes, so you don't need calculate
  any offsets, but still you need an array of "0"s in the common case.

* The simpler variant is to just allow one hole, and that only at the very
  start of the proxy memory object.  The size of the hole would be given by
  a single pregap argument.  You can still construct arbitrary holes by
  nesting several calls:

  proxy_create (..., vm_prot_t max_prot, vm_size_t pregap,
                     memory_object_t object[], vm_offset_t start[],
                     vm_size_t size[])

  The common case would be pregap = 0.

I like the second version because it is so much simpler to handle, but of
course it would be very inconvenient to actually use it if you have complex


`Rhubarb is no Egyptian god.' GNU      http://www.gnu.org    marcus@gnu.org
Marcus Brinkmann              The Hurd http://www.gnu.org/software/hurd/

reply via email to

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