Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Apr 2004 23:31:02 -0500
From:      Alan Cox <alc@cs.rice.edu>
To:        Brian Fundakowski Feldman <green@FreeBSD.org>
Cc:        current@FreeBSD.org
Subject:   Re: VM wiring fixed
Message-ID:  <20040429043102.GN5199@cs.rice.edu>
In-Reply-To: <200404290305.i3T35CW6001661@green.homeunix.org>
References:  <20040429022401.GJ5199@cs.rice.edu> <200404290305.i3T35CW6001661@green.homeunix.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Apr 28, 2004 at 11:05:12PM -0400, Brian Fundakowski Feldman wrote:
> Alan Cox <alc@cs.rice.edu> wrote:
> > On Wed, Apr 28, 2004 at 08:08:17PM -0400, Brian Fundakowski Feldman wrote:
> > > There are several severe wiring bugs in -CURRENT that I believe I have fixed.
> > > Please test/review as appropriate if you're affected by any of them.  This 
> > > is a superset of the previous patch which just mostly-fixed mlockall(2).
> > > 
> > > * MAP_FUTUREWIRE was not unset in vmspace_dofree(), causing the next process 
> > >   to use that vmspace to wire all of its memory.
> > 
> > Would setting flags to 0 in vmspace_alloc() accomplish the same?
> 
> Yeah, same deal, except since we're optimizing by only clearing/
> reinitializing some fields for the vmspace-zone objects, it makes a little 
> more sense IMO to have it in the vmspace_dofree().
> 

To be honest, I would prefer to see this done by initializing flags to
zero in vmspace_alloc().  I don't see how setting a field to zero at
allocation time is less efficient than calling

static __inline void
vm_map_modflags(vm_map_t map, vm_flags_t set, vm_flags_t clear)
{
	map->flags = (map->flags | set) & ~clear;
}

at deallocation time.  In fact, I would expect initializing the field
to zero at initialization time to be faster.  It is also the more
conventional and conservative approach.  (For example, it would
protect us from a future change to UMA such that the pages used to
fill a zone are no longer prezeroed.)

I'll follow up on the other questions later.  I would encourage you to
go ahead and commit the fix to flags.

Regards,
Alan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040429043102.GN5199>