Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936797AbdLRVhj (ORCPT ); Mon, 18 Dec 2017 16:37:39 -0500 Received: from mx2.suse.de ([195.135.220.15]:35334 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934193AbdLRVhi (ORCPT ); Mon, 18 Dec 2017 16:37:38 -0500 From: NeilBrown To: Patrick Farrell , Oleg Drokin , "Andreas Dilger" , James Simmons , Greg Kroah-Hartman Date: Tue, 19 Dec 2017 08:37:19 +1100 Cc: lkml , lustre Subject: Re: [lustre-devel] [PATCH 02/16] staging: lustre: replace simple cases of l_wait_event() with wait_event(). In-Reply-To: References: <151358127190.5099.12792810096274074963.stgit@noble> <151358147981.5099.13114335078693829049.stgit@noble> Message-ID: <87vah3lnu8.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 24533 Lines: 672 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Mon, Dec 18 2017, Patrick Farrell wrote: > Ah, finally we=C2=B9ve got that NOLOAD flag! This will clear up several = nasty > bugs around ptrace and sigkill that come when waiting with signals blocked > in TASK_INTERRUPTIBLE. I see it was added in 2015=C5=A0 The joys of wor= king > with vendor kernels. I does take a while for these things to filter through. Maybe I should examine all places that call flush_signals() and see which ones really want to use TASK_IDLE (which is what I should have used, instead of TASK_UNINTERRUPTIBLE | TASK_NOLOAD). > > Thanks for these, Neil. I=C2=B9ll try to take a careful look. > > Given the description of the commit that added TASK_NOLOAD, I=C2=B9m kind= of > shocked to see it has almost no users in the kernel yet. Just a few > callers of schedule_timeout_idle, it looks like. Even so, why not put > those macros in sched.h to begin with? Always hard to know how best to handle patch that affect multiple subsystems. Once I figure out what to do with l_wait_event_exclusive_head(), I'll probably send any patches related to that together with the wait_noload changes... Though maybe I need to use swait_event_idle(). Time to learn about "simple wait queues" I guess. Thanks, NeilBrown > > - Patrick > > On 12/18/17, 1:17 AM, "lustre-devel on behalf of NeilBrown" > wrote: > >>When the lwi arg is full of zeros, l_wait_event() behaves almost >>identically to the standard wait_event() interface, so use that >>instead. >> >>The only difference in behavior is that l_wait_event() blocks all >>signals and uses an TASK_INTERRUPTIBLE wait, while wait_event() >>does not block signals, but waits in state TASK_UNINTERRUPTIBLE. >>This means that processes blocked in wait_event() will contribute >>to the load average. This behavior is (arguably) more correct - in >>most cases. >> >>In some cases, the wait is in a service thread waiting for work to >>do. In these case we should wait TASK_NOLOAD order with >>TASK_UNINTERRUPTIBLE. To facilitate this, add a "wait_event_noload()" >>macro. This should eventually be moved into include/linux/wait.h. >> >>There is one case where wait_event_exclusive_noload() is needed. >>So we add a macro for that too. >> >>Signed-off-by: NeilBrown >>--- >> drivers/staging/lustre/lustre/include/lustre_lib.h | 47 >>++++++++++++++++--- >> drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 4 -- >> drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 8 +-- >> drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 5 +- >> drivers/staging/lustre/lustre/llite/statahead.c | 50 >>++++++++------------ >> drivers/staging/lustre/lustre/lov/lov_object.c | 6 +- >> drivers/staging/lustre/lustre/mgc/mgc_request.c | 4 -- >> drivers/staging/lustre/lustre/obdclass/cl_io.c | 6 +- >> drivers/staging/lustre/lustre/obdclass/genops.c | 15 ++---- >> drivers/staging/lustre/lustre/osc/osc_cache.c | 5 +- >> drivers/staging/lustre/lustre/osc/osc_object.c | 4 -- >> drivers/staging/lustre/lustre/ptlrpc/pinger.c | 10 ++-- >> drivers/staging/lustre/lustre/ptlrpc/sec_gc.c | 11 ++-- >> drivers/staging/lustre/lustre/ptlrpc/service.c | 13 ++--- >> 14 files changed, 93 insertions(+), 95 deletions(-) >> >>diff --git a/drivers/staging/lustre/lustre/include/lustre_lib.h >>b/drivers/staging/lustre/lustre/include/lustre_lib.h >>index ca1dce15337e..08bdd618ea7d 100644 >>--- a/drivers/staging/lustre/lustre/include/lustre_lib.h >>+++ b/drivers/staging/lustre/lustre/include/lustre_lib.h >>@@ -333,12 +333,6 @@ do { \ >> __ret; \ >> }) >>=20 >>-#define l_wait_condition(wq, condition) \ >>-({ \ >>- struct l_wait_info lwi =3D { 0 }; \ >>- l_wait_event(wq, condition, &lwi); \ >>-}) >>- >> #define l_wait_condition_exclusive(wq, condition) \ >> ({ \ >> struct l_wait_info lwi =3D { 0 }; \ >>@@ -353,4 +347,45 @@ do { \ >>=20 >> /** @} lib */ >>=20 >>+#define __wait_event_noload(wq_head, condition) \ >>+ (void)___wait_event(wq_head, condition, (TASK_UNINTERRUPTIBLE | >>TASK_NOLOAD), 0, 0, \ >>+ schedule()) >>+ >>+/** >>+ * wait_event_noload - sleep, without registering load, until a >>condition gets true >>+ * @wq_head: the waitqueue to wait on >>+ * @condition: a C expression for the event to wait for >>+ * >>+ * The process is put to sleep (TASK_UNINTERRUPTIBLE|TASK_NOLOAD) until >>the >>+ * @condition evaluates to true. The @condition is checked each time >>+ * the waitqueue @wq_head is woken up. >>+ * >>+ * wake_up() has to be called after changing any variable that could >>+ * change the result of the wait condition. >>+ * >>+ * This can be used instead of wait_event() when the event >>+ * being waited for is does not imply load on the system, but >>+ * when responding to signals is no appropriate, such as in >>+ * a kernel service thread. >>+ */ >>+#define wait_event_noload(wq_head, condition) \ >>+do { \ >>+ might_sleep(); \ >>+ if (condition) \ >>+ break; \ >>+ __wait_event_noload(wq_head, condition); \ >>+} while (0) >>+ >>+/* >>+ * Just like wait_event_noload(), except it sets exclusive flag >>+ */ >>+#define wait_event_exclusive_noload(wq_head, condition) \ >>+do { \ >>+ if (condition) \ >>+ break; \ >>+ (void)___wait_event(wq_head, condition, \ >>+ (TASK_UNINTERRUPTIBLE | TASK_NOLOAD), 1, 0, \ >>+ schedule()); \ >>+} while (0) >>+ >> #endif /* _LUSTRE_LIB_H */ >>diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c >>b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c >>index 7cbc6a06afec..975fabc73148 100644 >>--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c >>+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c >>@@ -1913,14 +1913,12 @@ void ldlm_cancel_callback(struct ldlm_lock *lock) >> ldlm_set_bl_done(lock); >> wake_up_all(&lock->l_waitq); >> } else if (!ldlm_is_bl_done(lock)) { >>- struct l_wait_info lwi =3D { 0 }; >>- >> /* >> * The lock is guaranteed to have been canceled once >> * returning from this function. >> */ >> unlock_res_and_lock(lock); >>- l_wait_event(lock->l_waitq, is_bl_done(lock), &lwi); >>+ wait_event(lock->l_waitq, is_bl_done(lock)); >> lock_res_and_lock(lock); >> } >> } >>diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c >>b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c >>index 5f6e7c933b81..d9835418d340 100644 >>--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c >>+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c >>@@ -833,17 +833,15 @@ static int ldlm_bl_thread_main(void *arg) >> /* cannot use bltd after this, it is only on caller's stack */ >>=20 >> while (1) { >>- struct l_wait_info lwi =3D { 0 }; >> struct ldlm_bl_work_item *blwi =3D NULL; >> struct obd_export *exp =3D NULL; >> int rc; >>=20 >> rc =3D ldlm_bl_get_work(blp, &blwi, &exp); >> if (!rc) >>- l_wait_event_exclusive(blp->blp_waitq, >>- ldlm_bl_get_work(blp, &blwi, >>- &exp), >>- &lwi); >>+ wait_event_exclusive_noload(blp->blp_waitq, >>+ ldlm_bl_get_work(blp, &blwi, >>+ &exp)); >> atomic_inc(&blp->blp_busy_threads); >>=20 >> if (ldlm_bl_thread_need_create(blp, blwi)) >>diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c >>b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c >>index 8563bd32befa..d562f90cee97 100644 >>--- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c >>+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c >>@@ -1031,7 +1031,6 @@ static int ldlm_pools_thread_main(void *arg) >>=20 >> static int ldlm_pools_thread_start(void) >> { >>- struct l_wait_info lwi =3D { 0 }; >> struct task_struct *task; >>=20 >> if (ldlm_pools_thread) >>@@ -1052,8 +1051,8 @@ static int ldlm_pools_thread_start(void) >> ldlm_pools_thread =3D NULL; >> return PTR_ERR(task); >> } >>- l_wait_event(ldlm_pools_thread->t_ctl_waitq, >>- thread_is_running(ldlm_pools_thread), &lwi); >>+ wait_event(ldlm_pools_thread->t_ctl_waitq, >>+ thread_is_running(ldlm_pools_thread)); >> return 0; >> } >>=20 >>diff --git a/drivers/staging/lustre/lustre/llite/statahead.c >>b/drivers/staging/lustre/lustre/llite/statahead.c >>index 90c7324575e4..39040916a043 100644 >>--- a/drivers/staging/lustre/lustre/llite/statahead.c >>+++ b/drivers/staging/lustre/lustre/llite/statahead.c >>@@ -864,7 +864,6 @@ static int ll_agl_thread(void *arg) >> struct ll_sb_info *sbi =3D ll_i2sbi(dir); >> struct ll_statahead_info *sai; >> struct ptlrpc_thread *thread; >>- struct l_wait_info lwi =3D { 0 }; >>=20 >> sai =3D ll_sai_get(dir); >> thread =3D &sai->sai_agl_thread; >>@@ -885,10 +884,9 @@ static int ll_agl_thread(void *arg) >> wake_up(&thread->t_ctl_waitq); >>=20 >> while (1) { >>- l_wait_event(thread->t_ctl_waitq, >>- !list_empty(&sai->sai_agls) || >>- !thread_is_running(thread), >>- &lwi); >>+ wait_event_noload(thread->t_ctl_waitq, >>+ !list_empty(&sai->sai_agls) || >>+ !thread_is_running(thread)); >>=20 >> if (!thread_is_running(thread)) >> break; >>@@ -932,7 +930,6 @@ static int ll_agl_thread(void *arg) >> static void ll_start_agl(struct dentry *parent, struct ll_statahead_info >>*sai) >> { >> struct ptlrpc_thread *thread =3D &sai->sai_agl_thread; >>- struct l_wait_info lwi =3D { 0 }; >> struct ll_inode_info *plli; >> struct task_struct *task; >>=20 >>@@ -948,9 +945,8 @@ static void ll_start_agl(struct dentry *parent, >>struct ll_statahead_info *sai) >> return; >> } >>=20 >>- l_wait_event(thread->t_ctl_waitq, >>- thread_is_running(thread) || thread_is_stopped(thread), >>- &lwi); >>+ wait_event(thread->t_ctl_waitq, >>+ thread_is_running(thread) || thread_is_stopped(thread)); >> } >>=20 >> /* statahead thread main function */ >>@@ -968,7 +964,6 @@ static int ll_statahead_thread(void *arg) >> int first =3D 0; >> int rc =3D 0; >> struct md_op_data *op_data; >>- struct l_wait_info lwi =3D { 0 }; >>=20 >> sai =3D ll_sai_get(dir); >> sa_thread =3D &sai->sai_thread; >>@@ -1069,12 +1064,11 @@ static int ll_statahead_thread(void *arg) >>=20 >> /* 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); >>=20 >> 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)); >>=20 >> sa_handle_callback(sai); >> } >>@@ -1145,9 +1138,8 @@ static int ll_statahead_thread(void *arg) >>=20 >> 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 !=3D sai->sai_replied) { >> /* in case we're not woken up, timeout wait */ >>- lwi =3D LWI_TIMEOUT(msecs_to_jiffies(MSEC_PER_SEC >> 3), >>- NULL, NULL); >>+ struct l_wait_info lwi =3D LWI_TIMEOUT(msecs_to_jiffies(MSEC_PER_SEC >> >>3), >>+ NULL, NULL); >> l_wait_event(sa_thread->t_ctl_waitq, >> sai->sai_sent =3D=3D sai->sai_replied, &lwi); >> } >>@@ -1520,7 +1512,6 @@ static int start_statahead_thread(struct inode >>*dir, struct dentry *dentry) >> { >> struct ll_inode_info *lli =3D ll_i2info(dir); >> struct ll_statahead_info *sai =3D NULL; >>- struct l_wait_info lwi =3D { 0 }; >> struct ptlrpc_thread *thread; >> struct task_struct *task; >> struct dentry *parent =3D dentry->d_parent; >>@@ -1570,9 +1561,8 @@ static int start_statahead_thread(struct inode >>*dir, struct dentry *dentry) >> goto out; >> } >>=20 >>- l_wait_event(thread->t_ctl_waitq, >>- thread_is_running(thread) || thread_is_stopped(thread), >>- &lwi); >>+ wait_event(thread->t_ctl_waitq, >>+ thread_is_running(thread) || thread_is_stopped(thread)); >> ll_sai_put(sai); >>=20 >> /* >>diff --git a/drivers/staging/lustre/lustre/lov/lov_object.c >>b/drivers/staging/lustre/lustre/lov/lov_object.c >>index 897cf2cd4a24..aa82f2ed40ae 100644 >>--- a/drivers/staging/lustre/lustre/lov/lov_object.c >>+++ b/drivers/staging/lustre/lustre/lov/lov_object.c >>@@ -723,15 +723,13 @@ static void lov_conf_unlock(struct lov_object *lov) >>=20 >> static int lov_layout_wait(const struct lu_env *env, struct lov_object >>*lov) >> { >>- struct l_wait_info lwi =3D { 0 }; >>- >> while (atomic_read(&lov->lo_active_ios) > 0) { >> CDEBUG(D_INODE, "file:" DFID " wait for active IO, now: %d.\n", >> PFID(lu_object_fid(lov2lu(lov))), >> atomic_read(&lov->lo_active_ios)); >>=20 >>- l_wait_event(lov->lo_waitq, >>- atomic_read(&lov->lo_active_ios) =3D=3D 0, &lwi); >>+ wait_event(lov->lo_waitq, >>+ atomic_read(&lov->lo_active_ios) =3D=3D 0); >> } >> return 0; >> } >>diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c >>b/drivers/staging/lustre/lustre/mgc/mgc_request.c >>index 79ff85feab64..81b101941eec 100644 >>--- a/drivers/staging/lustre/lustre/mgc/mgc_request.c >>+++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c >>@@ -601,9 +601,7 @@ static int mgc_requeue_thread(void *data) >> config_log_put(cld_prev); >>=20 >> /* Wait a bit to see if anyone else needs a requeue */ >>- lwi =3D (struct l_wait_info) { 0 }; >>- l_wait_event(rq_waitq, rq_state & (RQ_NOW | RQ_STOP), >>- &lwi); >>+ wait_event(rq_waitq, rq_state & (RQ_NOW | RQ_STOP)); >> spin_lock(&config_list_lock); >> } >>=20 >>diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c >>b/drivers/staging/lustre/lustre/obdclass/cl_io.c >>index 6ec5218a18c1..a3fb2bbde70f 100644 >>--- a/drivers/staging/lustre/lustre/obdclass/cl_io.c >>+++ b/drivers/staging/lustre/lustre/obdclass/cl_io.c >>@@ -1110,10 +1110,8 @@ int cl_sync_io_wait(const struct lu_env *env, >>struct cl_sync_io *anchor, >> CERROR("IO failed: %d, still wait for %d remaining entries\n", >> rc, atomic_read(&anchor->csi_sync_nr)); >>=20 >>- lwi =3D (struct l_wait_info) { 0 }; >>- (void)l_wait_event(anchor->csi_waitq, >>- atomic_read(&anchor->csi_sync_nr) =3D=3D 0, >>- &lwi); >>+ wait_event(anchor->csi_waitq, >>+ atomic_read(&anchor->csi_sync_nr) =3D=3D 0); >> } else { >> rc =3D anchor->csi_sync_rc; >> } >>diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c >>b/drivers/staging/lustre/lustre/obdclass/genops.c >>index b1d6ba4a3190..78f0fa1dff45 100644 >>--- a/drivers/staging/lustre/lustre/obdclass/genops.c >>+++ b/drivers/staging/lustre/lustre/obdclass/genops.c >>@@ -1237,12 +1237,10 @@ static int obd_zombie_is_idle(void) >> */ >> void obd_zombie_barrier(void) >> { >>- struct l_wait_info lwi =3D { 0 }; >>- >> if (obd_zombie_pid =3D=3D current_pid()) >> /* don't wait for myself */ >> return; >>- l_wait_event(obd_zombie_waitq, obd_zombie_is_idle(), &lwi); >>+ wait_event(obd_zombie_waitq, obd_zombie_is_idle()); >> } >> EXPORT_SYMBOL(obd_zombie_barrier); >>=20 >>@@ -1257,10 +1255,8 @@ static int obd_zombie_impexp_thread(void *unused) >> obd_zombie_pid =3D current_pid(); >>=20 >> while (!test_bit(OBD_ZOMBIE_STOP, &obd_zombie_flags)) { >>- struct l_wait_info lwi =3D { 0 }; >>- >>- l_wait_event(obd_zombie_waitq, >>- !obd_zombie_impexp_check(NULL), &lwi); >>+ wait_event_noload(obd_zombie_waitq, >>+ !obd_zombie_impexp_check(NULL)); >> obd_zombie_impexp_cull(); >>=20 >> /* >>@@ -1593,7 +1589,6 @@ static inline bool obd_mod_rpc_slot_avail(struct >>client_obd *cli, >> u16 obd_get_mod_rpc_slot(struct client_obd *cli, __u32 opc, >> struct lookup_intent *it) >> { >>- struct l_wait_info lwi =3D LWI_INTR(NULL, NULL); >> bool close_req =3D false; >> u16 i, max; >>=20 >>@@ -1631,8 +1626,8 @@ u16 obd_get_mod_rpc_slot(struct client_obd *cli, >>__u32 opc, >> CDEBUG(D_RPCTRACE, "%s: sleeping for a modify RPC slot opc %u, max >>%hu\n", >> cli->cl_import->imp_obd->obd_name, opc, max); >>=20 >>- l_wait_event(cli->cl_mod_rpcs_waitq, >>- obd_mod_rpc_slot_avail(cli, close_req), &lwi); >>+ wait_event(cli->cl_mod_rpcs_waitq, >>+ obd_mod_rpc_slot_avail(cli, close_req)); >> } while (true); >> } >> EXPORT_SYMBOL(obd_get_mod_rpc_slot); >>diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c >>b/drivers/staging/lustre/lustre/osc/osc_cache.c >>index 5767ac2a7d16..d58a25a2a5b4 100644 >>--- a/drivers/staging/lustre/lustre/osc/osc_cache.c >>+++ b/drivers/staging/lustre/lustre/osc/osc_cache.c >>@@ -964,9 +964,8 @@ static int osc_extent_wait(const struct lu_env *env, >>struct osc_extent *ext, >> "%s: wait ext to %u timedout, recovery in progress?\n", >> cli_name(osc_cli(obj)), state); >>=20 >>- lwi =3D LWI_INTR(NULL, NULL); >>- rc =3D l_wait_event(ext->oe_waitq, extent_wait_cb(ext, state), >>- &lwi); >>+ wait_event(ext->oe_waitq, extent_wait_cb(ext, state)); >>+ rc =3D 0; >> } >> if (rc =3D=3D 0 && ext->oe_rc < 0) >> rc =3D ext->oe_rc; >>diff --git a/drivers/staging/lustre/lustre/osc/osc_object.c >>b/drivers/staging/lustre/lustre/osc/osc_object.c >>index f82c87a77550..1de25496a7d9 100644 >>--- a/drivers/staging/lustre/lustre/osc/osc_object.c >>+++ b/drivers/staging/lustre/lustre/osc/osc_object.c >>@@ -454,12 +454,10 @@ struct lu_object *osc_object_alloc(const struct >>lu_env *env, >>=20 >> int osc_object_invalidate(const struct lu_env *env, struct osc_object >>*osc) >> { >>- struct l_wait_info lwi =3D { 0 }; >>- >> CDEBUG(D_INODE, "Invalidate osc object: %p, # of active IOs: %d\n", >> osc, atomic_read(&osc->oo_nr_ios)); >>=20 >>- l_wait_event(osc->oo_io_waitq, !atomic_read(&osc->oo_nr_ios), &lwi); >>+ wait_event(osc->oo_io_waitq, !atomic_read(&osc->oo_nr_ios)); >>=20 >> /* Discard all dirty pages of this object. */ >> osc_cache_truncate_start(env, osc, 0, NULL); >>diff --git a/drivers/staging/lustre/lustre/ptlrpc/pinger.c >>b/drivers/staging/lustre/lustre/ptlrpc/pinger.c >>index fe6b47bfe8be..4148a6661dcf 100644 >>--- a/drivers/staging/lustre/lustre/ptlrpc/pinger.c >>+++ b/drivers/staging/lustre/lustre/ptlrpc/pinger.c >>@@ -291,7 +291,6 @@ static struct ptlrpc_thread pinger_thread; >>=20 >> int ptlrpc_start_pinger(void) >> { >>- struct l_wait_info lwi =3D { 0 }; >> struct task_struct *task; >> int rc; >>=20 >>@@ -310,8 +309,8 @@ int ptlrpc_start_pinger(void) >> CERROR("cannot start pinger thread: rc =3D %d\n", rc); >> return rc; >> } >>- l_wait_event(pinger_thread.t_ctl_waitq, >>- thread_is_running(&pinger_thread), &lwi); >>+ wait_event(pinger_thread.t_ctl_waitq, >>+ thread_is_running(&pinger_thread)); >>=20 >> return 0; >> } >>@@ -320,7 +319,6 @@ static int ptlrpc_pinger_remove_timeouts(void); >>=20 >> int ptlrpc_stop_pinger(void) >> { >>- struct l_wait_info lwi =3D { 0 }; >> int rc =3D 0; >>=20 >> if (thread_is_init(&pinger_thread) || >>@@ -331,8 +329,8 @@ int ptlrpc_stop_pinger(void) >> thread_set_flags(&pinger_thread, SVC_STOPPING); >> wake_up(&pinger_thread.t_ctl_waitq); >>=20 >>- l_wait_event(pinger_thread.t_ctl_waitq, >>- thread_is_stopped(&pinger_thread), &lwi); >>+ wait_event(pinger_thread.t_ctl_waitq, >>+ thread_is_stopped(&pinger_thread)); >>=20 >> return rc; >> } >>diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c >>b/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c >>index d85c8638c009..e4197a60d1e2 100644 >>--- a/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c >>+++ b/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c >>@@ -197,7 +197,6 @@ static int sec_gc_main(void *arg) >>=20 >> int sptlrpc_gc_init(void) >> { >>- struct l_wait_info lwi =3D { 0 }; >> struct task_struct *task; >>=20 >> mutex_init(&sec_gc_mutex); >>@@ -214,18 +213,16 @@ int sptlrpc_gc_init(void) >> return PTR_ERR(task); >> } >>=20 >>- l_wait_event(sec_gc_thread.t_ctl_waitq, >>- thread_is_running(&sec_gc_thread), &lwi); >>+ wait_event(sec_gc_thread.t_ctl_waitq, >>+ thread_is_running(&sec_gc_thread)); >> return 0; >> } >>=20 >> void sptlrpc_gc_fini(void) >> { >>- struct l_wait_info lwi =3D { 0 }; >>- >> thread_set_flags(&sec_gc_thread, SVC_STOPPING); >> wake_up(&sec_gc_thread.t_ctl_waitq); >>=20 >>- l_wait_event(sec_gc_thread.t_ctl_waitq, >>- thread_is_stopped(&sec_gc_thread), &lwi); >>+ wait_event(sec_gc_thread.t_ctl_waitq, >>+ thread_is_stopped(&sec_gc_thread)); >> } >>diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c >>b/drivers/staging/lustre/lustre/ptlrpc/service.c >>index 63be6e7273f3..d688cb3ff157 100644 >>--- a/drivers/staging/lustre/lustre/ptlrpc/service.c >>+++ b/drivers/staging/lustre/lustre/ptlrpc/service.c >>@@ -2233,7 +2233,7 @@ static int ptlrpc_hr_main(void *arg) >> wake_up(&ptlrpc_hr.hr_waitq); >>=20 >> while (!ptlrpc_hr.hr_stopping) { >>- l_wait_condition(hrt->hrt_waitq, hrt_dont_sleep(hrt, &replies)); >>+ wait_event_noload(hrt->hrt_waitq, hrt_dont_sleep(hrt, &replies)); >>=20 >> while (!list_empty(&replies)) { >> struct ptlrpc_reply_state *rs; >>@@ -2312,7 +2312,6 @@ static int ptlrpc_start_hr_threads(void) >>=20 >> static void ptlrpc_svcpt_stop_threads(struct ptlrpc_service_part *svcpt) >> { >>- struct l_wait_info lwi =3D { 0 }; >> struct ptlrpc_thread *thread; >> LIST_HEAD(zombie); >>=20 >>@@ -2341,8 +2340,8 @@ static void ptlrpc_svcpt_stop_threads(struct >>ptlrpc_service_part *svcpt) >>=20 >> CDEBUG(D_INFO, "waiting for stopping-thread %s #%u\n", >> svcpt->scp_service->srv_thread_name, thread->t_id); >>- l_wait_event(thread->t_ctl_waitq, >>- thread_is_stopped(thread), &lwi); >>+ wait_event(thread->t_ctl_waitq, >>+ thread_is_stopped(thread)); >>=20 >> spin_lock(&svcpt->scp_lock); >> } >>@@ -2403,7 +2402,6 @@ int ptlrpc_start_threads(struct ptlrpc_service *svc) >>=20 >> int ptlrpc_start_thread(struct ptlrpc_service_part *svcpt, int wait) >> { >>- struct l_wait_info lwi =3D { 0 }; >> struct ptlrpc_thread *thread; >> struct ptlrpc_service *svc; >> struct task_struct *task; >>@@ -2499,9 +2497,8 @@ int ptlrpc_start_thread(struct ptlrpc_service_part >>*svcpt, int wait) >> if (!wait) >> return 0; >>=20 >>- l_wait_event(thread->t_ctl_waitq, >>- thread_is_running(thread) || thread_is_stopped(thread), >>- &lwi); >>+ wait_event(thread->t_ctl_waitq, >>+ thread_is_running(thread) || thread_is_stopped(thread)); >>=20 >> rc =3D thread_is_stopped(thread) ? thread->t_id : 0; >> return rc; >> >> >>_______________________________________________ >>lustre-devel mailing list >>lustre-devel@lists.lustre.org >>http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG8Yp69OQ2HB7X0l6Oeye3VZigbkFAlo4NREACgkQOeye3VZi gbmHGg//RxpWKPhzZ3YYXxjuwlv+Hw9GCUa+UyYxqZwY9iTK302P/U0387z6JTtw Lw2BZPE7wYzh2jJNIzVoA6RAlxkD/CJ/UfxNUpXn3Vtk0dSXurSaHLEcS/7Wd7hy wwVQfYBOXj4D+o5xTqSx/imDXV6qEu7YxmFZrJRItsc9fBZslbG+43Y31jCsq5K+ NLLeEi0KWzwpovTh2K/UNMjF10LfZrWevGi3cOaY8rdn9N6t7X2ucuZc54XKa6WJ V3hF/UJfbBIDAtkzZA8y0UffyDaIYL60bAq0PcthJer8Oap7u3cP7FOb7FK7rGjp 2f4UGyvoSRAoS3U00O0GkwYQaY2TtzpquZoJxivRqDHnMKEHFqt7e7o2W5bsTYz0 Rz9/j67OrFwD8cJaepqkUe3VZ31mh3sbtlWYvWZcdG/Qv8bzfx2ex2853h3NSowH a2+f6pXybnklOBo3uf94jazotZgrL4Bdprps2DipA+zzETvUtDgoqTOMXGKJm8Qk rglBdtCO0XwxyxRqNAqz6Jz0JSBxH6q1Mnbvt9F2uYmkNIjWa8pXTNAh0ByXlYvF 6CRwvn6awTfLhOBGGDFfog9D3b0h+fgw9Q8G8ohClsJCzehyNqdgRKQBWFjH5Hhe nilEpKCIhDPYrnVnhFDNXS3SOTcWg1pm9jsijXSNBHt4YX/k99k= =Z9Pf -----END PGP SIGNATURE----- --=-=-=--