Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

NFSv4: Avoid unnecessary scans of filesystems for returning delegations

The amount of looping through the list of delegations is occasionally
leading to soft lockups. If the state manager was asked to return
delegations asynchronously, it should only scan those filesystems that
hold delegations that need to be returned.

Fixes: af3b61bf6131 ("NFSv4: Clean up nfs_client_return_marked_delegations()")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>

+7
+5
fs/nfs/delegation.c
··· 79 79 struct nfs_delegation *delegation) 80 80 { 81 81 set_bit(NFS_DELEGATION_RETURN, &delegation->flags); 82 + set_bit(NFS4SERV_DELEGRETURN, &server->delegation_flags); 82 83 set_bit(NFS4CLNT_DELEGRETURN, &server->nfs_client->cl_state); 83 84 } 84 85 ··· 609 608 struct nfs_delegation *place_holder_deleg = NULL; 610 609 int err = 0; 611 610 611 + if (!test_and_clear_bit(NFS4SERV_DELEGRETURN, 612 + &server->delegation_flags)) 613 + return 0; 612 614 restart: 613 615 /* 614 616 * To avoid quadratic looping we hold a reference ··· 663 659 cond_resched(); 664 660 if (!err) 665 661 goto restart; 662 + set_bit(NFS4SERV_DELEGRETURN, &server->delegation_flags); 666 663 set_bit(NFS4CLNT_DELEGRETURN, &server->nfs_client->cl_state); 667 664 goto out; 668 665 }
+2
include/linux/nfs_fs_sb.h
··· 250 250 struct list_head ss_copies; 251 251 struct list_head ss_src_copies; 252 252 253 + unsigned long delegation_flags; 254 + #define NFS4SERV_DELEGRETURN (1) 253 255 unsigned long delegation_gen; 254 256 unsigned long mig_gen; 255 257 unsigned long mig_status;