All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] NFSD: delay unmount source's export after inter-server copy completed.
@ 2021-04-23 20:59 Dai Ngo
  2021-04-23 20:59 ` [PATCH v4 1/2] " Dai Ngo
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Dai Ngo @ 2021-04-23 20:59 UTC (permalink / raw)
  To: olga.kornievskaia; +Cc: trondmy, bfields, chuck.lever, linux-nfs

Hi Olga,

Currently the source's export is mounted and unmounted on every
inter-server copy operation. This causes unnecessary overhead
for each copy.

This patch series is an enhancement to allow the export to remain
mounted for a configurable period (default to 15 minutes). If the 
export is not being used for the configured time it will be unmounted
by a delayed task. If it's used again then its expiration time is
extended for another period.

Since mount and unmount are no longer done on every copy request,
the restriction of copy size (14*rsize), in __nfs4_copy_file_range,
is removed.

-Dai

v2: fix compiler warning of missing prototype.
v3: remove the used of semaphore.
    eliminated all RPC calls for subsequence mount by allowing
       all exports from one server to share one vfsmount.
    make inter-server threshold a module configuration parameter.
v4: convert nsui_refcnt to use refcount_t.
    add note about 20secs wait in nfsd4_interssc_connect.
    removed (14*rsize) restriction from __nfs4_copy_file_range.




^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [PATCH v4 1/2] NFSD: delay unmount source's export after inter-server copy completed.
@ 2021-04-24  1:50 kernel test robot
  0 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2021-04-24  1:50 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 5265 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20210423205946.24407-2-dai.ngo@oracle.com>
References: <20210423205946.24407-2-dai.ngo@oracle.com>
TO: Dai Ngo <dai.ngo@oracle.com>
TO: olga.kornievskaia(a)gmail.com
CC: trondmy(a)hammerspace.com
CC: bfields(a)fieldses.org
CC: chuck.lever(a)oracle.com
CC: linux-nfs(a)vger.kernel.org

Hi Dai,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on nfs/linux-next]
[also build test WARNING on v5.12-rc8 next-20210423]
[cannot apply to nfsd/nfsd-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]

url:    https://github.com/0day-ci/linux/commits/Dai-Ngo/NFSD-delay-unmount-source-s-export-after-inter-server-copy-completed/20210424-050057
base:   git://git.linux-nfs.org/projects/trondmy/linux-nfs.git linux-next
:::::: branch date: 5 hours ago
:::::: commit date: 5 hours ago
config: powerpc-randconfig-c004-20210423 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>


cocci warnings: (new ones prefixed by >>)
>> fs/nfsd/nfs4proc.c:1473:32-34: ERROR: invalid reference to the index variable of the iterator on line 1450

vim +1473 fs/nfsd/nfs4proc.c

ce0887ac96d35c Olga Kornievskaia 2019-10-09  1433  
ce0887ac96d35c Olga Kornievskaia 2019-10-09  1434  static void
ce0887ac96d35c Olga Kornievskaia 2019-10-09  1435  nfsd4_cleanup_inter_ssc(struct vfsmount *ss_mnt, struct nfsd_file *src,
ce0887ac96d35c Olga Kornievskaia 2019-10-09  1436  			struct nfsd_file *dst)
ce0887ac96d35c Olga Kornievskaia 2019-10-09  1437  {
1a813b689731b1 Dai Ngo           2021-04-23  1438  	bool found = false;
1a813b689731b1 Dai Ngo           2021-04-23  1439  	bool resched = false;
1a813b689731b1 Dai Ngo           2021-04-23  1440  	long timeout;
1a813b689731b1 Dai Ngo           2021-04-23  1441  	struct nfsd4_ssc_umount_item *tmp;
1a813b689731b1 Dai Ngo           2021-04-23  1442  	struct nfsd4_ssc_umount_item *ni = 0;
1a813b689731b1 Dai Ngo           2021-04-23  1443  
ce0887ac96d35c Olga Kornievskaia 2019-10-09  1444  	nfs42_ssc_close(src->nf_file);
ce0887ac96d35c Olga Kornievskaia 2019-10-09  1445  	nfsd_file_put(dst);
1a813b689731b1 Dai Ngo           2021-04-23  1446  	fput(src->nf_file);
1a813b689731b1 Dai Ngo           2021-04-23  1447  
1a813b689731b1 Dai Ngo           2021-04-23  1448  	timeout = msecs_to_jiffies(nfsd4_ssc_umount_timeout);
1a813b689731b1 Dai Ngo           2021-04-23  1449  	spin_lock(&nfsd4_ssc_umount.nsu_lock);
1a813b689731b1 Dai Ngo           2021-04-23 @1450  	list_for_each_entry_safe(ni, tmp, &nfsd4_ssc_umount.nsu_list,
1a813b689731b1 Dai Ngo           2021-04-23  1451  		nsui_list) {
1a813b689731b1 Dai Ngo           2021-04-23  1452  		if (ni->nsui_vfsmount->mnt_sb == ss_mnt->mnt_sb) {
1a813b689731b1 Dai Ngo           2021-04-23  1453  			list_del(&ni->nsui_list);
1a813b689731b1 Dai Ngo           2021-04-23  1454  			/*
1a813b689731b1 Dai Ngo           2021-04-23  1455  			 * vfsmount can be shared by multiple exports,
1a813b689731b1 Dai Ngo           2021-04-23  1456  			 * decrement refcnt and schedule delayed task
1a813b689731b1 Dai Ngo           2021-04-23  1457  			 * if it drops to 0.
1a813b689731b1 Dai Ngo           2021-04-23  1458  			 */
1a813b689731b1 Dai Ngo           2021-04-23  1459  			if (refcount_dec_and_test(&ni->nsui_refcnt))
1a813b689731b1 Dai Ngo           2021-04-23  1460  				resched = true;
1a813b689731b1 Dai Ngo           2021-04-23  1461  			ni->nsui_expire = jiffies + timeout;
1a813b689731b1 Dai Ngo           2021-04-23  1462  			list_add_tail(&ni->nsui_list, &nfsd4_ssc_umount.nsu_list);
1a813b689731b1 Dai Ngo           2021-04-23  1463  			found = true;
1a813b689731b1 Dai Ngo           2021-04-23  1464  			break;
1a813b689731b1 Dai Ngo           2021-04-23  1465  		}
1a813b689731b1 Dai Ngo           2021-04-23  1466  	}
1a813b689731b1 Dai Ngo           2021-04-23  1467  	if (!found) {
1a813b689731b1 Dai Ngo           2021-04-23  1468  		spin_unlock(&nfsd4_ssc_umount.nsu_lock);
ce0887ac96d35c Olga Kornievskaia 2019-10-09  1469  		mntput(ss_mnt);
1a813b689731b1 Dai Ngo           2021-04-23  1470  		return;
1a813b689731b1 Dai Ngo           2021-04-23  1471  	}
1a813b689731b1 Dai Ngo           2021-04-23  1472  	if (resched && !nfsd4_ssc_umount.nsu_expire) {
1a813b689731b1 Dai Ngo           2021-04-23 @1473  		nfsd4_ssc_umount.nsu_expire = ni->nsui_expire;
1a813b689731b1 Dai Ngo           2021-04-23  1474  		schedule_delayed_work(&nfsd4_ssc_umount.nsu_umount_work,
1a813b689731b1 Dai Ngo           2021-04-23  1475  				timeout);
1a813b689731b1 Dai Ngo           2021-04-23  1476  	}
1a813b689731b1 Dai Ngo           2021-04-23  1477  	spin_unlock(&nfsd4_ssc_umount.nsu_lock);
ce0887ac96d35c Olga Kornievskaia 2019-10-09  1478  }
ce0887ac96d35c Olga Kornievskaia 2019-10-09  1479  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 29478 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-05-14 20:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-23 20:59 [PATCH v4 0/2] NFSD: delay unmount source's export after inter-server copy completed Dai Ngo
2021-04-23 20:59 ` [PATCH v4 1/2] " Dai Ngo
2021-05-14 18:12   ` Olga Kornievskaia
2021-05-14 18:42     ` J. Bruce Fields
2021-05-14 20:19       ` dai.ngo
2021-05-14 20:08     ` dai.ngo
2021-04-23 20:59 ` [PATCH v4 2/2] NFSv4.2: remove restriction of copy size for inter-server copy Dai Ngo
2021-05-03 16:37 ` [PATCH v4 0/2] NFSD: delay unmount source's export after inter-server copy completed dai.ngo
2021-05-12 16:53   ` dai.ngo
2021-04-24  1:50 [PATCH v4 1/2] " kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.