Message ID | 20171219122050.GA19682@dhcp-13-42.nay.redhat.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
On Tue, 2017-12-19 at 20:20 +0800, Honggang LI wrote: > As ibsrpdm always only run once, because "config->once" has been > assigned to 1. I would suggest to apply this patch. > > diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c > index cec36db2..4012a7db 100644 > --- a/srp_daemon/srp_daemon.c > +++ b/srp_daemon/srp_daemon.c > @@ -1945,12 +1945,12 @@ static struct resources *alloc_res(void) > run_thread_get_trap_notices, &res->res); > if (ret) > goto err; > - } > > - ret = pthread_create(&res->res.async_ev_thread, NULL, > - run_thread_listen_to_events, &res->res); > - if (ret) > - goto err; > + ret = pthread_create(&res->res.async_ev_thread, NULL, > + run_thread_listen_to_events, &res->res); > + if (ret) > + goto err; > + } > > if (config->retry_timeout && !config->once) { > ret = pthread_create(&res->res.reconnect_thread, NULL, Please submit this as a proper patch and add the following: Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com> Thanks, Bart.
On Tue, Dec 19, 2017 at 04:57:35PM +0000, Bart Van Assche wrote: > On Tue, 2017-12-19 at 20:20 +0800, Honggang LI wrote: > > As ibsrpdm always only run once, because "config->once" has been > > assigned to 1. I would suggest to apply this patch. > > > > diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c > > index cec36db2..4012a7db 100644 > > --- a/srp_daemon/srp_daemon.c > > +++ b/srp_daemon/srp_daemon.c > > @@ -1945,12 +1945,12 @@ static struct resources *alloc_res(void) > > run_thread_get_trap_notices, &res->res); > > if (ret) > > goto err; > > - } > > > > - ret = pthread_create(&res->res.async_ev_thread, NULL, > > - run_thread_listen_to_events, &res->res); > > - if (ret) > > - goto err; > > + ret = pthread_create(&res->res.async_ev_thread, NULL, > > + run_thread_listen_to_events, &res->res); > > + if (ret) > > + goto err; > > + } > > > > if (config->retry_timeout && !config->once) { > > ret = pthread_create(&res->res.reconnect_thread, NULL, > > Please submit this as a proper patch and add the following: [rdma-core PATCH] srp_daemon: Don't create async_ev_thread if only run once I sent the patch with that $SUBJECT. thanks > Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com> > > Thanks, > > Bart. > -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, Dec 19, 2017 at 08:20:50PM +0800, Honggang LI wrote: > > Here is a sketch on how to fix it properly. All the users of > > pthread_kill should be eliminated. > > > > Though overall, there is really no reason to even cleanup the threads, > > just call exit? > > No, if one pthread just calls 'exit', the entire process will be > terminated immediately. So, we need to cleanup the threads. > > I think the source of current issue is the async_ev_thread pthread. > We should *NOT* create such pthread for ibsrpdm. > > I checked the old srptools git repo. FYI, this is merged into rdma-core, use git log -p --follow srp_daemon/srp_daemon.c and it will show you full history on a single file. > Commit ab57a5b92eb3b8c9221f77235a028814a462d2cb merges "ibsrpdm" into > "srp_daemon". The old ibsrpdm program is a single thread program. > srp_daemon is multi-thread program. Makes sense that ibsrpdm does not need the run_thread_listen_to_events() thread. Patch looks OK to me too. Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c index cec36db2..4012a7db 100644 --- a/srp_daemon/srp_daemon.c +++ b/srp_daemon/srp_daemon.c @@ -1945,12 +1945,12 @@ static struct resources *alloc_res(void) run_thread_get_trap_notices, &res->res); if (ret) goto err; - } - ret = pthread_create(&res->res.async_ev_thread, NULL, - run_thread_listen_to_events, &res->res); - if (ret) - goto err; + ret = pthread_create(&res->res.async_ev_thread, NULL, + run_thread_listen_to_events, &res->res); + if (ret) + goto err; + } if (config->retry_timeout && !config->once) { ret = pthread_create(&res->res.reconnect_thread, NULL,