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

Gleb Smirnoff glebius at FreeBSD.org
Wed Jun 10 15:44:56 UTC 2015


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

Shouldn't they be volatile u_int?

-- 
Totus tuus, Glebius.


More information about the svn-src-all mailing list