From patchwork Wed Dec 9 09:11:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Westgaard Ry X-Patchwork-Id: 7805571 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 15F51BEEE1 for ; Wed, 9 Dec 2015 09:12:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2120220462 for ; Wed, 9 Dec 2015 09:12:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2484420499 for ; Wed, 9 Dec 2015 09:12:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753797AbbLIJML (ORCPT ); Wed, 9 Dec 2015 04:12:11 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:42477 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753769AbbLIJME (ORCPT ); Wed, 9 Dec 2015 04:12:04 -0500 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id tB99C2Wc006340 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 9 Dec 2015 09:12:02 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id tB99C2xS013036 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 9 Dec 2015 09:12:02 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id tB99C1dq026865; Wed, 9 Dec 2015 09:12:02 GMT Received: from [10.172.157.166] (/10.172.157.166) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 09 Dec 2015 01:12:01 -0800 Subject: Re: Ping: [PATCH 1/1] Fix deadlock when running run_iter_bw_infinitely To: linux-rdma@vger.kernel.org, Gil Rockah References: <1447849673-30034-1-git-send-email-hans.westgaard.ry@oracle.com> <5667E747.2070006@oracle.com> <20151209085245.GA8662@leon.nu> From: Hans Westgaard Ry Message-ID: <5667F05B.8010200@oracle.com> Date: Wed, 9 Dec 2015 10:11:55 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151209085245.GA8662@leon.nu> X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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. > Reviewed-by: Leon Romanovsky --- 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/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; }