Re: revised two-level bitmap fdalloc diff

YAMAMOTO Takashi <[email protected]>
Newsgroups gmane.os.netbsd.devel.performance
Message-ID <[email protected]>
> +	/*
> +	 * These arrays are used when the number of open files is
> +	 * <= 1024, and are then pointed to by the pointers above.
> +	 */
> +	uint32_t	fd_dhimap[NDENTRIES >> NDENTRYSHIFT];
> +	uint32_t	fd_dlomap[NDENTRIES];

if it's your intent,
fdexpand() shouldn't do malloc() unless nfiles > 1024 and
tests in fdcopy() and fdfree() are wrong.

also, rather than abusing NDENTRIES here,
i think code like followings are more clear.

#define	NDFILE_BITMAP	1024
	uint32_t	fd_dhimap[NDHISLOTS(NDFILE_BITMAP)];
	uint32_t	fd_dlomap[NDLOSLOTS(NDFILE_BITMAP)];

YAMAMOTO Takashi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.