[comp.sys.intel] Copy-on-write

dan@prairie.UUCP (Daniel M. Frank) (11/21/86)

   If you don't have per-segment page tables, then you don't have hardware
support for copy-on-write of pages, only segments.  I consider this a
pretty serious deficiency.


-- 
    Dan Frank
    uucp: ... uwvax!prairie!dan
    arpa: dan%caseus@spool.wisc.edu

kds@mipos3.UUCP (Ken Shoemaker ~) (11/25/86)

In article <362@prairie.UUCP> dan@prairie.UUCP (Daniel M. Frank) writes:
>   If you don't have per-segment page tables, then you don't have hardware
>support for copy-on-write of pages, only segments.  I consider this a
>pretty serious deficiency.

now this I don't understand.  The segmentation translates the segment/
offset pair into a 32-bit offset into linear address space while the
paging hardware translates the 32-bit linear address into a 32-bit
physical address.  Maybe I'm dense, but I don't see why you need to
have a page table per segment to support copy on write pages using
this scheme...
-- 
The above views are personal.

The primary reason innumeracy is so pernicious is the ease with which numbers
are invoked to bludgeon the innumerate into dumb acquiescence.
			- John Allen Paulos

Ken Shoemaker, Microprocessor Design, Intel Corp., Santa Clara, California
uucp: ...{hplabs|decwrl|amdcad|qantel|pur-ee|scgvaxd|oliveb}!intelca!mipos3!kds
csnet/arpanet: kds@mipos3.intel.com

shap@sfsup.UUCP (J.S.Shapiro) (11/25/86)

> 
>    If you don't have per-segment page tables, then you don't have hardware
> support for copy-on-write of pages, only segments.  I consider this a
> pretty serious deficiency.
> 

Oh, crap. Read the manual before you betray your ignorance and save all of
us the trouble of correcting it. You can do write protection on a
page-by-page basis. Since all of the segments end up mapped into a flat
address space, you protect them/unprotect them at that level, including,
possibly, sharing a page between two segments.

The *pages* can be write protected.

dan@prairie.UUCP (Daniel M. Frank) (11/26/86)

   Yup, I was wrong about this.  I missed it because I was thinking in
terms of sharing the same portion of the virtual address space, instead
of sharing the same pages in the physical address space.  The way to
get page level copy-on-write in the 386 is:

	1) Map the new segment to another, unused portion of the virtual 
	   address space.

	2) Copy the page table entries from the old segment's part of the
	   page table into the new segment's part of the page table, and
	   mark all the new entries read-only.

	3) Whenever you get a fault, copy the old physical page into a
	   new one, and replace the page table entry with one for the
	   new page, and mark the page as writeable.

   This is less aesthetically pleasing than per-segment page tables, since 
you have to poke around a bit whenever you get a fault, to figure out
whose segment it's in, and why you got the fault.  It IS doable, though,
and I stand corrected.

   One more thing:  I don't think it's very appropriate to call people
stupid when they are wrong, as long as they are being reasonably polite
about it.


-- 
    Dan Frank
    uucp: ... uwvax!prairie!dan
    arpa: dan%caseus@spool.wisc.edu