From: Ian Campbell Subject: Re: Crashing kernel with dom0/libxc gnttab/gntshr Date: Sat, 3 Aug 2013 11:06:21 +0100 Message-ID: <1375524381.15681.48.camel@dagon.hellion.org.uk> 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> <51FBE307.30101@goop.org> 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: Jeremy Fitzhardinge , Vincent Bernardoff , xen-devel@lists.xen.org, Daniel De Graaf , David Vrabel List-Id: xen-devel@lists.xenproject.org On Fri, 2013-08-02 at 18:02 +0100, Stefano Stabellini wrote: > On Fri, 2 Aug 2013, Jeremy Fitzhardinge wrote: > > On 08/02/2013 06:50 AM, Stefano Stabellini wrote: > > > Jeremy, at the time the code was written, you were pretty confident > > > that page->lru couldn't be used by anybody else. > > > Why was that? > > > > Hm. Probably the reasoning was that page->lru was only used for pages > > which in the pagecache, mapped from files, and m2p pages are never > > mapped from files. But maybe something else has decided to use lru for > > non-mapped pages (transparent hugepage? page dedup?), or are m2p pages > > getting into the pagecache somehow? > > > > I think it could be the latter. > For example we have recently changed QEMU not to use O_DIRECT on foreign > grants to work around a network bug in the kernel. > It might be possible that these pages end up in the pagecache after they > have been already added to the m2p. Vincent's test programs (one posted at the root of this thread and another a multiprocess version a few mails in) doesn't do any explicit I/O on the shared pages at all, it literally doesn't touch them. The test program is: allocate share map unmap crash The second version moves the map/unmap/crash into a separate process (achieved with fork). I suppose it might still be interesting to split into two completely separate executables to check for weird cross talk between share and map in related (i.e. parent-child) processes. I hope the gntshr interface locks pages down so that we aren't worrying about swapping etc, but this doesn't appear to be at all probabilistic in any case. Ian.