* [PATCH v3 0/4] ibacm: acmp retry issues
@ 2017-11-14 16:43 Michael J. Ruhl
[not found] ` <20171114164006.24557.72093.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
0 siblings, 1 reply; 11+ messages in thread
From: Michael J. Ruhl @ 2017-11-14 16:43 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
While testing the retry mechanism for the acmp provider, I observed
that the retry event_wait() did not appear to be working correctly.
After studying the issue a bit more, I discovered that there were a
couple of issues.
This patch set addresses those issues.
v2 - added patch for MONOTONIC time base
v3 - Updated and cleaned various type cast issues
---
Michael J. Ruhl (4):
ibacm: Fix an incorrect expiration check for the retry timer
ibacm: Calculate correct tv_nsec value in event_wait()
ibacm: Fix a retry loop calculation race condition
ibacm: Use MONOTONIC time base to avoid timer expiration issues
ibacm/linux/osd.h | 25 ++++++++++++++++---------
ibacm/prov/acmp/src/acmp.c | 12 +++++++-----
2 files changed, 23 insertions(+), 14 deletions(-)
--
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 11+ messages in thread[parent not found: <20171114164006.24557.72093.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>]
* [PATCH v3 1/4] ibacm: Fix an incorrect expiration check for the retry timer [not found] ` <20171114164006.24557.72093.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org> @ 2017-11-14 16:43 ` Michael J. Ruhl 2017-11-14 16:43 ` [PATCH v3 2/4] ibacm: Calculate correct tv_nsec value in event_wait() Michael J. Ruhl ` (3 subsequent siblings) 4 siblings, 0 replies; 11+ messages in thread From: Michael J. Ruhl @ 2017-11-14 16:43 UTC (permalink / raw) To: linux-rdma-u79uwXL29TY76Z2rM5mHXA From: Michael J. Ruhl <michael.j.ruhl-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> The acmp_process_wait_queue() checks to see if a message expiration time has passed. Because the check is for less than (<), if the timeout expires matches the current time, the check will result in a timeout value of 0, and the wait loop will spin until the next millisecond has passed. Using example values to demonstrate the issue, we can see: With '<': wait = -2106577636 (no work) wait = 2510 (message wait) (process spins) wait = 0 (expires - current time == 0) wait = 0 wait = 0 ... (1 ms of output) wait = 0 wait = -2106580147 (retry complete) wait = 2512 With '<=': wait = -2106688780 (no work) wait = 2512 ( message wait) (process sleeps) wait = -2106691293 (retry complete) wait = 2512 Expire the message if the expires is less than or equal. Reviewed-by: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Reviewed-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Signed-off-by: Michael J. Ruhl <michael.j.ruhl-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> --- ibacm/prov/acmp/src/acmp.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ibacm/prov/acmp/src/acmp.c b/ibacm/prov/acmp/src/acmp.c index 78d9a29..d707b8e 100644 --- a/ibacm/prov/acmp/src/acmp.c +++ b/ibacm/prov/acmp/src/acmp.c @@ -1507,7 +1507,7 @@ static void acmp_process_wait_queue(struct acmp_ep *ep, uint64_t *next_expire) struct ibv_send_wr *bad_wr; list_for_each_safe(&ep->wait_queue, msg, next, entry) { - if (msg->expires < time_stamp_ms()) { + if (msg->expires <= time_stamp_ms()) { list_del(&msg->entry); (void) atomic_dec(&wait_cnt); if (--msg->tries) { -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 2/4] ibacm: Calculate correct tv_nsec value in event_wait() [not found] ` <20171114164006.24557.72093.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org> 2017-11-14 16:43 ` [PATCH v3 1/4] ibacm: Fix an incorrect expiration check for the retry timer Michael J. Ruhl @ 2017-11-14 16:43 ` Michael J. Ruhl 2017-11-14 16:43 ` [PATCH v3 3/4] ibacm: Fix a retry loop calculation race condition Michael J. Ruhl ` (2 subsequent siblings) 4 siblings, 0 replies; 11+ messages in thread From: Michael J. Ruhl @ 2017-11-14 16:43 UTC (permalink / raw) To: linux-rdma-u79uwXL29TY76Z2rM5mHXA From: Michael J. Ruhl <michael.j.ruhl-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> The event_wait() function calculates a tv_nsec value based on the given timeout. If the tv_nsec value calculation ends ups larger than 1 second, the pthread_cond_timedwait() will return EINVAL, and will not wait. This causes the retry loop to spin (busy wait) until the actual timeout occurs. Ensure that the tv_nsec value is less than 1 second. Reviewed-by: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Reviewed-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Signed-off-by: Michael J. Ruhl <michael.j.ruhl-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> --- ibacm/linux/osd.h | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/ibacm/linux/osd.h b/ibacm/linux/osd.h index 95713e6..eabf5ed 100644 --- a/ibacm/linux/osd.h +++ b/ibacm/linux/osd.h @@ -92,6 +92,7 @@ static inline void event_init(event_t *e) pthread_mutex_init(&e->mutex, NULL); } #define event_signal(e) pthread_cond_signal(&(e)->cond) +#define ONE_SEC_IN_NSEC 1000000000ULL static inline int event_wait(event_t *e, int timeout) { struct timeval curtime; @@ -101,6 +102,10 @@ static inline int event_wait(event_t *e, int timeout) gettimeofday(&curtime, NULL); wait.tv_sec = curtime.tv_sec + ((unsigned) timeout) / 1000; wait.tv_nsec = (curtime.tv_usec + (((unsigned) timeout) % 1000) * 1000) * 1000; + if (wait.tv_nsec > ONE_SEC_IN_NSEC) { + wait.tv_sec++; + wait.tv_nsec -= ONE_SEC_IN_NSEC; + } pthread_mutex_lock(&e->mutex); ret = pthread_cond_timedwait(&e->cond, &e->mutex, &wait); pthread_mutex_unlock(&e->mutex); -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 3/4] ibacm: Fix a retry loop calculation race condition [not found] ` <20171114164006.24557.72093.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org> 2017-11-14 16:43 ` [PATCH v3 1/4] ibacm: Fix an incorrect expiration check for the retry timer Michael J. Ruhl 2017-11-14 16:43 ` [PATCH v3 2/4] ibacm: Calculate correct tv_nsec value in event_wait() Michael J. Ruhl @ 2017-11-14 16:43 ` Michael J. Ruhl [not found] ` <20171114164337.24557.45231.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org> 2017-11-14 16:44 ` [PATCH v3 4/4] ibacm: Use MONOTONIC time base to avoid timer expiration issues Michael J. Ruhl 2017-11-14 18:46 ` [PATCH v3 0/4] ibacm: acmp retry issues Leon Romanovsky 4 siblings, 1 reply; 11+ messages in thread From: Michael J. Ruhl @ 2017-11-14 16:43 UTC (permalink / raw) To: linux-rdma-u79uwXL29TY76Z2rM5mHXA From: Michael J. Ruhl <michael.j.ruhl-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> The retry loop calculation uses a conversion to int of an unsigned 64 bit number (next_expire) minus the current time to decide if event_wait() should be called. This calculation works correctly as long as the next_expire value is not the default value (-1). If the next_expire is the default value, periodically this subtraction can result in a very large postive timeout value (days rather than milliseconds). For example: next_expire = 0xFFFFFFFFFFFFFFFF (-1) current_ms = 0x15f7db52146 (today's ms since 1970) max_delay_ms = (int) next_expire - future_ms future_ms = 0x15f80000000 = max_delay_ms 2147483647 future_ms = 0x16080000000 = max_delay_ms 2147483647 Converting max_delay_ms to days: 2147483647 / 1000 / 60 / 60 / 24 == 24 days 0xxx180000000 - 0xxx080000000 = 4294967296 every 48 days, this issue repeats This calculation can occur if a wait_cnt is incremented and a message expiration is handled so that next_expire is not updated. If wait_cnt is incremented before the wait calculation is done (the race condition), event_wait() can be called with the potentially very large value. If next_expire is not updated, do not do the wait calculation and avoid the race condition. Reported-by: Morys Grzegorz <grzegorz.morys-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Reviewed-by: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Reviewed-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Signed-off-by: Michael J. Ruhl <michael.j.ruhl-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> --- ibacm/prov/acmp/src/acmp.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ibacm/prov/acmp/src/acmp.c b/ibacm/prov/acmp/src/acmp.c index d707b8e..884fc48 100644 --- a/ibacm/prov/acmp/src/acmp.c +++ b/ibacm/prov/acmp/src/acmp.c @@ -1579,10 +1579,12 @@ static void *acmp_retry_handler(void *context) pthread_mutex_unlock(&acmp_dev_lock); acmp_process_timeouts(); - wait = (int) (next_expire - time_stamp_ms()); - if (wait > 0 && atomic_get(&wait_cnt)) { - pthread_testcancel(); - event_wait(&timeout_event, wait); + if (next_expire != -1) { + wait = (int) (next_expire - time_stamp_ms()); + if (wait > 0 && atomic_get(&wait_cnt)) { + pthread_testcancel(); + event_wait(&timeout_event, wait); + } } } -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 11+ messages in thread
[parent not found: <20171114164337.24557.45231.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>]
* Re: [PATCH v3 3/4] ibacm: Fix a retry loop calculation race condition [not found] ` <20171114164337.24557.45231.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org> @ 2017-11-14 23:55 ` Jason Gunthorpe [not found] ` <20171114235522.GE25894-uk2M96/98Pc@public.gmane.org> 0 siblings, 1 reply; 11+ messages in thread From: Jason Gunthorpe @ 2017-11-14 23:55 UTC (permalink / raw) To: Michael J. Ruhl; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA On Tue, Nov 14, 2017 at 11:43:47AM -0500, Michael J. Ruhl wrote: > diff --git a/ibacm/prov/acmp/src/acmp.c b/ibacm/prov/acmp/src/acmp.c > index d707b8e..884fc48 100644 > +++ b/ibacm/prov/acmp/src/acmp.c > @@ -1579,10 +1579,12 @@ static void *acmp_retry_handler(void *context) > pthread_mutex_unlock(&acmp_dev_lock); > > acmp_process_timeouts(); > - wait = (int) (next_expire - time_stamp_ms()); > - if (wait > 0 && atomic_get(&wait_cnt)) { > - pthread_testcancel(); > - event_wait(&timeout_event, wait); > + if (next_expire != -1) { > + wait = (int) (next_expire - time_stamp_ms()); This (int) cast is also wrong.. If you want to do signed subtraction then you need to cast the arguments to '-' not the result, and since time_stamp_ms() is u64, casting it to int will truncate. wait needs to be int64_t, next_expire should be int64_t and then no casts are needed. All of time_stamp_* should return int64_t And the #define time_stamp_* should not be macros, but inline functions returning int64_t to make the return type guarenteed and clear. This isn't really related to this series, but if you send a followup patch it would be nice since it has been now been noticed :) Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <20171114235522.GE25894-uk2M96/98Pc@public.gmane.org>]
* RE: [PATCH v3 3/4] ibacm: Fix a retry loop calculation race condition [not found] ` <20171114235522.GE25894-uk2M96/98Pc@public.gmane.org> @ 2017-11-15 19:20 ` Ruhl, Michael J 0 siblings, 0 replies; 11+ messages in thread From: Ruhl, Michael J @ 2017-11-15 19:20 UTC (permalink / raw) To: Jason Gunthorpe; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > -----Original Message----- > From: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org [mailto:linux-rdma- > owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org] On Behalf Of Jason Gunthorpe > Sent: Tuesday, November 14, 2017 6:55 PM > To: Ruhl, Michael J <michael.j.ruhl-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > Subject: Re: [PATCH v3 3/4] ibacm: Fix a retry loop calculation race condition > > On Tue, Nov 14, 2017 at 11:43:47AM -0500, Michael J. Ruhl wrote: > > > diff --git a/ibacm/prov/acmp/src/acmp.c b/ibacm/prov/acmp/src/acmp.c > > index d707b8e..884fc48 100644 > > +++ b/ibacm/prov/acmp/src/acmp.c > > @@ -1579,10 +1579,12 @@ static void *acmp_retry_handler(void *context) > > pthread_mutex_unlock(&acmp_dev_lock); > > > > acmp_process_timeouts(); > > - wait = (int) (next_expire - time_stamp_ms()); > > - if (wait > 0 && atomic_get(&wait_cnt)) { > > - pthread_testcancel(); > > - event_wait(&timeout_event, wait); > > + if (next_expire != -1) { > > + wait = (int) (next_expire - time_stamp_ms()); > > This (int) cast is also wrong.. > > If you want to do signed subtraction then you need to cast the > arguments to '-' not the result, and since time_stamp_ms() is u64, > casting it to int will truncate. > > wait needs to be int64_t, next_expire should be int64_t and then no > casts are needed. Hmm, I think that the truncate is what is happening when delay issue (caused by the race condition) occurs. I need to explore this some more, your suggested change my obviate the issue. > All of time_stamp_* should return int64_t > > And the #define time_stamp_* should not be macros, but inline > functions returning int64_t to make the return type guarenteed and > clear. > > This isn't really related to this series, but if you send a followup > patch it would be nice since it has been now been noticed :) I will do this in a follow on patch, but need more time to test so it will not be in this series. Thanks for the comments! Mike > Jason > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v3 4/4] ibacm: Use MONOTONIC time base to avoid timer expiration issues [not found] ` <20171114164006.24557.72093.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org> ` (2 preceding siblings ...) 2017-11-14 16:43 ` [PATCH v3 3/4] ibacm: Fix a retry loop calculation race condition Michael J. Ruhl @ 2017-11-14 16:44 ` Michael J. Ruhl [not found] ` <20171114164352.24557.86825.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org> 2017-11-14 18:46 ` [PATCH v3 0/4] ibacm: acmp retry issues Leon Romanovsky 4 siblings, 1 reply; 11+ messages in thread From: Michael J. Ruhl @ 2017-11-14 16:44 UTC (permalink / raw) To: linux-rdma-u79uwXL29TY76Z2rM5mHXA From: Michael J. Ruhl <michael.j.ruhl-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> The event_wait() function uses the CLOCK_REALTIME time base for calculating expiration times (default time base for gettimeofday()). Using the CLOCK_REALTIME time base can introduce incorrect expiration timeout calculations if the REALTIME clock changes, making a timeout too long (possibly hours or days), or too short. Update time base usage to the CLOCK_MONOTONIC time base to avoid time change issues. Reviewed-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Reviewed-by: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Signed-off-by: Michael J. Ruhl <michael.j.ruhl-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> --- ibacm/linux/osd.h | 20 +++++++++++--------- 1 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ibacm/linux/osd.h b/ibacm/linux/osd.h index eabf5ed..1617176 100644 --- a/ibacm/linux/osd.h +++ b/ibacm/linux/osd.h @@ -88,20 +88,23 @@ typedef struct { volatile int val; } atomic_t; typedef struct { pthread_cond_t cond; pthread_mutex_t mutex; } event_t; static inline void event_init(event_t *e) { - pthread_cond_init(&e->cond, NULL); + pthread_condattr_t attr; + + pthread_condattr_init(&attr); + pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); + pthread_cond_init(&e->cond, &attr); pthread_mutex_init(&e->mutex, NULL); } #define event_signal(e) pthread_cond_signal(&(e)->cond) #define ONE_SEC_IN_NSEC 1000000000ULL static inline int event_wait(event_t *e, int timeout) { - struct timeval curtime; struct timespec wait; int ret; - gettimeofday(&curtime, NULL); - wait.tv_sec = curtime.tv_sec + ((unsigned) timeout) / 1000; - wait.tv_nsec = (curtime.tv_usec + (((unsigned) timeout) % 1000) * 1000) * 1000; + clock_gettime(CLOCK_MONOTONIC, &wait); + wait.tv_sec = wait.tv_sec + ((unsigned int) timeout) / 1000; + wait.tv_nsec = (wait.tv_nsec + (((unsigned int) timeout) % 1000) * 1000000); if (wait.tv_nsec > ONE_SEC_IN_NSEC) { wait.tv_sec++; wait.tv_nsec -= ONE_SEC_IN_NSEC; @@ -114,10 +117,9 @@ static inline int event_wait(event_t *e, int timeout) static inline uint64_t time_stamp_us(void) { - struct timeval curtime; - timerclear(&curtime); - gettimeofday(&curtime, NULL); - return (uint64_t) curtime.tv_sec * 1000000 + (uint64_t) curtime.tv_usec; + struct timespec t; + clock_gettime(CLOCK_MONOTONIC, &t); + return (t.tv_sec * ONE_SEC_IN_NSEC + t.tv_nsec) / 1000; } #define time_stamp_ms() (time_stamp_us() / (uint64_t) 1000) -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 11+ messages in thread
[parent not found: <20171114164352.24557.86825.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>]
* Re: [PATCH v3 4/4] ibacm: Use MONOTONIC time base to avoid timer expiration issues [not found] ` <20171114164352.24557.86825.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org> @ 2017-11-14 23:56 ` Jason Gunthorpe 0 siblings, 0 replies; 11+ messages in thread From: Jason Gunthorpe @ 2017-11-14 23:56 UTC (permalink / raw) To: Michael J. Ruhl; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA On Tue, Nov 14, 2017 at 11:44:17AM -0500, Michael J. Ruhl wrote: > static inline int event_wait(event_t *e, int timeout) > { > - struct timeval curtime; > struct timespec wait; > int ret; > > - gettimeofday(&curtime, NULL); > - wait.tv_sec = curtime.tv_sec + ((unsigned) timeout) / 1000; > - wait.tv_nsec = (curtime.tv_usec + (((unsigned) timeout) % 1000) * 1000) * 1000; > + clock_gettime(CLOCK_MONOTONIC, &wait); > + wait.tv_sec = wait.tv_sec + ((unsigned int) timeout) / 1000; > + wait.tv_nsec = (wait.tv_nsec + (((unsigned int) timeout) % 1000) * 1000000); since timeout must be positive just declare it as 'unsigned int' in the function signature and all the ugly casts go away and the function argument range is now documented.. Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 0/4] ibacm: acmp retry issues [not found] ` <20171114164006.24557.72093.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org> ` (3 preceding siblings ...) 2017-11-14 16:44 ` [PATCH v3 4/4] ibacm: Use MONOTONIC time base to avoid timer expiration issues Michael J. Ruhl @ 2017-11-14 18:46 ` Leon Romanovsky [not found] ` <20171114184603.GG18825-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org> 4 siblings, 1 reply; 11+ messages in thread From: Leon Romanovsky @ 2017-11-14 18:46 UTC (permalink / raw) To: Michael J. Ruhl; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA [-- Attachment #1: Type: text/plain, Size: 1374 bytes --] On Tue, Nov 14, 2017 at 11:43:00AM -0500, Michael J. Ruhl wrote: > While testing the retry mechanism for the acmp provider, I observed > that the retry event_wait() did not appear to be working correctly. > After studying the issue a bit more, I discovered that there were a > couple of issues. > > This patch set addresses those issues. > > v2 - added patch for MONOTONIC time base > v3 - Updated and cleaned various type cast issues > > --- > > Michael J. Ruhl (4): > ibacm: Fix an incorrect expiration check for the retry timer > ibacm: Calculate correct tv_nsec value in event_wait() > ibacm: Fix a retry loop calculation race condition > ibacm: Use MONOTONIC time base to avoid timer expiration issues > > > ibacm/linux/osd.h | 25 ++++++++++++++++--------- > ibacm/prov/acmp/src/acmp.c | 12 +++++++----- > 2 files changed, 23 insertions(+), 14 deletions(-) > Can you please use [PATCH rdma-core ..] format for rdma-core patches? We are using patchworks to handle queue and it is so handy to filter patches in such way: https://patchwork.kernel.org/project/linux-rdma/list/?q=rdma-core Thanks > -- > > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <20171114184603.GG18825-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>]
* RE: [PATCH v3 0/4] ibacm: acmp retry issues [not found] ` <20171114184603.GG18825-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org> @ 2017-11-14 19:10 ` Ruhl, Michael J [not found] ` <14063C7AD467DE4B82DEDB5C278E86639F0C279D-AtyAts71sc88Ug9VwtkbtrfspsVTdybXVpNB7YpNyf8@public.gmane.org> 0 siblings, 1 reply; 11+ messages in thread From: Ruhl, Michael J @ 2017-11-14 19:10 UTC (permalink / raw) To: Leon Romanovsky; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > -----Original Message----- > From: Leon Romanovsky [mailto:leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org] > Sent: Tuesday, November 14, 2017 1:46 PM > To: Ruhl, Michael J <michael.j.ruhl-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > Subject: Re: [PATCH v3 0/4] ibacm: acmp retry issues > > On Tue, Nov 14, 2017 at 11:43:00AM -0500, Michael J. Ruhl wrote: > > While testing the retry mechanism for the acmp provider, I observed > > that the retry event_wait() did not appear to be working correctly. > > After studying the issue a bit more, I discovered that there were a > > couple of issues. > > > > This patch set addresses those issues. > > > > v2 - added patch for MONOTONIC time base > > v3 - Updated and cleaned various type cast issues > > > > --- > > > > Michael J. Ruhl (4): > > ibacm: Fix an incorrect expiration check for the retry timer > > ibacm: Calculate correct tv_nsec value in event_wait() > > ibacm: Fix a retry loop calculation race condition > > ibacm: Use MONOTONIC time base to avoid timer expiration issues > > > > > > ibacm/linux/osd.h | 25 ++++++++++++++++--------- > > ibacm/prov/acmp/src/acmp.c | 12 +++++++----- > > 2 files changed, 23 insertions(+), 14 deletions(-) > > > > Can you please use [PATCH rdma-core ..] format for rdma-core patches? Hi Leon, Yes, I will reformat. Is there a place to put patch set version information? i.e [PATCH rdma-core v4, x/y]? (should I just drop it for this patch set?) Thanks, Mike > We are using patchworks to handle queue and it is so handy to filter > patches in such way: > https://patchwork.kernel.org/project/linux-rdma/list/?q=rdma-core > > Thanks > > > -- > > > > -- > > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <14063C7AD467DE4B82DEDB5C278E86639F0C279D-AtyAts71sc88Ug9VwtkbtrfspsVTdybXVpNB7YpNyf8@public.gmane.org>]
* Re: [PATCH v3 0/4] ibacm: acmp retry issues [not found] ` <14063C7AD467DE4B82DEDB5C278E86639F0C279D-AtyAts71sc88Ug9VwtkbtrfspsVTdybXVpNB7YpNyf8@public.gmane.org> @ 2017-11-14 19:40 ` Leon Romanovsky 0 siblings, 0 replies; 11+ messages in thread From: Leon Romanovsky @ 2017-11-14 19:40 UTC (permalink / raw) To: Ruhl, Michael J; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org [-- Attachment #1: Type: text/plain, Size: 2278 bytes --] On Tue, Nov 14, 2017 at 07:10:45PM +0000, Ruhl, Michael J wrote: > > > > -----Original Message----- > > From: Leon Romanovsky [mailto:leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org] > > Sent: Tuesday, November 14, 2017 1:46 PM > > To: Ruhl, Michael J <michael.j.ruhl-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > > Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > > Subject: Re: [PATCH v3 0/4] ibacm: acmp retry issues > > > > On Tue, Nov 14, 2017 at 11:43:00AM -0500, Michael J. Ruhl wrote: > > > While testing the retry mechanism for the acmp provider, I observed > > > that the retry event_wait() did not appear to be working correctly. > > > After studying the issue a bit more, I discovered that there were a > > > couple of issues. > > > > > > This patch set addresses those issues. > > > > > > v2 - added patch for MONOTONIC time base > > > v3 - Updated and cleaned various type cast issues > > > > > > --- > > > > > > Michael J. Ruhl (4): > > > ibacm: Fix an incorrect expiration check for the retry timer > > > ibacm: Calculate correct tv_nsec value in event_wait() > > > ibacm: Fix a retry loop calculation race condition > > > ibacm: Use MONOTONIC time base to avoid timer expiration issues > > > > > > > > > ibacm/linux/osd.h | 25 ++++++++++++++++--------- > > > ibacm/prov/acmp/src/acmp.c | 12 +++++++----- > > > 2 files changed, 23 insertions(+), 14 deletions(-) > > > > > > > Can you please use [PATCH rdma-core ..] format for rdma-core patches? > > Hi Leon, > > Yes, I will reformat. > > Is there a place to put patch set version information? i.e [PATCH rdma-core v4, x/y]? (should I just drop it for this patch set?) 1. There is no need to resubmit this series. 2. I'm looking for "rdma-core", anything else (versions and locations) is up to you. > > Thanks, > > Mike > > > We are using patchworks to handle queue and it is so handy to filter > > patches in such way: > > https://patchwork.kernel.org/project/linux-rdma/list/?q=rdma-core > > > > Thanks > > > > > -- > > > > > > -- > > > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > > > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > > > More majordomo info at http://vger.kernel.org/majordomo-info.html [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2017-11-15 19:20 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-14 16:43 [PATCH v3 0/4] ibacm: acmp retry issues Michael J. Ruhl
[not found] ` <20171114164006.24557.72093.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2017-11-14 16:43 ` [PATCH v3 1/4] ibacm: Fix an incorrect expiration check for the retry timer Michael J. Ruhl
2017-11-14 16:43 ` [PATCH v3 2/4] ibacm: Calculate correct tv_nsec value in event_wait() Michael J. Ruhl
2017-11-14 16:43 ` [PATCH v3 3/4] ibacm: Fix a retry loop calculation race condition Michael J. Ruhl
[not found] ` <20171114164337.24557.45231.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2017-11-14 23:55 ` Jason Gunthorpe
[not found] ` <20171114235522.GE25894-uk2M96/98Pc@public.gmane.org>
2017-11-15 19:20 ` Ruhl, Michael J
2017-11-14 16:44 ` [PATCH v3 4/4] ibacm: Use MONOTONIC time base to avoid timer expiration issues Michael J. Ruhl
[not found] ` <20171114164352.24557.86825.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2017-11-14 23:56 ` Jason Gunthorpe
2017-11-14 18:46 ` [PATCH v3 0/4] ibacm: acmp retry issues Leon Romanovsky
[not found] ` <20171114184603.GG18825-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-11-14 19:10 ` Ruhl, Michael J
[not found] ` <14063C7AD467DE4B82DEDB5C278E86639F0C279D-AtyAts71sc88Ug9VwtkbtrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-11-14 19:40 ` Leon Romanovsky
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox