All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Teigland <teigland@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 10/17] dlm: use schedule_timeout instead of schedule in dlm_recoverd
Date: Wed, 9 Aug 2017 11:18:51 -0500	[thread overview]
Message-ID: <20170809161851.GC21204@redhat.com> (raw)
In-Reply-To: <03ef32c625f94c02b5f57cfe2794450a@TGXML394.toshiba.local>

On Wed, Aug 09, 2017 at 05:51:01AM +0000, tsutomu.owa at toshiba.co.jp wrote:
> When dlm_recoverd_stop() is called between kthread_should_stop() and
> set_task_state(), dlm_recoverd will not wake up.

This works, but have you looked elsewhere in the kernel for kthread
examples we could copy that do a race-free check without a timeout?
Thanks

> 
> Signed-off-by: Tadashi Miyauchi <miyauchi@toshiba-tops.co.jp>
> Signed-off-by: Tsutomu Owa <tsutomu.owa@toshiba.co.jp>
> ---
>  fs/dlm/recoverd.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/dlm/recoverd.c b/fs/dlm/recoverd.c
> index 6859b4b..d3956cc 100644
> --- a/fs/dlm/recoverd.c
> +++ b/fs/dlm/recoverd.c
> @@ -276,6 +276,7 @@ static void do_ls_recovery(struct dlm_ls *ls)
>  static int dlm_recoverd(void *arg)
>  {
>  	struct dlm_ls *ls;
> +	unsigned long timeout = (dlm_config.ci_recover_timer * HZ) >> 1;
>  
>  	ls = dlm_find_lockspace_local(arg);
>  	if (!ls) {
> @@ -291,7 +292,7 @@ static int dlm_recoverd(void *arg)
>  		set_current_state(TASK_INTERRUPTIBLE);
>  		if (!test_bit(LSFL_RECOVER_WORK, &ls->ls_flags) &&
>  		    !test_bit(LSFL_RECOVER_DOWN, &ls->ls_flags))
> -			schedule();
> +			schedule_timeout(timeout);
>  		set_current_state(TASK_RUNNING);
>  
>  		if (test_and_clear_bit(LSFL_RECOVER_DOWN, &ls->ls_flags)) {
> -- 
> 2.7.4
> 
> 
> 



  reply	other threads:[~2017-08-09 16:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-09  5:51 [Cluster-devel] [PATCH 10/17] dlm: use schedule_timeout instead of schedule in dlm_recoverd tsutomu.owa
2017-08-09 16:18 ` David Teigland [this message]
2017-08-17 23:40   ` tsutomu.owa
2017-08-22 18:21     ` David Teigland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170809161851.GC21204@redhat.com \
    --to=teigland@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.