Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Apr 2007 03:51:10 -0400 (EDT)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Hans Petter Selasky <hselasky@c2i.net>
Cc:        freebsd-current@freebsd.org, performance@freebsd.org, current@freebsd.org, Andrzej Tobola <ato@iem.pw.edu.pl>
Subject:   Re: filedesc_sx patch (20070401a)
Message-ID:  <20070404034930.W25236@fledge.watson.org>
In-Reply-To: <200704040942.08839.hselasky@c2i.net>
References:  <20070401155910.O75869@fledge.watson.org> <20070403175953.A25236@fledge.watson.org> <200704040942.08839.hselasky@c2i.net>

next in thread | previous in thread | raw e-mail | index | archive | help

On Wed, 4 Apr 2007, Hans Petter Selasky wrote:

> Just a small comment:
>
> @@ -60,10 +60,7 @@
> 	u_short	fd_cmask;		/* mask for file creation */
> 	u_short	fd_refcnt;		/* thread reference count */
> 	u_short	fd_holdcnt;		/* hold count on structure + mutex */
> -
> -	struct	mtx fd_mtx;		/* protects members of this struct */
> -	int	fd_locked;		/* long lock flag */
> -	int	fd_wanted;		/* "" */
> +	struct	sx fd_sx;		/* protects members of this struct */
> 	struct	kqlist fd_kqlist;	/* list of kqueues on this filedesc */
> 	int	fd_holdleaderscount;	/* block fdfree() for shared close() */
> 	int	fd_holdleaderswakeup;	/* fdfree() needs wakeup */
>
> Maybe it is better if you order the elements by size. Then you don't waste 
> so many extra bytes on platforms where the fields must be aligned.

This seems reasonable; I'll merge the patch as-is first, minimizing the patch 
size of the change against filedesc.h, and then investigate what you suggest 
as a followup.  Thanks for the comment!  Generally speaking, we probably 
should be doing a structure size/layout review for things like in-memory 
inodes, vnodes, sockets, file descriptors, files, threads, etc, where small 
changes in memory overhead can make significant overall changes in memory use 
and cache efficiency.

Robert N M Watson
Computer Laboratory
University of Cambridge



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