linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: Boris Zhmurov <bb@kernelpanic.ru>,
	Michal Hocko <mhocko@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	LKML <linux-kernel@vger.kernel.org>,
	lkp@01.org, kernel test robot <xiaolong.ye@intel.com>
Subject: Re: [lkp] [mm] e7c1db75fe: BUG:sleeping_function_called_from_invalid_context_at_mm/page_alloc.c
Date: Tue, 29 Nov 2016 11:14:48 -0800	[thread overview]
Message-ID: <20161129191448.GD3924@linux.vnet.ibm.com> (raw)
In-Reply-To: <CAPKp9uYFmkiWn9uuPjNLFADP0qrqrpArecuKjNku5X72TyJpzg@mail.gmail.com>

On Tue, Nov 29, 2016 at 05:21:19PM +0000, Sudeep Holla wrote:
> On Sun, Nov 27, 2016 at 6:16 PM, kernel test robot
> <xiaolong.ye@intel.com> wrote:
> >
> > FYI, we noticed the following commit:
> >
> > commit e7c1db75fed821a961ce1ca2b602b08e75de0cd8 ("mm: Prevent __alloc_pages_nodemask() RCU CPU stall warnings")
> > https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git rcu/next
> >
> > in testcase: boot
> >
> > on test machine: qemu-system-x86_64 -enable-kvm -cpu Nehalem -smp 2 -m 1G
> >
> > caused below changes:
> >
> [...]
> 
> > [    8.953192] BUG: sleeping function called from invalid context at mm/page_alloc.c:3746
> > [    8.956353] in_atomic(): 1, irqs_disabled(): 1, pid: 0, name: swapper/0
> 
> I am observing similar BUG/backtrace even on ARM64 platform.

Does the (untested) patch below help?

							Thanx, Paul

------------------------------------------------------------------------

commit ccc0666e2049e5818c236e647cf20c552a7b053b
Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Date:   Tue Nov 29 11:06:05 2016 -0800

    rcu: Allow boot-time use of cond_resched_rcu_qs()
    
    The cond_resched_rcu_qs() macro is used to force RCU quiescent states into
    long-running in-kernel loops.  However, some of these loops can execute
    during early boot when interrupts are disabled, and during which time
    it is therefore illegal to enter the scheduler.  This commit therefore
    makes cond_resched_rcu_qs() be a no-op during early boot.
    
    Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 525ca34603b7..8b4b1be8095b 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -423,7 +423,7 @@ extern struct srcu_struct tasks_rcu_exit_srcu;
  */
 #define cond_resched_rcu_qs() \
 do { \
-	if (!cond_resched()) \
+	if (rcu_scheduler_active && !cond_resched()) \
 		rcu_note_voluntary_context_switch(current); \
 } while (0)
 

  reply	other threads:[~2016-11-29 19:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-27 18:16 [lkp] [mm] e7c1db75fe: BUG:sleeping_function_called_from_invalid_context_at_mm/page_alloc.c kernel test robot
2016-11-29 17:21 ` Sudeep Holla
2016-11-29 19:14   ` Paul E. McKenney [this message]
2016-11-29 18:26     ` Ye Xiaolong
2016-11-29 21:39     ` Ye Xiaolong
2016-11-30  6:27       ` [LKP] " Fengguang Wu
2016-11-30  7:16     ` Michal Hocko
2016-11-30  7:40       ` Paul E. McKenney
2016-11-30 12:28         ` Sudeep Holla

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=20161129191448.GD3924@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=bb@kernelpanic.ru \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@01.org \
    --cc=mhocko@kernel.org \
    --cc=sudeep.holla@arm.com \
    --cc=vbabka@suse.cz \
    --cc=xiaolong.ye@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).