From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Liu Subject: Re: [PATCHv5 12/14] xen-blkback: safely unmap grants in case they are still in use Date: Mon, 09 Mar 2015 20:36:51 +0800 Message-ID: <54FD93E3.3030506@oracle.com> References: <1422377057-19221-1-git-send-email-david.vrabel@citrix.com> <1422377057-19221-13-git-send-email-david.vrabel@citrix.com> <54FD6331.8040503@oracle.com> <54FD6831.5020700@citrix.com> <54FD7B49.7080401@oracle.com> <54FD7DC8.60401@citrix.com> <54FD8293.9000405@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YUwve-0008JZ-9j for xen-devel@lists.xenproject.org; Mon, 09 Mar 2015 12:37:02 +0000 In-Reply-To: <54FD8293.9000405@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: =?windows-1252?Q?Roger_Pau_Monn=E9?= Cc: xen-devel@lists.xenproject.org, Boris Ostrovsky , Jenny Herbert , David Vrabel List-Id: xen-devel@lists.xenproject.org On 03/09/2015 07:22 PM, Roger Pau Monn=E9 wrote: > El 09/03/15 a les 12.02, David Vrabel ha escrit: >> On 09/03/15 10:51, Bob Liu wrote: >>> >>> On 03/09/2015 05:30 PM, David Vrabel wrote: >>>> On 09/03/15 09:09, Bob Liu wrote: >>>>> Hi David, >>>>> >>>>> Recently I met an issue which is likely related with this patch. It >>>>> happened when running block benchmark on domU, the backend was an iSC= SI >>>>> disk connected to dom0. I got below panic at put_page_testzero() on >>>>> dom0, at that time the ixgbe network card was freeing skb pages in >>>>> __skb_frag_unref() but the page->_count was already 0. >>>>> Do you think is it possiable that page was already freed by blkback? >>>> >>>> It's possible, but in this case I think the blkback device must have >>>> been destroyed for this to have happened, because blkback doesn't free >>>> the pages until it is destroyed. >>>> >>> >>> Sorry, I didn't get the point here, doesn't bio_complete free pages? >>> E.g. >>> __end_block_io_op() > xen_blkbk_unmap_and_respond() > put_free_pages() >>> Then shrink_free_pagepool() free the page finally. >> >> Ug. That's all the persistent grant stuff I'm not very familiar with. >> Perhaps Roger can comment? > = > This is the cache of ballooned-out pages that's used to map grants, it's > not directly related to persistent grants. From time to time the buffer > of ballooned-out pages is checked and maybe some of them are freed if > the amount is too high, but at that point the grant has already been > unmapped, so it would fail anyway if someone tried to access that page. > = >> >>> I'm worry about there may be race condition some place and caused this >>> panic, but it's hard to locate. It may exist in xen-blkback/grant or >>> even the ixgbe network driver itself. >> >> Actually, freeing the page in blkback early shouldn't cause this sort of >> thing anyway, since the skb should hold additional refs to the pages. > = > Yes. Blkback only unmaps the page when the bio is done, so the problem > might be that the network driver marks the bio as done and tries to > access it later? > = Okay, I'll look at the network card driver. Thank for all your help! -- = Regards, -Bob