Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trishali #23

Open
wants to merge 77 commits into
base: next
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
2442f77
cmake: move urcu library to main build
jtlayton Oct 18, 2018
ea57c9d
pthreads: have all thread functions register themselves with urcu
jtlayton Oct 18, 2018
ca74cde
svc_xprt_lookup - Add extra ref on create
dang Oct 19, 2018
78c409d
Merge pull request #155 from dang/push
dang Oct 25, 2018
bc28438
Fix addr size check in clnt_dg_control()
dang Oct 29, 2018
56ade49
Update timespec macros
Oct 19, 2018
c347df0
Merge pull request #158 from jzck/next
dang Nov 5, 2018
2936387
Merge pull request #156 from jtlayton/urcu
dang Nov 19, 2018
f7c4a3e
Merge pull request #157 from dang/push
dang Nov 19, 2018
b696fea
Force urcu-bp for now
jtlayton Dec 7, 2018
b154101
Merge pull request #159 from jtlayton/lttng
dang Dec 7, 2018
fe64a7b
Fix XPRT leak for TCP connections
dang Dec 19, 2018
2eda4a6
Make UDP XPRT refs match TCP
dang Dec 19, 2018
b86186c
Destroy XPRTs for local clients
dang Dec 20, 2018
e866504
Merge pull request #161 from dang/push
dang Jan 7, 2019
d16697b
Simplify epoll task processing
ffilz Oct 17, 2018
3c70a04
Flatten call stack a bit - replace request_cb with alloc_cb and free_cb
ffilz Oct 18, 2018
8069310
Add ability to suspend requests
ffilz Oct 22, 2018
929c9da
Merge pull request #162 from nfs-ganesha/async
mattbenjamin Jan 10, 2019
0104cd1
Convert unsafe strncpy to strlcpy
Jan 24, 2019
fddcb84
Merge pull request #164 from malahal/strlcpy
dang Jan 24, 2019
ec03704
Make a header for strl*()
dang Jan 31, 2019
57b2605
Merge pull request #165 from dang/push
dang Feb 1, 2019
f8b5fa5
Free 'ret' when returning NULL in __rpc_taddr2uaddr_af()
madhuthorat Mar 7, 2019
cb0cf40
Merge pull request #167 from madhuthorat/cid__rpc_taddr2uaddr_af
dang Mar 8, 2019
4d6067c
NSM - Don't force UDP portmapper lookups
dang Apr 1, 2019
52bb2d5
Merge pull request #169 from dang/push
dang Apr 1, 2019
1bfa572
Close fd if makefd_xprt fails.
Gaurav-Gangalwar Apr 23, 2019
bf703cc
Merge pull request #171 from Gaurav-Gangalwar/fd_leak
dang Apr 23, 2019
6bce534
Use "gss_get_mic" instead of "gss_sign"
Apr 24, 2019
31b3eb1
Fix memory leak for RPCSEC_GSS
Apr 24, 2019
95155fa
getclnthandle(): Fix assert(client == NULL) and destroy client handle.
madhuthorat Apr 26, 2019
8a9551d
Merge pull request #172 from madhuthorat/upclcrash01
dang Apr 29, 2019
1ae7f2f
Do not use macro "svcauth_gss_return"
Apr 25, 2019
60d3e97
Merge pull request #170 from sachinpunadikar/rpcgss
dang Apr 30, 2019
9ef94be
Mark ANYFD clients as local clients
dang Apr 30, 2019
daaece7
Indicate this is a dev version of ntirpc
dang Apr 30, 2019
4c0badc
Merge pull request #174 from dang/push2
dang Apr 30, 2019
7ddd7cd
Merge pull request #173 from dang/push
dang May 2, 2019
c1b95f7
Don't attempt to destroy XPRT if CLNT create was unsuccessful
madhuthorat May 17, 2019
35543fc
Merge pull request #177 from madhuthorat/clntdestroy_cxrec_invalid
dang May 17, 2019
6975220
gss_data - Don't unlock after free
dang May 17, 2019
0886fed
_svcauth_gss - Clean up gss_data handling
dang May 17, 2019
e60c16f
Merge pull request #178 from dang/push
dang May 24, 2019
0d41ced
SVC - Don't double release xprt on write error
dang May 28, 2019
1be7b31
Merge pull request #179 from dang/push
dang May 30, 2019
3b7415c
1.8.0
dang May 30, 2019
dbfec91
In _svcauth_gss() in case of failure set 'req->rq_auth' to NULL
madhuthorat Jul 8, 2019
0277e75
Merge pull request #181 from madhuthorat/gssauthfail
dang Jul 11, 2019
1cab741
xdr_ioq.c: fix xdr_ioq_setpos to deal with partially full buffers
ffilz Mar 28, 2019
6a45a1c
Add XDR functions to support gss iov functions
ffilz May 10, 2019
9704d8b
Replace ioq_ifqh with poolq_head in each rpc_dplx_rec
ffilz Aug 6, 2019
c2d4cd9
Remove obsolete svc_rqst_run_task
ffilz Aug 8, 2019
1dd5a36
Implement nonblocking send - convert from writev to sendmsg
ffilz Aug 6, 2019
ef6acb2
Modify gss wrap and unwrap to work with iov functions
ffilz May 10, 2019
941e93a
Make xdr_ioq_putbufs usable for sending large buffers
ffilz Aug 9, 2019
f9a86ce
Merge pull request #182 from nfs-ganesha/nonblock
dang Sep 11, 2019
c53407e
Remove error messages from several xdr functions
ffilz Sep 27, 2019
b125750
Merge pull request #184 from nfs-ganesha/noerr
dang Oct 8, 2019
f1c0cc0
LTTNG - fix xprt destroy trace to trace flags
dang Oct 10, 2019
ec67d93
IOQ - Fix svc_ioq_flush return value to be consistent
dang Oct 10, 2019
fbc1751
Fix xprt refcounting for non-blocking write
dang Oct 10, 2019
83a3150
Remove release from svc_request()
dang Oct 10, 2019
7283a99
Merge pull request #185 from dang/xprtref
dang Oct 10, 2019
2b3ede1
SVC IOQ - correctly dequeue the xioq
Oct 23, 2019
dd7f90b
Add some debug to show type of gss service
ffilz Oct 29, 2019
dd10d11
Rework xdr_iov and gss_iov so VIO_TRAILER_LEN is an explicit buffer
ffilz Oct 29, 2019
9765afe
XDR IOQ - Update position to end of XDR
dang Oct 21, 2019
aa8e629
Merge pull request #188 from nfs-ganesha/k5
dang Oct 30, 2019
6c45a60
Merge pull request #187 from yangruifeng/wip-yrf-svc-ioq-1023
dang Oct 30, 2019
0695d2e
Oops - need to SETPOS just to totlen
ffilz Oct 30, 2019
0e3139e
Merge pull request #189 from nfs-ganesha/k5-2
dang Oct 31, 2019
e1bdb9c
3.0-rc1
dang Oct 31, 2019
745e0fa
Merge pull request #190 from dang/push
dang Oct 31, 2019
785a6ef
3.0-rc2
dang Oct 31, 2019
1da6533
3.0
dang Nov 6, 2019
acccf7a
Return error code for an invalid RPCSEC_GSS message
ntrishal Nov 13, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Simplify epoll task processing
Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
ffilz committed Jan 8, 2019
commit d16697b4d1da8a9216f5a955005b7cd1ac28a913
100 changes: 57 additions & 43 deletions src/svc_rqst.c
Original file line number Diff line number Diff line change
@@ -195,6 +195,8 @@ svc_rqst_lookup_chan(uint32_t chan_id)

/* forward declaration in lieu of moving code {WAS} */
static void svc_rqst_run_task(struct work_pool_entry *);
static void svc_rqst_epoll_loop(struct work_pool_entry *wpe);
static void svc_complete_task(struct svc_rqst_rec *sr_rec, bool finished);

static int
svc_rqst_expire_cmpf(const struct opr_rbtree_node *lhs,
@@ -287,6 +289,7 @@ svc_rqst_new_evchan(uint32_t *chan_id /* OUT */, void *u_data, uint32_t flags)
struct svc_rqst_rec *sr_rec;
uint32_t n_id;
int code = 0;
work_pool_fun_t fun = svc_rqst_run_task;

mutex_lock(&svc_rqst_set.mtx);
if (!svc_rqst_set.next_id) {
@@ -326,6 +329,7 @@ svc_rqst_new_evchan(uint32_t *chan_id /* OUT */, void *u_data, uint32_t flags)
#if defined(TIRPC_EPOLL)
if (flags & SVC_RQST_FLAG_EPOLL) {
sr_rec->ev_type = SVC_EVENT_EPOLL;
fun = svc_rqst_epoll_loop;

/* XXX improve this too */
sr_rec->ev_u.epoll.max_events =
@@ -381,7 +385,7 @@ svc_rqst_new_evchan(uint32_t *chan_id /* OUT */, void *u_data, uint32_t flags)

if (!code) {
atomic_inc_int32_t(&sr_rec->ev_refcnt);
sr_rec->ev_wpe.fun = svc_rqst_run_task;
sr_rec->ev_wpe.fun = fun;
sr_rec->ev_wpe.arg = u_data;
work_pool_submit(&svc_work_pool, &sr_rec->ev_wpe);
}
@@ -904,7 +908,7 @@ svc_rqst_epoll_event(struct svc_rqst_rec *sr_rec, struct epoll_event *ev)
/*
* not locked
*/
static inline bool
static inline struct rpc_dplx_rec *
svc_rqst_epoll_events(struct svc_rqst_rec *sr_rec, int n_events)
{
struct rpc_dplx_rec *rec = NULL;
@@ -919,7 +923,7 @@ svc_rqst_epoll_events(struct svc_rqst_rec *sr_rec, int n_events)

if (!rec) {
/* continue waiting for events with this task */
return false;
return NULL;
}

while (ix < n_events) {
@@ -936,28 +940,20 @@ svc_rqst_epoll_events(struct svc_rqst_rec *sr_rec, int n_events)
atomic_inc_int32_t(&sr_rec->ev_refcnt);
work_pool_submit(&svc_work_pool, &sr_rec->ev_wpe);

/* in most cases have only one event, use this hot thread */
rec->ioq.ioq_wpe.fun = svc_rqst_xprt_task;
svc_rqst_xprt_task(&(rec->ioq.ioq_wpe));

/* failsafe idle processing after work task */
if (atomic_postclear_uint32_t_bits(&wakeups, ~SVC_RQST_WAKEUPS)
> SVC_RQST_WAKEUPS) {
svc_rqst_clean_idle(__svc_params->idle_timeout);
}

return true;
return rec;
}

static inline bool
svc_rqst_epoll_loop(struct svc_rqst_rec *sr_rec)
static void svc_rqst_epoll_loop(struct work_pool_entry *wpe)
{
struct svc_rqst_rec *sr_rec =
opr_containerof(wpe, struct svc_rqst_rec, ev_wpe);
struct clnt_req *cc;
struct opr_rbtree_node *n;
struct timespec ts;
int timeout_ms;
int expire_ms;
int n_events;
bool finished;

for (;;) {
timeout_ms = SVC_RQST_TIMEOUT_MS;
@@ -1006,13 +1002,30 @@ svc_rqst_epoll_loop(struct svc_rqst_rec *sr_rec)
__func__,
sr_rec->ev_u.epoll.epoll_fd,
n_events);
return true;
finished = true;
break;
}
if (n_events > 0) {
atomic_add_uint32_t(&wakeups, n_events);

if (svc_rqst_epoll_events(sr_rec, n_events))
return false;
struct rpc_dplx_rec *rec;

rec = svc_rqst_epoll_events(sr_rec, n_events);

if (rec != NULL) {
/* use this hot thread for the first event */
rec->ioq.ioq_wpe.fun = svc_rqst_xprt_task;
svc_rqst_xprt_task(&(rec->ioq.ioq_wpe));

/* failsafe idle processing after work task */
if (atomic_postclear_uint32_t_bits(
&wakeups, ~SVC_RQST_WAKEUPS)
> SVC_RQST_WAKEUPS) {
svc_rqst_clean_idle(
__svc_params->idle_timeout);
}
finished = false;
break;
}
continue;
}
if (!n_events) {
@@ -1027,12 +1040,34 @@ svc_rqst_epoll_loop(struct svc_rqst_rec *sr_rec)
__func__,
sr_rec->ev_u.epoll.epoll_fd,
n_events);
return true;
finished = true;
break;
}
}
if (finished) {
close(sr_rec->ev_u.epoll.epoll_fd);
mem_free(sr_rec->ev_u.epoll.events,
sr_rec->ev_u.epoll.max_events *
sizeof(struct epoll_event));
}

svc_complete_task(sr_rec, finished);
}
#endif

static void svc_complete_task(struct svc_rqst_rec *sr_rec, bool finished)
{
if (finished) {
/* reference count here should be 2:
* 1 svc_rqst_set
* +1 this work_pool thread
* so, DROP one here so the final release will go to 0.
*/
atomic_dec_int32_t(&sr_rec->ev_refcnt); /* svc_rqst_set */
}
svc_rqst_release(sr_rec);
}

/*
* No locking, "there can be only one"
*/
@@ -1041,23 +1076,10 @@ svc_rqst_run_task(struct work_pool_entry *wpe)
{
struct svc_rqst_rec *sr_rec =
opr_containerof(wpe, struct svc_rqst_rec, ev_wpe);
bool finished;

/* enter event loop */
switch (sr_rec->ev_type) {
#if defined(TIRPC_EPOLL)
case SVC_EVENT_EPOLL:
finished = svc_rqst_epoll_loop(sr_rec);
if (finished) {
close(sr_rec->ev_u.epoll.epoll_fd);
mem_free(sr_rec->ev_u.epoll.events,
sr_rec->ev_u.epoll.max_events *
sizeof(struct epoll_event));
}
break;
#endif
default:
finished = true;
/* XXX formerly select/fd_set case, now placeholder for new
* event systems, reworked select, etc. */
__warnx(TIRPC_DEBUG_FLAG_ERROR,
@@ -1066,15 +1088,7 @@ svc_rqst_run_task(struct work_pool_entry *wpe)
break;
} /* switch */

if (finished) {
/* reference count here should be 2:
* 1 svc_rqst_set
* +1 this work_pool thread
* so, DROP one here so the final release will go to 0.
*/
atomic_dec_int32_t(&sr_rec->ev_refcnt); /* svc_rqst_set */
}
svc_rqst_release(sr_rec);
svc_complete_task(sr_rec, true);
}

int