tech-kern archive

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

Re: AMAP_SHARED (was Re: XIP)



On Tue, Nov 02, 2010 at 06:31:05AM +0000, YAMAMOTO Takashi wrote:
> hi,
> 
> > A few more comments:
> > 
> > - AMAP_SHARED itself is a fine concept; it's used by shared memory.
> > 
> >     sys/kern/sysv_shm.c:
> >         452         error = uvm_map(&vm->vm_map, &attach_va, size, uobj, 0, 
> > 0,
> >         453             UVM_MAPFLAG(prot, prot, UVM_INH_SHARE, 
> > UVM_ADV_RANDOM, flags));
> > 
> >   (Note UVM_INH_SHARE == MAP_INHERIT_SHARE).
> 
> sysv shm is backed by an aobj and does not involve amap.

Hmm, you're right.

> 
> iirc, you need minherit to create shared-cow mappings.
> (imo, the introduction of minherit was a mistake because it
> merely complicated vm.)

Now I'm 100% fine to remove AMAP_SHARED functionality.  Even without
it, UVM is very good in avoiding unnecessary memory copy etc.

Masao

> 
> YAMAMOTO Takashi
> 
> > 
> >   I guess MAP_INHERIT_SHARE was added because adding it was easy
> >   after shared amap was implemented for shared memory?
> > 
> > - For highly tuned, XIP'ed systems, programs should be designed to
> >   avoid .data, because they're COW'ed to page cache sooner or later.


Home | Main Index | Thread Index | Old Index