Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932171Ab2K0RA0 (ORCPT ); Tue, 27 Nov 2012 12:00:26 -0500 Received: from e32.co.us.ibm.com ([32.97.110.150]:55242 "EHLO e32.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756397Ab2K0RAY (ORCPT ); Tue, 27 Nov 2012 12:00:24 -0500 Date: Tue, 27 Nov 2012 08:59:58 -0800 From: "Paul E. McKenney" To: Frederic Weisbecker Cc: Gleb Natapov , Li Zhong , linux-next list , LKML , sasha.levin@oracle.com, avi@redhat.com Subject: Re: [RFC PATCH] Fix abnormal rcu dynticks_nesting values related to async page fault Message-ID: <20121127165958.GI2474@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <1353993325.14050.49.camel@ThinkPad-T5421.cn.ibm.com> <20121127154455.GK12969@redhat.com> <20121127161925.GG2474@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12112717-5406-0000-0000-000002711B1D Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1679 Lines: 39 On Tue, Nov 27, 2012 at 05:48:18PM +0100, Frederic Weisbecker wrote: > 2012/11/27 Paul E. McKenney : > > On Tue, Nov 27, 2012 at 04:56:30PM +0100, Frederic Weisbecker wrote: > >> 2012/11/27 Gleb Natapov : > >> > For KVM_PV_REASON_PAGE_NOT_PRESENT it behaves like an exception. > >> > >> Ok. > >> There seem to be a bug in kvm_async_pf_task_wait(). Using > >> idle_cpu(cpu) to find out if the current task is the idle task may not > >> work if there is pending wake up. Me may schedule another task but > >> when that other task sleeps later we can't schedule back to idle until > >> the fault is completed. > >> > >> The right way is to use is_idle_task(current) > > > > Agreed. But if you instead need to figure out whether or not RCU believes > > that the CPU is idle, use rcu_is_cpu_idle(). You need to figure out > > whether or not RCU believes that the CPU is idle if you are trying to > > play fast and loose with rcu_irq_enter() and rcu_irq_exit(). > > Right. I was referring to another problem though. They don't want to > schedule on the following cases: > > 1) preemption disabled, of course. > 3) we are in the idle task. Because if we want to sleep in order to > wait for the page fault completion, we need to be able to schedule the > idle task. But we are already the idle task. > > Now idle_cpu(cpu) is the wrong check for that. Fair enough! ;-) Thanx, Paul -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/