From: David Vrabel <david.vrabel@citrix.com>
To: Dave Scott <Dave.Scott@citrix.com>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: John Else <john.else@citrix.com>, Anil Madhavapeddy <anil@recoil.org>
Subject: Re: xc_gntshr_unmap problems (BUG(s) in xen-gntalloc?)
Date: Tue, 2 Sep 2014 14:55:55 +0100 [thread overview]
Message-ID: <5405CC6B.4070400@citrix.com> (raw)
In-Reply-To: <F0EB113C-7B3B-4B75-9E54-B5B7CE5AADC9@citrix.com>
On 27/08/14 22:33, Dave Scott wrote:
> Hi,
>
> I've been playing with gntshr (as used by libvchan) and have noticed a
> few problems. Firstly if I use xc_gntshr_share_pages to share > 1 page
> then it seems to leak after xc_gntshr_munmap:
[...]
> ... subsequent runs fail earlier and earlier. I added some printf debugging
> and noticed that the address returned by xc_gntshr_share_pages was decreasing
> by 0x1000 per iteration, suggesting that the xc_gntshr_munmap was unmapping
> the first page but missing the second.
FYI, there's a kernel fix 243082e0d59f (xen/gntalloc: fix reference
counts on multi-page mappings) for multi-page mappings which is included
in 3.3 and later.
> [ 148.564340] Pid: 897, comm: test-gnt Not tainted 3.2.0-67-generic #101-Ubuntu
> [ 148.564348] RIP: e030:[<ffffffff813acf93>] [<ffffffff813acf93>] gnttab_query_foreign_access+0x13/0x20
[...]
> [ 148.564452] Call Trace:
> [ 148.564459] [<ffffffffa000d1a5>] ? __del_gref+0x105/0x150 [xen_gntalloc]
> [ 148.564465] [<ffffffff813adbdb>] ? gnttab_grant_foreign_access+0x2b/0x80
> [ 148.564471] [<ffffffffa000d848>] add_grefs+0x1c8/0x2b0 [xen_gntalloc]
> [ 148.564478] [<ffffffffa000da28>] gntalloc_ioctl_alloc+0xf8/0x160 [xen_gntalloc]
> [ 148.564485] [<ffffffffa000dae0>] gntalloc_ioctl+0x50/0x64 [xen_gntalloc]
> [ 148.564492] [<ffffffff8118d45a>] do_vfs_ioctl+0x8a/0x340
> [ 148.564498] [<ffffffff811456b3>] ? do_munmap+0x1f3/0x2f0
> [ 148.564504] [<ffffffff8118d7a1>] sys_ioctl+0x91/0xa0
> [ 148.564510] [<ffffffff8166bd42>] system_call_fastpath+0x16/0x1b
This happens if the allocate ioctl fails because there are no more grant
references. This happened in your case because of the bug in 3.2 (see
above). But it is triggerable in 3.17-rc3 if you increase the gntalloc
limit (via the module parameter) or if you plug in a lots of VIFs/VBDs etc.
I'll send patches to the list shortly.
David
prev parent reply other threads:[~2014-09-02 14:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-27 21:33 xc_gntshr_unmap problems (BUG(s) in xen-gntalloc?) Dave Scott
2014-08-28 13:50 ` David Vrabel
2014-08-29 12:40 ` Dave Scott
2014-08-29 14:05 ` David Vrabel
2014-08-29 16:46 ` Dave Scott
2014-08-29 21:15 ` Dave Scott
2014-09-01 10:19 ` David Vrabel
2014-09-02 9:13 ` Dave Scott
2014-09-02 13:55 ` David Vrabel [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5405CC6B.4070400@citrix.com \
--to=david.vrabel@citrix.com \
--cc=Dave.Scott@citrix.com \
--cc=anil@recoil.org \
--cc=john.else@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).