From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Fitzhardinge Subject: Re: [PATCH] Fix preemptible lazy mode bug Date: Thu, 23 Aug 2007 23:53:29 -0700 Message-ID: <46CE8069.9070404@goop.org> References: <46CE70C8.2030005@vmware.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <46CE70C8.2030005@vmware.com> Sender: linux-kernel-owner@vger.kernel.org To: Zachary Amsden Cc: Linus Torvalds , Linux Kernel Mailing List , Andrew Morton , Chris Wright , stable@kernel.org, Rusty Russell , Virtualization Mailing List , Andi Kleen List-Id: virtualization@lists.linuxfoundation.org Zachary Amsden wrote: > I recently sent off a fix for lazy vmalloc faults which can happen > under paravirt when lazy mode is enabled. Unfortunately, I jumped the > gun a bit on fixing this. I neglected to notice that since the new > call to flush the MMU update queue is called from the page fault > handler, it can be pre-empted. Both VMI and Xen use per-cpu variables > to track lazy mode state, as all previous calls to set, disable, or > flush lazy mode happened from a non-preemptable state. Hm. Doing any kind of lazy-state operation with preemption enabled is fundamentally meaningless. How does it get into a preemptable state with a lazy mode enabled now? If a sequence of code with preempt disabled touches a missing vmalloc mapping, it gets a fault to fix up the mapping, and the fault handler can end up preempting the thread? That sounds like a larger bug than just paravirt lazy mode problems. J