[openib-general] Re: Re: madvise MADV_DONTFORK/MADV_DOFORK
Michael S. Tsirkin
mst at mellanox.co.il
Mon Mar 13 08:15:56 PST 2006
Quoting r. Gleb Natapov <glebn at voltaire.com>:
> Subject: Re: [openib-general] Re: Re: madvise MADV_DONTFORK/MADV_DOFORK
>
> On Mon, Mar 13, 2006 at 05:14:20PM +0200, Michael S. Tsirkin wrote:
> > > > My current thinking then goes vaguely along the lines of:
> > > >
> > > > We need a way to distinguish the parent from child on COW. A flag in the VMA
> > > > will do it.
> > > >
> > > And what if child forks ones more?
> >
> > If COW is already set, we don't set this new flag in VMA.
> > When the driver does get_user_pages with child's mm, this will break COW
> > so no problem.
> >
> So we should check each page in VMA for COW? Is it enough to check one
> page or should we check all of them? And what if VMA is a
> privately mapped file? I think COW will be set on mapped pages.
>
> I should think about this some more.
No, the flag is per-VMA, not per-page. get_user_pages already breaks COW,
we don't have to touch it at all.
--
Michael S. Tsirkin
Staff Engineer, Mellanox Technologies
More information about the general
mailing list