All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Wu <peter@lekensteyn.nl>
To: Don Zickus <dzickus@redhat.com>
Cc: mhocko@suse.cz, linux-kernel@vger.kernel.org,
	linux-watchdog@vger.kernel.org
Subject: Re: Writing watchdog_thresh triggers BUG: sleeping function called from invalid context
Date: Mon, 16 Jun 2014 22:58:44 +0200	[thread overview]
Message-ID: <1583331.cjuWMhE6Gz@al> (raw)
In-Reply-To: <20140616205245.GQ177152@redhat.com>

On Monday 16 June 2014 16:52:45 Don Zickus wrote:
> On Mon, Jun 16, 2014 at 04:12:44PM +0200, Peter Wu wrote:
> > Hi,
> > 
> > Writing to /proc/sys/kernel/watchdog_thresh causes the following BUG in
> > at least v3.13-rc2-625-g06151db, v3.15 and v3.16-rc1. Kernel config is
> > attached.
> > 
> > It was originally found on bare metal, since then reproduced in QEMU in
> > init, and when directly executing it.
> > 
> > Regards,
> > Peter
> 
> Hi Peter,
> 
> I assume the following patch will work?

Yes, the patch works (no more BUG). No idea whether it is
(in)correct though.

Regards,
Peter

> Michal, do you remember why we needed preempt here?  I wouldn't think it
> mattered as we are not doing anything per-cpu specific.
> 
> Cheers,
> Don
> 
> diff --git a/kernel/watchdog.c b/kernel/watchdog.c
> index 516203e..30e4822 100644
> --- a/kernel/watchdog.c
> +++ b/kernel/watchdog.c
> @@ -527,10 +527,8 @@ static void update_timers_all_cpus(void)
>  	int cpu;
>  
>  	get_online_cpus();
> -	preempt_disable();
>  	for_each_online_cpu(cpu)
>  		update_timers(cpu);
> -	preempt_enable();
>  	put_online_cpus();
>  }
>  


  reply	other threads:[~2014-06-16 20:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-16 14:12 Writing watchdog_thresh triggers BUG: sleeping function called from invalid context Peter Wu
2014-06-16 20:52 ` Don Zickus
2014-06-16 20:58   ` Peter Wu [this message]
2014-06-17  8:59   ` Michal Hocko

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=1583331.cjuWMhE6Gz@al \
    --to=peter@lekensteyn.nl \
    --cc=dzickus@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=mhocko@suse.cz \
    /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.