Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935055AbdLRVJZ (ORCPT ); Mon, 18 Dec 2017 16:09:25 -0500 Received: from esa1.cray.iphmx.com ([68.232.142.33]:44832 "EHLO esa1.cray.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758678AbdLRVJW (ORCPT ); Mon, 18 Dec 2017 16:09:22 -0500 X-IronPort-AV: E=Sophos;i="5.45,423,1508799600"; d="scan'208";a="17067950" X-Cray-OBMMKR: 1433258124 17067950 From: Patrick Farrell To: NeilBrown , Oleg Drokin , "Andreas Dilger" , James Simmons , Greg Kroah-Hartman CC: lkml , lustre Subject: Re: [lustre-devel] [PATCH 15/16] staging: lustre: use explicit poll loop in ptlrpc_unregister_reply Thread-Topic: [lustre-devel] [PATCH 15/16] staging: lustre: use explicit poll loop in ptlrpc_unregister_reply Thread-Index: AQHTd9C1kIjSYWPwjE+6grVlyaxz8aNJNLMA Date: Mon, 18 Dec 2017 21:09:18 +0000 Message-ID: References: <151358127190.5099.12792810096274074963.stgit@noble> <151358148034.5099.17386685003288433122.stgit@noble> In-Reply-To: <151358148034.5099.17386685003288433122.stgit@noble> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.7.2.170228 authentication-results: spf=none (sender IP is ) smtp.mailfrom=paf@cray.com; x-originating-ip: [136.162.2.1] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MWHPR1101MB2141;6:0P8A3FbFgFNhO6eWs7MHoIJbl+1tQQnOBaAPzFwi34yxn1KdxgLFtD1dJ3IxsV7iO/TpbErlLwaBHI9GnPM0iYDF4x9IR1Nv9j1ODXPQb/DBh/B3Pq/VSc5ZrcH7styjTEgpAfxTdzKJE+/HH0211inUmYGAEIeOsKDkQiZ1WWFKPtPwWQT8llDSP8xjAn6FuX+vUPMCcm4L7VLZk+uXKgmuVsJY52q89VYEB/5HpqSiOEZPbQn7uVJMl75iaXxUwGA2WhMrhB50meoo29VU8IjbFvhWYVfH55UyN3H6aTdtwvxQBwnEJgypC4infVt1LFyWMCosoH75KQzAGwqOcZ9aj/46Oh2sTSDw/T5hIXM=;5:TSWbaz1xHGy8i+vu7wnJdRW8rzEJUfYuTx8yhEvIw8adtoLl7aRU9Sht+JwIOd+ergrxdMyzUrqMTKiE2mfQKg8DsFTmXV/AUhQQAzfNkaQWKQJL2P8SDB1rPc6/eynuqxZLbEfOHalCY9UHmL11p/JTAQdOhRx4RkaMlNGvsv4=;24:7B1KIRD+1pGyPdyMqWfTeiJ3dhiTgC5K9i2cayfqSchbTJJoMRX+qRMYRmt/v2pFjujHULlngwx9JO4geYrzv6blFmFoD5V5z/A4tcZxelQ=;7:VTi5pwFaEygV31iNxvy8ml7FA/ycOoxe046sgQaSyGQ+spzqRDuwlgp5NmRweFBk86frwdVVgUcVFgy79WaN/K1mlSangAR0+Agq84uuvQQpoGNVab3xA8gdEdw13BW/kyfbL5eWWWY3K7IkEQr+CYUNHOuAr2u245LvzKQTP6ZP7s9rUzjt4SDBQCSyoK06vuOOplJd+fJMB/9JNNKwkUFDxyioZQ0UjqnA6/Os2LzgpBwc844wUcFplw+1FBrf x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 0093acec-7745-4d30-afc8-08d5465b9a2f x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307);SRVR:MWHPR1101MB2141; x-ms-traffictypediagnostic: MWHPR1101MB2141: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(788757137089); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(5005006)(8121501046)(3002001)(3231023)(93006095)(93001095)(10201501046)(6041248)(20161123560025)(20161123562025)(20161123555025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:MWHPR1101MB2141;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:MWHPR1101MB2141; x-forefront-prvs: 0525BB0ADF x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(396003)(39850400004)(346002)(366004)(189003)(199004)(24454002)(6246003)(6306002)(229853002)(316002)(4326008)(6506007)(53546011)(97736004)(6512007)(77096006)(3280700002)(99286004)(6486002)(6436002)(3660700001)(25786009)(8936002)(86362001)(53936002)(81156014)(81166006)(478600001)(6116002)(3846002)(7736002)(102836003)(59450400001)(36756003)(14454004)(8676002)(110136005)(105586002)(58126008)(66066001)(68736007)(83506002)(54906003)(106356001)(76176011)(2906002)(2900100001)(2950100002)(5660300001)(305945005)(13693001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR1101MB2141;H:MWHPR1101MB2143.namprd11.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-ID: <03B4D6494D6D2A4BAA660AB3A088531D@namprd11.prod.outlook.com> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 0093acec-7745-4d30-afc8-08d5465b9a2f X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Dec 2017 21:09:18.3702 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: e7b8488a-c0cd-4614-aae1-996bfabec247 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1101MB2141 X-OriginatorOrg: cray.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id vBIL9Tru026407 Content-Length: 2032 Lines: 61 This should not contribute to load, since it?s called out of the ptlrpcd daemons. On 12/18/17, 1:18 AM, "lustre-devel on behalf of NeilBrown" wrote: >replace l_wait_event() with wait_event_timeout() and explicit >loop. This approach is easier to understand. > >Signed-off-by: NeilBrown >--- > drivers/staging/lustre/lustre/ptlrpc/client.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > >diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c >b/drivers/staging/lustre/lustre/ptlrpc/client.c >index 3e6d22beb9f5..bb8c9ab68f5f 100644 >--- a/drivers/staging/lustre/lustre/ptlrpc/client.c >+++ b/drivers/staging/lustre/lustre/ptlrpc/client.c >@@ -2500,7 +2500,6 @@ static int ptlrpc_unregister_reply(struct >ptlrpc_request *request, int async) > { > int rc; > wait_queue_head_t *wq; >- struct l_wait_info lwi; > > /* Might sleep. */ > LASSERT(!in_interrupt()); >@@ -2543,16 +2542,17 @@ static int ptlrpc_unregister_reply(struct >ptlrpc_request *request, int async) > * Network access will complete in finite time but the HUGE > * timeout lets us CWARN for visibility of sluggish NALs > */ >- lwi = LWI_TIMEOUT_INTERVAL(LONG_UNLINK * HZ, >- HZ, NULL, NULL); >- rc = l_wait_event(*wq, !ptlrpc_client_recv_or_unlink(request), >- &lwi); >- if (rc == 0) { >+ int cnt = 0; >+ while (cnt < LONG_UNLINK && >+ (rc = wait_event_timeout(*wq, >+ !ptlrpc_client_recv_or_unlink(request), >+ HZ)) == 0) >+ cnt += 1; >+ if (rc > 0) { > ptlrpc_rqphase_move(request, request->rq_next_phase); > return 1; > } > >- LASSERT(rc == -ETIMEDOUT); > DEBUG_REQ(D_WARNING, request, > "Unexpectedly long timeout receiving_reply=%d req_ulinked=%d >reply_unlinked=%d", > request->rq_receiving_reply, > > >_______________________________________________ >lustre-devel mailing list >lustre-devel@lists.lustre.org >http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org