All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] Fix deadlock when running run_iter_bw_infinitely
@ 2015-11-18 12:27 Hans Westgaard Ry
       [not found] ` <1447849673-30034-1-git-send-email-hans.westgaard.ry-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Hans Westgaard Ry @ 2015-11-18 12:27 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Gil Rockah, Hans Westgaard Ry

The test uses a signal-handler to periodically print a line of report.
Snip libc info:
<quote>
24.4.6 Signal Handling and Nonreentrant Functions
Handler functions usually don't do very much.  The best practice is to
write a handler that does nothing but set an external variable that the
program checks regularly, and leave all serious work to the program.
</quote>
The current codebase violates the above and is deadlock prone.
The mutexes taken by the printf functions called from the signal handler
might be held by activity conducted by the main thread.

This commit fixes this by setting a flag in the signal handler and handle the
printout in the mainloop of the test.

Signed-off-by: Hans Westgaard Ry <hans.westgaard.ry-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Reviewed-by: Håkon Bugge <haakon.bugge-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Reviewed-by: Knut Omang <knut.omang-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
---
 src/perftest_resources.c | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/src/perftest_resources.c b/src/perftest_resources.c
index cb915e0..4d8e6c0 100755
--- a/src/perftest_resources.c
+++ b/src/perftest_resources.c
@@ -25,6 +25,12 @@ static enum ibv_wr_opcode opcode_atomic_array[] = {IBV_WR_ATOMIC_CMP_AND_SWP,IBV
 
 struct perftest_parameters* duration_param;
 struct check_alive_data check_alive_data;
+/*
+ * Flag to trig call to print_report_bw
+ * The flag is set in signal_handler and tested/reset in run_iter_bw_infinitely
+ */
+static volatile int trig_print_report_bw = 0;
+
 
 /******************************************************************************
  * Beginning
@@ -3214,7 +3220,15 @@ int run_iter_bw_infinitely(struct pingpong_context *ctx,struct perftest_paramete
 
 	/* main loop for posting */
 	while (1) {
-
+		if (trig_print_report_bw) {
+			duration_param->tcompleted[0] = get_cycles();
+			print_report_bw(duration_param,NULL);
+			duration_param->iters = 0;
+			alarm(duration_param->duration);
+			duration_param->tposted[0] = get_cycles();
+			trig_print_report_bw = 0;
+		}
+		
 		/* main loop to run over all the qps and post each time n messages */
 		for (index =0 ; index < num_of_qps ; index++) {
 
@@ -4213,11 +4227,7 @@ void check_alive(int sig)
  ******************************************************************************/
 void catch_alarm_infintely(int sig)
 {
-	duration_param->tcompleted[0] = get_cycles();
-	print_report_bw(duration_param,NULL);
-	duration_param->iters = 0;
-	alarm(duration_param->duration);
-	duration_param->tposted[0] = get_cycles();
+	trig_print_report_bw = 1;
 }
 
 /******************************************************************************
-- 
2.4.3

--
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] 8+ messages in thread

* Ping: [PATCH 1/1] Fix deadlock when running run_iter_bw_infinitely
       [not found] ` <1447849673-30034-1-git-send-email-hans.westgaard.ry-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
@ 2015-12-09  8:33   ` Hans Westgaard Ry
       [not found]     ` <5667E747.2070006-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Hans Westgaard Ry @ 2015-12-09  8:33 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Gil Rockah

Any comments on this patch ?



On 11/18/2015 01:27 PM, Hans Westgaard Ry wrote:
> The test uses a signal-handler to periodically print a line of report.
> Snip libc info:
> <quote>
> 24.4.6 Signal Handling and Nonreentrant Functions
> Handler functions usually don't do very much.  The best practice is to
> write a handler that does nothing but set an external variable that the
> program checks regularly, and leave all serious work to the program.
> </quote>
> The current codebase violates the above and is deadlock prone.
> The mutexes taken by the printf functions called from the signal handler
> might be held by activity conducted by the main thread.
>
> This commit fixes this by setting a flag in the signal handler and handle the
> printout in the mainloop of the test.
>
> Signed-off-by: Hans Westgaard Ry <hans.westgaard.ry-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> Reviewed-by: Håkon Bugge <haakon.bugge-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> Reviewed-by: Knut Omang <knut.omang-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> ---
>   src/perftest_resources.c | 22 ++++++++++++++++------
>   1 file changed, 16 insertions(+), 6 deletions(-)
>
> diff --git a/src/perftest_resources.c b/src/perftest_resources.c
> index cb915e0..4d8e6c0 100755
> --- a/src/perftest_resources.c
> +++ b/src/perftest_resources.c
> @@ -25,6 +25,12 @@ static enum ibv_wr_opcode opcode_atomic_array[] =IBV_WR_ATOMIC_CMP_AND_SWP,IBV
>   
>   struct perftest_parameters* duration_param;
>   struct check_alive_data check_alive_data;
> +/*
> + * Flag to trig call to print_report_bw
> + * The flag is set in signal_handler and tested/reset in run_iter_bw_infinitely
> + */
> +static volatile int trig_print_report_bw =;
> +
>   
>   /******************************************************************************
>    * Beginning
> @@ -3214,7 +3220,15 @@ int run_iter_bw_infinitely(struct pingpong_context *ctx,struct perftest_paramete
>   
>   	/* main loop for posting */
>   	while (1) {
> -
> +		if (trig_print_report_bw) {
> +			duration_param->tcompleted[0] =et_cycles();
> +			print_report_bw(duration_param,NULL);
> +			duration_param->iters =;
> +			alarm(duration_param->duration);
> +			duration_param->tposted[0] =et_cycles();
> +			trig_print_report_bw =;
> +		}
> +		
>   		/* main loop to run over all the qps and post each time n messages */
>   		for (index =; index < num_of_qps ; index++) {
>   
> @@ -4213,11 +4227,7 @@ void check_alive(int sig)
>    ******************************************************************************/
>   void catch_alarm_infintely(int sig)
>   {
> -	duration_param->tcompleted[0] =et_cycles();
> -	print_report_bw(duration_param,NULL);
> -	duration_param->iters =;
> -	alarm(duration_param->duration);
> -	duration_param->tposted[0] =et_cycles();
> +	trig_print_report_bw =;
>   }
>   
>   /******************************************************************************

--
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] 8+ messages in thread

* Re: Ping: [PATCH 1/1] Fix deadlock when running run_iter_bw_infinitely
       [not found]     ` <5667E747.2070006-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
@ 2015-12-09  8:52       ` Leon Romanovsky
       [not found]         ` <20151209085245.GA8662-2ukJVAZIZ/Y@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Leon Romanovsky @ 2015-12-09  8:52 UTC (permalink / raw)
  To: Hans Westgaard Ry; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Gil Rockah

On Wed, Dec 09, 2015 at 09:33:11AM +0100, Hans Westgaard Ry wrote:
> Any comments on this patch ?
> 
> 
> 
> On 11/18/2015 01:27 PM, Hans Westgaard Ry wrote:
> >The test uses a signal-handler to periodically print a line of report.
> >+		if (trig_print_report_bw) {
> >+			duration_param->tcompleted[0] =et_cycles();
> >+			print_report_bw(duration_param,NULL);
> >+			duration_param->iters =;
Excuse me, what did you mean by the line above?

> >+			alarm(duration_param->duration);
> >+			duration_param->tposted[0] =et_cycles();
> >+			trig_print_report_bw =;
And this line too.

--
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] 8+ messages in thread

* Re: Ping: [PATCH 1/1] Fix deadlock when running run_iter_bw_infinitely
       [not found]         ` <20151209085245.GA8662-2ukJVAZIZ/Y@public.gmane.org>
@ 2015-12-09  9:11           ` Hans Westgaard Ry
       [not found]             ` <5667F05B.8010200-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Hans Westgaard Ry @ 2015-12-09  9:11 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Gil Rockah

Sorry but I didn't see that "something" gobbled part of the mail.
The correct lines are  (as in the original):

src/perftest_resources.c | 22 ++++++++++++++++------
  1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/src/perftest_resources.c b/src/perftest_resources.c
index cb915e0..4d8e6c0 100755
--- a/src/perftest_resources.c
+++ b/src/perftest_resources.c
@@ -25,6 +25,12 @@ static enum ibv_wr_opcode opcode_atomic_array[] = {IBV_WR_ATOMIC_CMP_AND_SWP,IBV
  
  struct perftest_parameters* duration_param;
  struct check_alive_data check_alive_data;
+/*
+ * Flag to trig call to print_report_bw
+ * The flag is set in signal_handler and tested/reset in run_iter_bw_infinitely
+ */
+static volatile int trig_print_report_bw = 0;
+
  
  /******************************************************************************
   * Beginning
@@ -3214,7 +3220,15 @@ int run_iter_bw_infinitely(struct pingpong_context *ctx,struct perftest_paramete
  
  	/* main loop for posting */
  	while (1) {
-
+		if (trig_print_report_bw) {
+			duration_param->tcompleted[0] = get_cycles();
+			print_report_bw(duration_param,NULL);
+			duration_param->iters = 0;
+			alarm(duration_param->duration);
+			duration_param->tposted[0] = get_cycles();
+			trig_print_report_bw = 0;
+		}
+		
  		/* main loop to run over all the qps and post each time n messages */
  		for (index =0 ; index < num_of_qps ; index++) {
  
@@ -4213,11 +4227,7 @@ void check_alive(int sig)
   ******************************************************************************/
  void catch_alarm_infintely(int sig)
  {
-	duration_param->tcompleted[0] = get_cycles();
-	print_report_bw(duration_param,NULL);
-	duration_param->iters = 0;
-	alarm(duration_param->duration);
-	duration_param->tposted[0] = get_cycles();
+	trig_print_report_bw = 1;
  }



On 12/09/2015 09:52 AM, Leon Romanovsky wrote:
> On Wed, Dec 09, 2015 at 09:33:11AM +0100, Hans Westgaard Ry wrote:
>> Any comments on this patch ?
>>
>>
>>
>> On 11/18/2015 01:27 PM, Hans Westgaard Ry wrote:
>>> The test uses a signal-handler to periodically print a line of report.
>>> +		if (trig_print_report_bw) {
>>> +			duration_param->tcompleted[0] =et_cycles();
>>> +			print_report_bw(duration_param,NULL);
>>> +			duration_param->iters =;
> Excuse me, what did you mean by the line above?
>
>>> +			alarm(duration_param->duration);
>>> +			duration_param->tposted[0] =et_cycles();
>>> +			trig_print_report_bw =;
> And this line too.
>

--
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] 8+ messages in thread

* Re: Ping: [PATCH 1/1] Fix deadlock when running run_iter_bw_infinitely
       [not found]             ` <5667F05B.8010200-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
@ 2015-12-09  9:30               ` Leon Romanovsky
       [not found]                 ` <20151209093023.GB8662-2ukJVAZIZ/Y@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Leon Romanovsky @ 2015-12-09  9:30 UTC (permalink / raw)
  To: Hans Westgaard Ry; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Gil Rockah

On Wed, Dec 09, 2015 at 10:11:55AM +0100, Hans Westgaard Ry wrote:
> Sorry but I didn't see that "something" gobbled part of the mail.
> The correct lines are  (as in the original):
> 
> src/perftest_resources.c | 22 ++++++++++++++++------
>  1 file changed, 16 insertions(+), 6 deletions(-)
> 
> diff --git a/src/perftest_resources.c b/src/perftest_resources.c
> index cb915e0..4d8e6c0 100755
> --- a/src/perftest_resources.c
> +++ b/src/perftest_resources.c
> @@ -25,6 +25,12 @@ static enum ibv_wr_opcode opcode_atomic_array[] = {IBV_WR_ATOMIC_CMP_AND_SWP,IBV
>  struct perftest_parameters* duration_param;
>  struct check_alive_data check_alive_data;
> +/*
> + * Flag to trig call to print_report_bw
> + * The flag is set in signal_handler and tested/reset in run_iter_bw_infinitely
> + */
> +static volatile int trig_print_report_bw = 0;
> +
>  /******************************************************************************
>   * Beginning
> @@ -3214,7 +3220,15 @@ int run_iter_bw_infinitely(struct pingpong_context *ctx,struct perftest_paramete
>  	/* main loop for posting */
>  	while (1) {
> -
> +		if (trig_print_report_bw) {
> +			duration_param->tcompleted[0] = get_cycles();
> +			print_report_bw(duration_param,NULL);
> +			duration_param->iters = 0;
> +			alarm(duration_param->duration);
> +			duration_param->tposted[0] = get_cycles();
> +			trig_print_report_bw = 0;
> +		}
> +		
>  		/* main loop to run over all the qps and post each time n messages */
>  		for (index =0 ; index < num_of_qps ; index++) {
> @@ -4213,11 +4227,7 @@ void check_alive(int sig)
>   ******************************************************************************/
>  void catch_alarm_infintely(int sig)
>  {
> -	duration_param->tcompleted[0] = get_cycles();
> -	print_report_bw(duration_param,NULL);
> -	duration_param->iters = 0;
> -	alarm(duration_param->duration);
> -	duration_param->tposted[0] = get_cycles();
> +	trig_print_report_bw = 1;
>  }
Thanks, it looks good,
Reviewed-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

> 
> 
> 
> On 12/09/2015 09:52 AM, Leon Romanovsky wrote:
> >On Wed, Dec 09, 2015 at 09:33:11AM +0100, Hans Westgaard Ry wrote:
> >>Any comments on this patch ?
> >>
> >>
> >>
> >>On 11/18/2015 01:27 PM, Hans Westgaard Ry wrote:
> >>>The test uses a signal-handler to periodically print a line of report.
> >>>+		if (trig_print_report_bw) {
> >>>+			duration_param->tcompleted[0] =et_cycles();
> >>>+			print_report_bw(duration_param,NULL);
> >>>+			duration_param->iters =;
> >Excuse me, what did you mean by the line above?
> >
> >>>+			alarm(duration_param->duration);
> >>>+			duration_param->tposted[0] =et_cycles();
> >>>+			trig_print_report_bw =;
> >And this line too.
> >
> 
> --
> 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] 8+ messages in thread

* Re: Ping: [PATCH 1/1] Fix deadlock when running run_iter_bw_infinitely
       [not found]                 ` <20151209093023.GB8662-2ukJVAZIZ/Y@public.gmane.org>
@ 2016-01-08  7:36                   ` Hans Westgaard Ry
       [not found]                     ` <568F66F8.9080407-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
  2016-01-21 13:58                   ` Hans Westgaard Ry
  1 sibling, 1 reply; 8+ messages in thread
From: Hans Westgaard Ry @ 2016-01-08  7:36 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Gil Rockah

Hi,
I cloned  git://git.openfabrics.org/~grockah/perftest.git today and found
quite a few new commits but not this patch.

Am I looking in the wrong repository or are there problems with this patch ?

Hans

On 12/09/2015 10:30 AM, Leon Romanovsky wrote:
> On Wed, Dec 09, 2015 at 10:11:55AM +0100, Hans Westgaard Ry wrote:
>> Sorry but I didn't see that "something" gobbled part of the mail.
>> The correct lines are  (as in the original):
>>
>> src/perftest_resources.c | 22 ++++++++++++++++------
>>   1 file changed, 16 insertions(+), 6 deletions(-)
>>
>> diff --git a/src/perftest_resources.c b/src/perftest_resources.c
>> index cb915e0..4d8e6c0 100755
>> --- a/src/perftest_resources.c
>> +++ b/src/perftest_resources.c
>> @@ -25,6 +25,12 @@ static enum ibv_wr_opcode opcode_atomic_array[] = {IBV_WR_ATOMIC_CMP_AND_SWP,IBV
>>   struct perftest_parameters* duration_param;
>>   struct check_alive_data check_alive_data;
>> +/*
>> + * Flag to trig call to print_report_bw
>> + * The flag is set in signal_handler and tested/reset in run_iter_bw_infinitely
>> + */
>> +static volatile int trig_print_report_bw = 0;
>> +
>>   /******************************************************************************
>>    * Beginning
>> @@ -3214,7 +3220,15 @@ int run_iter_bw_infinitely(struct pingpong_context *ctx,struct perftest_paramete
>>   	/* main loop for posting */
>>   	while (1) {
>> -
>> +		if (trig_print_report_bw) {
>> +			duration_param->tcompleted[0] = get_cycles();
>> +			print_report_bw(duration_param,NULL);
>> +			duration_param->iters = 0;
>> +			alarm(duration_param->duration);
>> +			duration_param->tposted[0] = get_cycles();
>> +			trig_print_report_bw = 0;
>> +		}
>> +		
>>   		/* main loop to run over all the qps and post each time n messages */
>>   		for (index =0 ; index < num_of_qps ; index++) {
>> @@ -4213,11 +4227,7 @@ void check_alive(int sig)
>>    ******************************************************************************/
>>   void catch_alarm_infintely(int sig)
>>   {
>> -	duration_param->tcompleted[0] = get_cycles();
>> -	print_report_bw(duration_param,NULL);
>> -	duration_param->iters = 0;
>> -	alarm(duration_param->duration);
>> -	duration_param->tposted[0] = get_cycles();
>> +	trig_print_report_bw = 1;
>>   }
> Thanks, it looks good,
> Reviewed-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>
>>
>>
>> On 12/09/2015 09:52 AM, Leon Romanovsky wrote:
>>> On Wed, Dec 09, 2015 at 09:33:11AM +0100, Hans Westgaard Ry wrote:
>>>> Any comments on this patch ?
>>>>
>>>>
>>>>
>>>> On 11/18/2015 01:27 PM, Hans Westgaard Ry wrote:
>>>>> The test uses a signal-handler to periodically print a line of report.
>>>>> +		if (trig_print_report_bw) {
>>>>> +			duration_param->tcompleted[0] =et_cycles();
>>>>> +			print_report_bw(duration_param,NULL);
>>>>> +			duration_param->iters =;
>>> Excuse me, what did you mean by the line above?
>>>
>>>>> +			alarm(duration_param->duration);
>>>>> +			duration_param->tposted[0] =et_cycles();
>>>>> +			trig_print_report_bw =;
>>> And this line too.
>>>
>> --
>> 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] 8+ messages in thread

* Re: Ping: [PATCH 1/1] Fix deadlock when running run_iter_bw_infinitely
       [not found]                 ` <20151209093023.GB8662-2ukJVAZIZ/Y@public.gmane.org>
  2016-01-08  7:36                   ` Hans Westgaard Ry
@ 2016-01-21 13:58                   ` Hans Westgaard Ry
  1 sibling, 0 replies; 8+ messages in thread
From: Hans Westgaard Ry @ 2016-01-21 13:58 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Gil Rockah



On 12/09/2015 10:30 AM, Leon Romanovsky wrote:
> diff --git a/src/perftest_resources.c b/src/perftest_resources.c
> index cb915e0..4d8e6c0 100755
> --- a/src/perftest_resources.c
> +++ b/src/perftest_resources.c
> @@ -25,6 +25,12 @@ static enum ibv_wr_opcode opcode_atomic_array[] = {IBV_WR_ATOMIC_CMP_AND_SWP,IBV
>   struct perftest_parameters* duration_param;
>   struct check_alive_data check_alive_data;
> +/*
> + * Flag to trig call to print_report_bw
> + * The flag is set in signal_handler and tested/reset in run_iter_bw_infinitely
> + */
> +static volatile int trig_print_report_bw = 0;
> +
>   /******************************************************************************
>    * Beginning
> @@ -3214,7 +3220,15 @@ int run_iter_bw_infinitely(struct pingpong_context *ctx,struct perftest_paramete
>   	/* main loop for posting */
>   	while (1) {
> -
> +		if (trig_print_report_bw) {
> +			duration_param->tcompleted[0] = get_cycles();
> +			print_report_bw(duration_param,NULL);
> +			duration_param->iters = 0;
> +			alarm(duration_param->duration);
> +			duration_param->tposted[0] = get_cycles();
> +			trig_print_report_bw = 0;
> +		}
> +		
>   		/* main loop to run over all the qps and post each time n messages */
>   		for (index =0 ; index < num_of_qps ; index++) {
> @@ -4213,11 +4227,7 @@ void check_alive(int sig)
>    ******************************************************************************/
>   void catch_alarm_infintely(int sig)
>   {
> -	duration_param->tcompleted[0] = get_cycles();
> -	print_report_bw(duration_param,NULL);
> -	duration_param->iters = 0;
> -	alarm(duration_param->duration);
> -	duration_param->tposted[0] = get_cycles();
> +	trig_print_report_bw = 1;
>   }
> Thanks, it looks good,
> Reviewed-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Hi,
I cloned  git://git.openfabrics.org/~grockah/perftest.git today and found
quite a few new commits but not this patch.

Am I looking in the wrong repository or are there problems with this 
patch ?

Hans
--
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] 8+ messages in thread

* Re: Ping: [PATCH 1/1] Fix deadlock when running run_iter_bw_infinitely
       [not found]                     ` <568F66F8.9080407-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
@ 2016-01-21 14:12                       ` Leon Romanovsky
  0 siblings, 0 replies; 8+ messages in thread
From: Leon Romanovsky @ 2016-01-21 14:12 UTC (permalink / raw)
  To: gilr-VPRAkNaXOzVWk0Htik3J/w, ogerlitz-VPRAkNaXOzVWk0Htik3J/w
  Cc: Hans Westgaard Ry, linux-rdma-u79uwXL29TY76Z2rM5mHXA

On Fri, Jan 08, 2016 at 08:36:24AM +0100, Hans Westgaard Ry wrote:
> Hi,
> I cloned  git://git.openfabrics.org/~grockah/perftest.git today and found
> quite a few new commits but not this patch.
> 
> Am I looking in the wrong repository or are there problems with this patch ?

Gil/Or
Your feedback will be appreciated.

> 
> Hans
> 
> On 12/09/2015 10:30 AM, Leon Romanovsky wrote:
> >On Wed, Dec 09, 2015 at 10:11:55AM +0100, Hans Westgaard Ry wrote:
> >>Sorry but I didn't see that "something" gobbled part of the mail.
> >>The correct lines are  (as in the original):
> >>
> >>src/perftest_resources.c | 22 ++++++++++++++++------
> >>  1 file changed, 16 insertions(+), 6 deletions(-)
> >>
> >>diff --git a/src/perftest_resources.c b/src/perftest_resources.c
> >>index cb915e0..4d8e6c0 100755
> >>--- a/src/perftest_resources.c
> >>+++ b/src/perftest_resources.c
> >>@@ -25,6 +25,12 @@ static enum ibv_wr_opcode opcode_atomic_array[] = {IBV_WR_ATOMIC_CMP_AND_SWP,IBV
> >>  struct perftest_parameters* duration_param;
> >>  struct check_alive_data check_alive_data;
> >>+/*
> >>+ * Flag to trig call to print_report_bw
> >>+ * The flag is set in signal_handler and tested/reset in run_iter_bw_infinitely
> >>+ */
> >>+static volatile int trig_print_report_bw = 0;
> >>+
> >>  /******************************************************************************
> >>   * Beginning
> >>@@ -3214,7 +3220,15 @@ int run_iter_bw_infinitely(struct pingpong_context *ctx,struct perftest_paramete
> >>  	/* main loop for posting */
> >>  	while (1) {
> >>-
> >>+		if (trig_print_report_bw) {
> >>+			duration_param->tcompleted[0] = get_cycles();
> >>+			print_report_bw(duration_param,NULL);
> >>+			duration_param->iters = 0;
> >>+			alarm(duration_param->duration);
> >>+			duration_param->tposted[0] = get_cycles();
> >>+			trig_print_report_bw = 0;
> >>+		}
> >>+		
> >>  		/* main loop to run over all the qps and post each time n messages */
> >>  		for (index =0 ; index < num_of_qps ; index++) {
> >>@@ -4213,11 +4227,7 @@ void check_alive(int sig)
> >>   ******************************************************************************/
> >>  void catch_alarm_infintely(int sig)
> >>  {
> >>-	duration_param->tcompleted[0] = get_cycles();
> >>-	print_report_bw(duration_param,NULL);
> >>-	duration_param->iters = 0;
> >>-	alarm(duration_param->duration);
> >>-	duration_param->tposted[0] = get_cycles();
> >>+	trig_print_report_bw = 1;
> >>  }
> >Thanks, it looks good,
> >Reviewed-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> >
> >>
> >>
> >>On 12/09/2015 09:52 AM, Leon Romanovsky wrote:
> >>>On Wed, Dec 09, 2015 at 09:33:11AM +0100, Hans Westgaard Ry wrote:
> >>>>Any comments on this patch ?
> >>>>
> >>>>
> >>>>
> >>>>On 11/18/2015 01:27 PM, Hans Westgaard Ry wrote:
> >>>>>The test uses a signal-handler to periodically print a line of report.
> >>>>>+		if (trig_print_report_bw) {
> >>>>>+			duration_param->tcompleted[0] =et_cycles();
> >>>>>+			print_report_bw(duration_param,NULL);
> >>>>>+			duration_param->iters =;
> >>>Excuse me, what did you mean by the line above?
> >>>
> >>>>>+			alarm(duration_param->duration);
> >>>>>+			duration_param->tposted[0] =et_cycles();
> >>>>>+			trig_print_report_bw =;
> >>>And this line too.
> >>>
> >>--
> >>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
--
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] 8+ messages in thread

end of thread, other threads:[~2016-01-21 14:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-18 12:27 [PATCH 1/1] Fix deadlock when running run_iter_bw_infinitely Hans Westgaard Ry
     [not found] ` <1447849673-30034-1-git-send-email-hans.westgaard.ry-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2015-12-09  8:33   ` Ping: " Hans Westgaard Ry
     [not found]     ` <5667E747.2070006-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2015-12-09  8:52       ` Leon Romanovsky
     [not found]         ` <20151209085245.GA8662-2ukJVAZIZ/Y@public.gmane.org>
2015-12-09  9:11           ` Hans Westgaard Ry
     [not found]             ` <5667F05B.8010200-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2015-12-09  9:30               ` Leon Romanovsky
     [not found]                 ` <20151209093023.GB8662-2ukJVAZIZ/Y@public.gmane.org>
2016-01-08  7:36                   ` Hans Westgaard Ry
     [not found]                     ` <568F66F8.9080407-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2016-01-21 14:12                       ` Leon Romanovsky
2016-01-21 13:58                   ` Hans Westgaard Ry

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.