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:	Mon, 25 Sep 2006 17:24:57 -0400
From:	"J. Bruce Fields" <bfields@...ldses.org>
To:	NeilBrown <neilb@...e.de>
Cc:	Andrew Morton <akpm@...l.org>, nfs@...ts.sourceforge.net,
	linux-kernel@...r.kernel.org
Subject: Re: [NFS] [PATCH 009 of 11] knfsd: Allow max size of NFSd payload to be configured.

On Thu, Aug 24, 2006 at 04:37:16PM +1000, NeilBrown wrote:
> diff .prev/fs/nfsd/nfssvc.c ./fs/nfsd/nfssvc.c
> --- .prev/fs/nfsd/nfssvc.c	2006-08-24 16:26:10.000000000 +1000
> +++ ./fs/nfsd/nfssvc.c	2006-08-24 16:26:10.000000000 +1000
> @@ -198,9 +198,26 @@ int nfsd_create_serv(void)
>  		unlock_kernel();
>  		return 0;
>  	}
> +	if (nfsd_max_blksize == 0) {
> +		/* choose a suitable default */
> +		struct sysinfo i;
> +		si_meminfo(&i);
> +		/* Aim for 1/4096 of memory per thread
> +		 * This gives 1MB on 4Gig machines
> +		 * But only uses 32K on 128M machines.
> +		 * Bottom out at 8K on 32M and smaller.
> +		 * Of course, this is only a default.
> +		 */
> +		nfsd_max_blksize = NFSSVC_MAXBLKSIZE;
> +		i.totalram >>= 12;
> +		while (nfsd_max_blksize > i.totalram &&
> +		       nfsd_max_blksize >= 8*1024*2)
> +			nfsd_max_blksize /= 2;
> +	}

It looks to me like totalram is actually measured in pages.  So in
practice this gives almost everyone 8k here.  So that 12 should be
something like 12 - PAGE_CACHE_SHIFT?

--b.
-
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