svn commit: r284211 - in head/sys: kern sys

John Baldwin jhb at FreeBSD.org
Sat Jun 20 13:21:37 UTC 2015


On 6/16/15 9:43 AM, Gleb Smirnoff wrote:
>   Mateusz,
> 
>   have you noticed this email?
> 
> On Wed, Jun 10, 2015 at 06:44:45PM +0300, Gleb Smirnoff wrote:
> T> On Wed, Jun 10, 2015 at 09:34:51AM +0000, Mateusz Guzik wrote:
> T> M> Author: mjg
> T> M> Date: Wed Jun 10 09:34:50 2015
> T> M> New Revision: 284211
> T> M> URL: https://svnweb.freebsd.org/changeset/base/284211
> T> M> 
> T> M> Log:
> T> M>   fd: use atomics to manage fd_refcnt and fd_holcnt
> T> M>   
> T> M>   This gets rid of fdesc_mtx.
> T> ..
> T> M> Modified: head/sys/sys/filedesc.h
> T> M> ==============================================================================
> T> M> --- head/sys/sys/filedesc.h	Wed Jun 10 05:39:48 2015	(r284210)
> T> M> +++ head/sys/sys/filedesc.h	Wed Jun 10 09:34:50 2015	(r284211)
> T> M> @@ -83,8 +83,8 @@ struct filedesc {
> T> M>  	int	fd_lastfile;		/* high-water mark of fd_ofiles */
> T> M>  	int	fd_freefile;		/* approx. next free file */
> T> M>  	u_short	fd_cmask;		/* mask for file creation */
> T> M> -	u_short	fd_refcnt;		/* thread reference count */
> T> M> -	u_short	fd_holdcnt;		/* hold count on structure + mutex */
> T> M> +	int	fd_refcnt;		/* thread reference count */
> T> M> +	int	fd_holdcnt;		/* hold count on structure + mutex */
> T> M>  	struct	sx fd_sx;		/* protects members of this struct */
> T> M>  	struct	kqlist fd_kqlist;	/* list of kqueues on this filedesc */
> T> M>  	int	fd_holdleaderscount;	/* block fdfree() for shared close() */
> T> 
> T> Shouldn't they be volatile u_int?
 
Agreed.

-- 
John Baldwin


More information about the svn-src-all mailing list