History

SUNRPC: Fix up backchannel slot table accounting

Add a per-transport maximum limit in the socket case, and add helpers to allow the NFSv4 code to discover that limit.

Trond Myklebust committed 7 years ago

Commit 7402a4f1 parent 9f98eff11 files · +55 −21Browse files

Showing the changes to include/linux (3 of 11 files). Show all

Unified · Split

3 files
  1. include/linux/sunrpc/bc_xprt.h +1 −0
  2. include/linux/sunrpc/clnt.h +1 −0
  3. include/linux/sunrpc/xprt.h +4 −2
include/linux/sunrpc/bc_xprt.h+1−0
@@ -43,6 +43,7 @@ void xprt_destroy_backchannel(struct rpc_xprt *, unsigned int max_reqs); · 42 unmodified lines
4343 int xprt_setup_bc(struct rpc_xprt *xprt, unsigned int min_reqs);
4444 void xprt_destroy_bc(struct rpc_xprt *xprt, unsigned int max_reqs);
4545 void xprt_free_bc_rqst(struct rpc_rqst *req);
46+unsigned int xprt_bc_max_slots(struct rpc_xprt *xprt);
4647
4748 /*
4849 * Determine if a shared backchannel is in use
include/linux/sunrpc/clnt.h+1−0
@@ -194,6 +194,7 @@ void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); · 193 unmodified lines
194194 struct net * rpc_net_ns(struct rpc_clnt *);
195195 size_t rpc_max_payload(struct rpc_clnt *);
196196 size_t rpc_max_bc_payload(struct rpc_clnt *);
197+unsigned int rpc_num_bc_slots(struct rpc_clnt *);
197198 void rpc_force_rebind(struct rpc_clnt *);
198199 size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t);
199200 const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t);
include/linux/sunrpc/xprt.h+4−2
@@ -158,6 +158,7 @@ struct rpc_xprt_ops { · 157 unmodified lines
158158 int (*bc_setup)(struct rpc_xprt *xprt,
159159 unsigned int min_reqs);
160160 size_t (*bc_maxpayload)(struct rpc_xprt *xprt);
161+ unsigned int (*bc_num_slots)(struct rpc_xprt *xprt);
161162 void (*bc_free_rqst)(struct rpc_rqst *rqst);
162163 void (*bc_destroy)(struct rpc_xprt *xprt,
163164 unsigned int max_reqs);
@@ -251,8 +252,9 @@ struct rpc_xprt { · 87 unmodified lines
251252 #if defined(CONFIG_SUNRPC_BACKCHANNEL)
252253 struct svc_serv *bc_serv; /* The RPC service which will */
253254 /* process the callback */
254− int bc_alloc_count; /* Total number of preallocs */
255− atomic_t bc_free_slots;
255+ unsigned int bc_alloc_max;
256+ unsigned int bc_alloc_count; /* Total number of preallocs */
257+ atomic_t bc_slot_count; /* Number of allocated slots */
256258 spinlock_t bc_pa_lock; /* Protects the preallocated
257259 * items */
258260 struct list_head bc_pa_list; /* List of preallocated

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t