From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Teigland Date: Tue, 22 Aug 2017 13:21:02 -0500 Subject: [Cluster-devel] [PATCH 10/17] dlm: use schedule_timeout instead of schedule in dlm_recoverd In-Reply-To: <358547de27294c7596788437f652d734@TGXML394.toshiba.local> References: <03ef32c625f94c02b5f57cfe2794450a@TGXML394.toshiba.local> <20170809161851.GC21204@redhat.com> <358547de27294c7596788437f652d734@TGXML394.toshiba.local> Message-ID: <20170822182102.GA20358@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Thu, Aug 17, 2017 at 11:40:13PM +0000, tsutomu.owa at toshiba.co.jp wrote: > If you refer to other implementations in kernel, the following > modifications may be better. > The important thing is to call kthread_should_stop() after > set_current_state(TASK_INTERRUPTIBLE). How is this fix? Thanks, I prefer this. Perhaps put that explanation in a comment, e.g. > --- fs/dlm/recoverd.c.orig 2017-08-10 16:42:31.131296351 +0900 > +++ fs/dlm/recoverd.c 2017-08-10 16:43:22.483295232 +0900 > @@ -287,8 +287,10 @@ > set_bit(LSFL_RECOVER_LOCK, &ls->ls_flags); > wake_up(&ls->ls_recover_lock_wait); > > - while (!kthread_should_stop()) { > + while (1) { /* call kthread_should_stop() after set_current_state() / > set_current_state(TASK_INTERRUPTIBLE); > + if (kthread_should_stop()) > + break; > if (!test_bit(LSFL_RECOVER_WORK, &ls->ls_flags) && > !test_bit(LSFL_RECOVER_DOWN, &ls->ls_flags)) > schedule(); >