Re: [PATCH 2/2] NFSD: limit the number of v4 clients to 4096 per 4GB of system memory

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

 



Hi Dai,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.19-rc6 next-20220714]
[cannot apply to cel-2.6/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Dai-Ngo/limit-the-number-of-v4-clients-to-4096-per-4GB-of-system-memory/20220713-041137
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 72a8e05d4f66b5af7854df4490e3135168694b6b
config: i386-randconfig-a015 (https://download.01.org/0day-ci/archive/20220715/202207150938.TXWZZpEX-lkp@xxxxxxxxx/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 5e61b9c556267086ef9b743a0b57df302eef831b)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/f4722e6591821876532c91087a3ac0e103e8d5d7
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Dai-Ngo/limit-the-number-of-v4-clients-to-4096-per-4GB-of-system-memory/20220713-041137
        git checkout f4722e6591821876532c91087a3ac0e103e8d5d7
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash fs/nfsd/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> fs/nfsd/nfsctl.c:1497:42: warning: shift count >= width of type [-Wshift-count-overflow]
           nn->nfs4_max_clients = (((lowmem * 100) >> 32) *
                                                   ^  ~~
   1 warning generated.


vim +1497 fs/nfsd/nfsctl.c

  1463	
  1464	static __net_init int nfsd_init_net(struct net *net)
  1465	{
  1466		int retval;
  1467		unsigned long lowmem;
  1468		struct sysinfo si;
  1469		struct nfsd_net *nn = net_generic(net, nfsd_net_id);
  1470	
  1471		retval = nfsd_export_init(net);
  1472		if (retval)
  1473			goto out_export_error;
  1474		retval = nfsd_idmap_init(net);
  1475		if (retval)
  1476			goto out_idmap_error;
  1477		nn->nfsd_versions = NULL;
  1478		nn->nfsd4_minorversions = NULL;
  1479		retval = nfsd_reply_cache_init(nn);
  1480		if (retval)
  1481			goto out_drc_error;
  1482		nn->nfsd4_lease = 90;	/* default lease time */
  1483		nn->nfsd4_grace = 90;
  1484		nn->somebody_reclaimed = false;
  1485		nn->track_reclaim_completes = false;
  1486		nn->clverifier_counter = prandom_u32();
  1487		nn->clientid_base = prandom_u32();
  1488		nn->clientid_counter = nn->clientid_base + 1;
  1489		nn->s2s_cp_cl_id = nn->clientid_counter++;
  1490	
  1491		get_random_bytes(&nn->siphash_key, sizeof(nn->siphash_key));
  1492		seqlock_init(&nn->writeverf_lock);
  1493	
  1494		atomic_set(&nn->nfs4_client_count, 0);
  1495		si_meminfo(&si);
  1496		lowmem = (si.totalram - si.totalhigh) * si.mem_unit;
> 1497		nn->nfs4_max_clients = (((lowmem * 100) >> 32) *
  1498					NFS4_MAX_CLIENTS_PER_4GB) / 100;
  1499	
  1500		return 0;
  1501	
  1502	out_drc_error:
  1503		nfsd_idmap_shutdown(net);
  1504	out_idmap_error:
  1505		nfsd_export_shutdown(net);
  1506	out_export_error:
  1507		return retval;
  1508	}
  1509	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux