lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 10 Oct 2006 19:12:56 +0200
From:	Eric Dumazet <dada1@...mosbay.com>
To:	Vadim Lobanov <vlobanov@...akeasy.net>
Cc:	akpm@...l.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/5] fdtable: Make fdarray and fdsets equal in size.

On Friday 06 October 2006 06:51, Vadim Lobanov wrote:

> -	nfds = max_t(int, 8 * L1_CACHE_BYTES, roundup_pow_of_two(nr + 1));
> -	if (nfds > NR_OPEN)
> -		nfds = NR_OPEN;
> -
> -  	new_openset = alloc_fdset(nfds);
> -  	new_execset = alloc_fdset(nfds);
> -  	if (!new_openset || !new_execset)
> -  		goto out;
> -	fdt->open_fds = new_openset;
> -	fdt->close_on_exec = new_execset;
> -	fdt->max_fdset = nfds;
> -
>  	nfds = NR_OPEN_DEFAULT;
>  	/*
>  	 * Expand to the max in easy steps, and keep expanding it until
> @@ -271,15 +254,21 @@ static struct fdtable *alloc_fdtable(int
>  				nfds = NR_OPEN;
>    		}
>  	} while (nfds <= nr);

If I understand well, we may allocate very small fdset, while previous minimum 
size was L1_CACHE_BYTES bytes. (512 bits for a 64 bytes cache line)

If you check commit 0c9e63fd38a2fb2181668a0cdd622a3c23cfd567, 
(http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0c9e63fd38a2fb2181668a0cdd622a3c23cfd567 ) 
you'll find this comment of mine :

3) Reduce size of allocated fdset.  Currently two full pages are
   allocated, that is 32768 bits on x86 for example, and way too much.  The
   minimum is now L1_CACHE_BYTES.

This minimum is mandatory to be sure two tasks wont share the same cache line 
to store their fdset (and possibly do lot of cache line ping pongs)

Eric

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ