Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937817AbdLRSDn (ORCPT ); Mon, 18 Dec 2017 13:03:43 -0500 Received: from esa2.cray.iphmx.com ([68.232.143.164]:53069 "EHLO esa2.cray.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934051AbdLRSDf (ORCPT ); Mon, 18 Dec 2017 13:03:35 -0500 X-IronPort-AV: E=Sophos;i="5.45,422,1508799600"; d="scan'208";a="17120709" X-Cray-OBMMKR: 1433258124 17120709 From: Patrick Farrell To: NeilBrown , Oleg Drokin , "Andreas Dilger" , James Simmons , Greg Kroah-Hartman CC: lkml , lustre Subject: Re: [lustre-devel] [PATCH 02/16] staging: lustre: replace simple cases of l_wait_event() with wait_event(). Thread-Topic: [lustre-devel] [PATCH 02/16] staging: lustre: replace simple cases of l_wait_event() with wait_event(). Thread-Index: AQHTd9CAK5NxI5nlZUWr+vBjNn31CqNJAMuA Date: Mon, 18 Dec 2017 18:03:30 +0000 Message-ID: References: <151358127190.5099.12792810096274074963.stgit@noble> <151358147981.5099.13114335078693829049.stgit@noble> In-Reply-To: <151358147981.5099.13114335078693829049.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:j7Pb9kDysQmE8Z+s2ZW9S0QGbAe6gGs2upBg+JfNjYxa84dnVsnOvjOgkPfXdpFvLAK1JPNtDwf/XR+0LNJNHHlV3mWdxEDUYF5v/kv6j37bbJkXssLvpZAUr/i/U30r1z/RM2pVy8rlcSoYPTGJD9bYPfvCy8paKpMliq2ml/amg/VHFecbA3DaLmp8uIZJ5pf2pHGlTcXjMFN6k7sLfcNapF3Fr1xFgsZbeciVVb02nV91PlWz4wdu5Kvt/W19O25fM5nDT9+jqXK/eUBBBiybO9gb1YW1eC+577CdchzqM4vbnSWkFUpwJcScdKUE7YkF1V/sRugieISTAhuA2J0GVkFx4bUuy13HBpc02qg=;5:1rF6QeA2XEf/fP+kuMu8rgL9vgTfGhyaLzwD4niiXkGTzsMZdpFpEq9hI8xXOYCHVfKzmvFRZwtf7LY1Cq8A3AWjatNPnsT/luAdq5HMX/kw+sIAo6AZ8gAhlpo7LAP4JqWW9fd5U0HbFY6IuYN1temhNTMDMODThq+TlwJqxVQ=;24:enAcxoo8FMRWUTy4O9KQXwlYcrZTZIRHR8kd1dsevdG+5YWGGCpbvcZXmHQjt+Ag0K9DckklQldT0fLWN4bb/dABd8SjG133yOin+kazPmI=;7:AisF8NF08Z0Pm8YbbzgJ/QZYxlxVeMvrVq+TxjeyI5amyvyfHqnjbGc5VnwifcFC+EmdVDT7h0Ycjl+eYfxTww9fK375QtZizZyeHu4zsF6HBDXRe49H+Jffa5BnoHLn1o8Rv8zG+8+XvREqH0OIL9YARkhGLtohlUfsOeM1TVt677NsGK6j4WWHPssb50lKNCPYL3ulaObOKV8XCOSOCX9XhSL0a/VqiCV05CfpPaYr61dltmOV5wEj0PkNCOG3 x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: cd101649-da0e-48eb-6d3f-08d54641a5a1 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:(788757137089); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231023)(6041248)(20161123562025)(20161123564025)(20161123560025)(20161123555025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(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)(366004)(346002)(376002)(199004)(189003)(24454002)(81156014)(81166006)(83506002)(8676002)(99286004)(14454004)(2900100001)(305945005)(58126008)(54906003)(2906002)(3660700001)(3280700002)(7736002)(5660300001)(76176011)(2950100002)(110136005)(316002)(68736007)(6512007)(66066001)(6436002)(53546011)(53936002)(25786009)(86362001)(106356001)(77096006)(229853002)(59450400001)(6486002)(105586002)(6506007)(6246003)(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="us-ascii" Content-ID: <980025F119F33A42BCA4CE18A74787B1@namprd11.prod.outlook.com> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: cd101649-da0e-48eb-6d3f-08d54641a5a1 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Dec 2017 18:03:30.6869 (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 vBII3nG2017567 Content-Length: 2935 Lines: 82 The wait calls in ll_statahead_thread are done in a service thread, and should probably *not* contribute to load. The one in osc_extent_wait is perhaps tough - It is called both from user threads & daemon threads depending on the situation. The effect of adding that to load average could be significant for some activities, even when no user threads are busy. Thoughts from other Lustre people would be welcome here. Similar issues for osc_object_invalidate. (If no one else speaks up, my vote is no contribution to load for those OSC waits.) Otherwise this one looks good... On 12/18/17, 1:17 AM, "lustre-devel on behalf of NeilBrown" wrote: >@@ -968,7 +964,6 @@ static int ll_statahead_thread(void *arg) > int first = 0; > int rc = 0; > struct md_op_data *op_data; >- struct l_wait_info lwi = { 0 }; > sai = ll_sai_get(dir); > sa_thread = &sai->sai_thread; >@@ -1069,12 +1064,11 @@ static int ll_statahead_thread(void *arg) > /* wait for spare statahead window */ > do { >- l_wait_event(sa_thread->t_ctl_waitq, >- !sa_sent_full(sai) || >- sa_has_callback(sai) || >- !list_empty(&sai->sai_agls) || >- !thread_is_running(sa_thread), >- &lwi); >+ wait_event(sa_thread->t_ctl_waitq, >+ !sa_sent_full(sai) || >+ sa_has_callback(sai) || >+ !list_empty(&sai->sai_agls) || >+ !thread_is_running(sa_thread)); > sa_handle_callback(sai); > spin_lock(&lli->lli_agl_lock); >@@ -1128,11 +1122,10 @@ static int ll_statahead_thread(void *arg) > * for file release to stop me. > */ > while (thread_is_running(sa_thread)) { >- l_wait_event(sa_thread->t_ctl_waitq, >- sa_has_callback(sai) || >- !agl_list_empty(sai) || >- !thread_is_running(sa_thread), >- &lwi); >+ wait_event(sa_thread->t_ctl_waitq, >+ sa_has_callback(sai) || >+ !agl_list_empty(sai) || >+ !thread_is_running(sa_thread)); > sa_handle_callback(sai); > } >@@ -1145,9 +1138,8 @@ static int ll_statahead_thread(void *arg) > CDEBUG(D_READA, "stop agl thread: sai %p pid %u\n", > sai, (unsigned int)agl_thread->t_pid); >- l_wait_event(agl_thread->t_ctl_waitq, >- thread_is_stopped(agl_thread), >- &lwi); >+ wait_event(agl_thread->t_ctl_waitq, >+ thread_is_stopped(agl_thread)); > } else { > /* Set agl_thread flags anyway. */ > thread_set_flags(agl_thread, SVC_STOPPED); >@@ -1159,8 +1151,8 @@ static int ll_statahead_thread(void *arg) > */ > while (sai->sai_sent != sai->sai_replied) { > /* in case we're not woken up, timeout wait */ >- lwi = LWI_TIMEOUT(msecs_to_jiffies(MSEC_PER_SEC >> 3), >- NULL, NULL); >+ struct l_wait_info lwi = LWI_TIMEOUT(msecs_to_jiffies(MSEC_PER_SEC >> >3), >+ NULL, NULL); > l_wait_event(sa_thread->t_ctl_waitq, > sai->sai_sent == sai->sai_replied, &lwi); > }