Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Dec 2002 13:16:19 -0800 (PST)
From:      Nate Lawson <nate@root.org>
To:        Alan Cox <alc@FreeBSD.org>
Cc:        cvs-all@freebsd.org, cvs-committers@freebsd.org
Subject:   Re: cvs commit: src/sys/vm vm_map.c vm_map.h
Message-ID:  <Pine.BSF.4.21.0212311312480.90110-100000@root.org>
In-Reply-To: <20021231193809.7DD4037B437@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 31 Dec 2002, Alan Cox wrote:
>   Modified files:
>     sys/vm               vm_map.c vm_map.h 
>   Log:
>   Implement a variant locking scheme for vm maps: Access to system maps
>   is now synchronized by a mutex, whereas access to user maps is still
>   synchronized by a lockmgr()-based lock.  
>   
>   Revision  Changes    Path
>   1.278     +38 -16    src/sys/vm/vm_map.c
>   1.94      +1 -0      src/sys/vm/vm_map.h
> 
> +		_mtx_lock_flags(&map->system_mtx, 0, file, line);
> +	else {
> +		error = lockmgr(&map->lock, LK_EXCLUSIVE, NULL, curthread);
> +		KASSERT(error == 0, ("%s: failed to get lock", __func__));
> +	}
> [...]  
> -	lockmgr(&map->lock, LK_RELEASE, NULL, curthread);
> +	if (map->system_map)
> +		_mtx_unlock_flags(&map->system_mtx, 0, file, line);
> +	else
> +		lockmgr(&map->lock, LK_RELEASE, NULL, curthread);
>  }
>  
>  void

Please use the non-underscore, exported mtx_* routines.  The macros expand
to the same thing unless you're doing something strange w/ file and line
(but I don't see that in your patch).

-Nate



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0212311312480.90110-100000>