From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754456AbcK3C0r (ORCPT ); Tue, 29 Nov 2016 21:26:47 -0500 Received: from mga02.intel.com ([134.134.136.20]:28370 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753427AbcK3C02 (ORCPT ); Tue, 29 Nov 2016 21:26:28 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,719,1473145200"; d="scan'208";a="1065951868" Date: Wed, 30 Nov 2016 02:26:26 +0800 From: Ye Xiaolong To: "Paul E. McKenney" Cc: Sudeep Holla , Boris Zhmurov , Michal Hocko , Andrew Morton , Johannes Weiner , Vlastimil Babka , LKML , lkp@01.org Subject: Re: [lkp] [mm] e7c1db75fe: BUG:sleeping_function_called_from_invalid_context_at_mm/page_alloc.c Message-ID: <20161129182626.GA16489@yexl-desktop> References: <20161127181656.GD2501@yexl-desktop> <20161129191448.GD3924@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161129191448.GD3924@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/29, Paul E. McKenney wrote: >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 >> 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? I've queued test jobs for this patch, will let you know once I get the result. Thanks, Xiaolong > > Thanx, Paul > >------------------------------------------------------------------------ > >commit ccc0666e2049e5818c236e647cf20c552a7b053b >Author: Paul E. McKenney >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 > >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) > >