Re: [NFS] [PATCH 009 of 11] knfsd: Allow max size of NFSd payload to be configured.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux