Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936930AbdLRVEB (ORCPT ); Mon, 18 Dec 2017 16:04:01 -0500 Received: from esa1.cray.iphmx.com ([68.232.142.33]:26247 "EHLO esa1.cray.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932558AbdLRVD7 (ORCPT ); Mon, 18 Dec 2017 16:03:59 -0500 X-IronPort-AV: E=Sophos;i="5.45,423,1508799600"; d="scan'208";a="17067795" X-Cray-OBMMKR: 1433258124 17067795 From: Patrick Farrell To: NeilBrown , Oleg Drokin , "Andreas Dilger" , James Simmons , Greg Kroah-Hartman CC: lkml , lustre Subject: Re: [lustre-devel] [PATCH 11/16] staging: lustre: make polling loop in ptlrpc_unregister_bulk more obvious Thread-Topic: [lustre-devel] [PATCH 11/16] staging: lustre: make polling loop in ptlrpc_unregister_bulk more obvious Thread-Index: AQHTd9Cyro2WeWofSka/RLwW2K1RSqNJMzMA Date: Mon, 18 Dec 2017 21:03:54 +0000 Message-ID: References: <151358127190.5099.12792810096274074963.stgit@noble> <151358148020.5099.4047116902359752959.stgit@noble> In-Reply-To: <151358148020.5099.4047116902359752959.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;MWHPR1101MB2142;6:3oskkAwyq+63MFygJPKJ/UguT2x9KjgyBSFoplkG/rseg/nJ5MBEcBqaZ7xjMu5C7t7+7dXN1yjYthcR2XjsbN3D6l3r9kGGCX3yPpZH0xSYxfTwlJSXypqWn9G4cTibuWO56U3UODjqYw9cfJWpbX73BjoYS8zPm61fDoCxS3SqU01Hs4J4ql5baXc25nojHYVrDdkp50IbpegLAVz6qIyeZwczP6/sBmhB2oeeCwaVZScb2hOKe/ojodTBemDBWo1t5/gStt1lb8d+r3nI/Qj2efEDeZ7at2o4AgmMp+AIJ0BCJvFdOd67ghG3YbV7uwIsa+daYiOqQqt3vH7Plw==;5:2K5hbwbpBbhftnChijMJ83Yxj9ItE3p7CX90lDum0tPbGcKq+w4zdL4GirLIxwoDuxLGiadde4pLnnLPJNkYOB5ByDQh7c49j9oOm57QjTlT9Uzi7OznrN2W6JjkxP8LMeCGBEXRNnzvzxt6run2CouGZ6baE87h1GVHLev1J5I=;24:iBF74UWgwxE0HqubbKsKh84gaYn1WRdGejeJoUkr82BCrXefEkAYyqK+KrpiAFzZy6RNH0o0xHEwnrsf+QVWCQ4tndUb/qmVqJI1wpjEuYA=;7:RUTW+rRZhhQt8mk8M7f5B13aMh+sYIgBiQxnNVO0ZhmL40hdcRaxT+io/4cUxdx2x2HAyE5pj1vRjNPvQPEeuX07cQPbf31AQta12f+p5ROohBmFFUIfVxI1SLoIYTycb1sa+Pdj4dXYSLxDmUfMcaoVdhQnCwZsOpHvOFNGvpWkG9W1HO2E/geiG83SHA2Hg2KnrtvPEsvENgL+sWYZGZI5x/ZWSRUGNI3T86SmZP28rztBPJWz0RssmvrSyKAI x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 30a580d1-8f5d-4343-777b-08d5465ad967 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307);SRVR:MWHPR1101MB2142; x-ms-traffictypediagnostic: MWHPR1101MB2142: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(8121501046)(5005006)(3002001)(3231023)(93006095)(93001095)(10201501046)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(6072148)(201708071742011);SRVR:MWHPR1101MB2142;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:MWHPR1101MB2142; x-forefront-prvs: 0525BB0ADF x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(39850400004)(346002)(366004)(376002)(199004)(189003)(24454002)(83506002)(81166006)(81156014)(14454004)(99286004)(8676002)(2900100001)(305945005)(58126008)(54906003)(2906002)(3660700001)(3280700002)(7736002)(5660300001)(2950100002)(76176011)(110136005)(316002)(6306002)(68736007)(6512007)(66066001)(6436002)(53546011)(86362001)(53936002)(25786009)(106356001)(77096006)(59450400001)(229853002)(6486002)(105586002)(6246003)(6506007)(8936002)(97736004)(6116002)(102836003)(3846002)(4326008)(478600001)(36756003)(13693001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR1101MB2142;H:MWHPR1101MB2143.namprd11.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-ID: <99BBED9028E76D478EB34CA7A6D15584@namprd11.prod.outlook.com> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 30a580d1-8f5d-4343-777b-08d5465ad967 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Dec 2017 21:03:54.9668 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: e7b8488a-c0cd-4614-aae1-996bfabec247 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1101MB2142 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 vBIL47Kh024562 Content-Length: 2485 Lines: 71 This probably shouldn?t contribute to load, it?s often (mostly?) run out of the ptlrpcd daemons. - Patrick On 12/18/17, 1:18 AM, "lustre-devel on behalf of NeilBrown" wrote: >This use of l_wait_event() is a polling loop that re-checks >every second. Make this more obvious with a while loop >and wait_event_timeout(). > >Signed-off-by: NeilBrown >--- > drivers/staging/lustre/lustre/ptlrpc/niobuf.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > >diff --git a/drivers/staging/lustre/lustre/ptlrpc/niobuf.c >b/drivers/staging/lustre/lustre/ptlrpc/niobuf.c >index 0c2ded721c49..5606c8f01b5b 100644 >--- a/drivers/staging/lustre/lustre/ptlrpc/niobuf.c >+++ b/drivers/staging/lustre/lustre/ptlrpc/niobuf.c >@@ -229,7 +229,6 @@ int ptlrpc_unregister_bulk(struct ptlrpc_request >*req, int async) > { > struct ptlrpc_bulk_desc *desc = req->rq_bulk; > wait_queue_head_t *wq; >- struct l_wait_info lwi; > int rc; > > LASSERT(!in_interrupt()); /* might sleep */ >@@ -246,7 +245,7 @@ int ptlrpc_unregister_bulk(struct ptlrpc_request >*req, int async) > > /* the unlink ensures the callback happens ASAP and is the last > * one. If it fails, it must be because completion just happened, >- * but we must still l_wait_event() in this case to give liblustre >+ * but we must still wait_event() in this case to give liblustre > * a chance to run client_bulk_callback() > */ > mdunlink_iterate_helper(desc->bd_mds, desc->bd_md_max_brw); >@@ -270,15 +269,16 @@ int ptlrpc_unregister_bulk(struct ptlrpc_request >*req, int async) > /* Network access will complete in finite time but the HUGE > * timeout lets us CWARN for visibility of sluggish LNDs > */ >- lwi = LWI_TIMEOUT_INTERVAL(LONG_UNLINK * HZ, >- HZ, NULL, NULL); >- rc = l_wait_event(*wq, !ptlrpc_client_bulk_active(req), &lwi); >- if (rc == 0) { >+ int cnt = 0; >+ while (cnt < LONG_UNLINK && >+ (rc = wait_event_timeout(*wq, !ptlrpc_client_bulk_active(req), >+ HZ)) == 0) >+ cnt += 1; >+ if (rc > 0) { > ptlrpc_rqphase_move(req, req->rq_next_phase); > return 1; > } > >- LASSERT(rc == -ETIMEDOUT); > DEBUG_REQ(D_WARNING, req, "Unexpectedly long timeout: desc %p", > desc); > } > > >_______________________________________________ >lustre-devel mailing list >lustre-devel@lists.lustre.org >http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org