Re: [RFC 3/4] SUNRPC: Simplify client shutdown

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

 



On Wed, Nov 08 2017, Joshua Watt wrote:

> Use the flag to kill all new tasks when shutting down instead of
> repeatedly killing all the pending tasks.
>
> Signed-off-by: Joshua Watt <JPEWhacker@xxxxxxxxx>
> ---
>  net/sunrpc/clnt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
> index 70005252b32f..8d51e0788a63 100644
> --- a/net/sunrpc/clnt.c
> +++ b/net/sunrpc/clnt.c
> @@ -860,8 +860,8 @@ void rpc_shutdown_client(struct rpc_clnt *clnt)
>  			clnt->cl_program->name,
>  			rcu_dereference(clnt->cl_xprt)->servername);
>  
> +	rpc_killall_tasks(clnt, 1);
>  	while (!list_empty(&clnt->cl_tasks)) {
> -		rpc_killall_tasks(clnt, 0);
>  		wait_event_timeout(destroy_wait,
>  			list_empty(&clnt->cl_tasks), 1*HZ);
>  	}

The previously called rpc_killall_tasks every second.
Now that it doesn't do that, it doesn't do anything every second.
so:
     rpc_killall_tasks(clnt, 1);
     wait_event(destroy_wait, list_empty(&clnt->cl_tasks));

should be sufficient.

Thanks,
NeilBrown

Attachment: signature.asc
Description: PGP signature


[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