Re: [Xen-devel] [PATCH] xen-blkback: free requests on disconnection
From: Julien Grall
Date: Mon Sep 07 2015 - 07:22:44 EST
On 07/09/15 07:07, Bob Liu wrote:
> Hi Julien,
> On 09/04/2015 09:51 PM, Julien Grall wrote:
>> Hi Roger,
>> On 04/09/15 11:08, Roger Pau Monne wrote:
>>> Request allocation has been moved to connect_ring, which is called every
>>> time blkback connects to the frontend (this can happen multiple times during
>>> a blkback instance life cycle). On the other hand, request freeing has not
>>> been moved, so it's only called when destroying the backend instance. Due to
>>> this mismatch, blkback can allocate the request pool multiple times, without
>>> freeing it.
>>> In order to fix it, move the freeing of requests to xen_blkif_disconnect to
>>> restore the symmetry between request allocation and freeing.
>>> Reported-by: Julien Grall <julien.grall@xxxxxxxxxx>
>>> Signed-off-by: Roger Pau MonnÃ <roger.pau@xxxxxxxxxx>
>>> Cc: Julien Grall <julien.grall@xxxxxxxxxx>
>>> Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
>>> Cc: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
>>> Cc: David Vrabel <david.vrabel@xxxxxxxxxx>
>>> Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
>> The patch is fixing my problem when using UEFI in the guest. Thank you!
> Could you please explain the problem you met a bit more?
> So that I can know back port this patch if met similar issue.
This is related to commit 86839c56dee28c315a4c19b7bfee450ccd84cd25
"xen/block: add multi-page ring support" (Roger, it may be worth to
indicate the offending commit in you commit message).
When starting a guest using UEFI. After the domain is destroyed I get
the following warning from blkback:
------------[ cut here ]------------
WARNING: CPU: 2 PID: 95 at
Modules linked in:
CPU: 2 PID: 95 Comm: kworker/2:1 Tainted: G W 4.2.0 #85
Hardware name: APM X-Gene Mustang board (DT)
Workqueue: events xen_blkif_deferred_free
---[ end trace 6f859b7883c88cdd ]---
This is because the allocation of the requests are done during the
connection but the free is done when the domain is destroyed. Therefore
if the domain is re-initializing the connection (because UEFI or PV Grub
is used), the request won't be free and kept until the end.
So I think this should be backported in Linux 4.2 where the patch has
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/