From: Ian Campbell Subject: Re: Crashing kernel with dom0/libxc gnttab/gntshr Date: Fri, 2 Aug 2013 15:10:33 +0100 Message-ID: <1375452633.10660.103.camel@kazak.uk.xensource.com> References: <51F79A58.5060004@citrix.com> <1375181944.11701.102.camel@kazak.uk.xensource.com> <51F7C280.6040703@luminar.eu.org> <51F7E0AE.4060605@luminar.eu.org> <51F7F0BE.1040503@citrix.com> <51F82A23.2030209@tycho.nsa.gov> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: Daniel De Graaf , xen-devel@lists.xen.org, David Vrabel , Jeremy Fitzhardinge , Vincent Bernardoff List-Id: xen-devel@lists.xenproject.org On Fri, 2013-08-02 at 14:50 +0100, Stefano Stabellini wrote: > On Tue, 30 Jul 2013, Daniel De Graaf wrote: > > On 07/30/2013 12:58 PM, David Vrabel wrote: > > [...] > > > > > > [ 902.729307] BUG: Bad page map in process vchan-node1 pte:12bfff167 > > > pmd:b9b5c067 > > > [ 902.729312] page:ffffea0004afffc0 count:1 mapcount:-1 mapping: > > > (null) index:0xffffffffffffffff > > > > > > I think this is the test for page_mapcount(page) < 0 in zap_pte_range(). > > > This has looked up the page using the PTE it is trying to clear. Has > > > it found the correct page? Since the MFN is currently mapped into the > > > same domain, has the m2p_override stuff confused the look up and it is > > > checking the grantee page not the granter? > > > > > > David > > > > I think something like this is happening, since while reproducing this > > on my test system, some linked list corruption was found that I believe > > to be the cause of this problem. The gnttab_map_refs function on PV uses > > m2p_add_override on the page, which threads page->lru to an > > m2p_overrides list. However, something else is using page->lru during > > the use of gntdev, as shown by the following debug patch: > > I have never managed to prove that something else is trying to use > page->lru while the m2p_override is using it. Isn't it very much dependent on the actual original owner of the page? A lot of these fields are free to use by the code which actually called alloc_page, but for a facility like the m2p_override which can consume pages from a variety of sources you'd need to be careful about what each of those callers was doing. Ian.