diff options
author | Chang Huaixin <huaixin.chx@alibaba-inc.com> | 2014-10-16 16:33:24 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2014-10-16 16:37:57 -0400 |
commit | 4d544e3bdb12f8e48f61e7f2270b253a48c69e00 (patch) | |
tree | f5fef7fc107d9eefc13afc01c6db9ad50810c57f | |
parent | b0cfb794a3dd1d699f3e453f9180bd06508fb8f0 (diff) |
Input: xen-kbdfront - free grant table entry in xenkbd_disconnect_backend
xenkbd_disconnect_backend doesn't free grant table entry. This bug affects
live migration.
xenkbd_disconnect_backend uses gnttab_end_foreign_access_ref to handle
grant table entry which doesn't really free an entry.
Thus every time we do xenkbd_resume, grant table entry increses by one. As
an grant table entry occupies 8 bytes, an grant table page has at most 512
entries. Every 512 times we do xenkdb_resume, grant table pages increses by
one.
After around 3500 times of live migration, grant table pages will increase
by 7, causing too many pages to populate and hitting max_pages limit when
assigning pages.Thus assign_pages will fail, so will live migration.
Signed-off-by: Chang Huaixin <huaixin.chx@alibaba-inc.com>
Acked-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r-- | drivers/input/misc/xen-kbdfront.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/input/misc/xen-kbdfront.c b/drivers/input/misc/xen-kbdfront.c index fbfdc10573be..e2ecfc6e633d 100644 --- a/drivers/input/misc/xen-kbdfront.c +++ b/drivers/input/misc/xen-kbdfront.c | |||
@@ -285,7 +285,7 @@ static int xenkbd_connect_backend(struct xenbus_device *dev, | |||
285 | error_evtchan: | 285 | error_evtchan: |
286 | xenbus_free_evtchn(dev, evtchn); | 286 | xenbus_free_evtchn(dev, evtchn); |
287 | error_grant: | 287 | error_grant: |
288 | gnttab_end_foreign_access_ref(info->gref, 0); | 288 | gnttab_end_foreign_access(info->gref, 0, 0UL); |
289 | info->gref = -1; | 289 | info->gref = -1; |
290 | return ret; | 290 | return ret; |
291 | } | 291 | } |
@@ -296,7 +296,7 @@ static void xenkbd_disconnect_backend(struct xenkbd_info *info) | |||
296 | unbind_from_irqhandler(info->irq, info); | 296 | unbind_from_irqhandler(info->irq, info); |
297 | info->irq = -1; | 297 | info->irq = -1; |
298 | if (info->gref >= 0) | 298 | if (info->gref >= 0) |
299 | gnttab_end_foreign_access_ref(info->gref, 0); | 299 | gnttab_end_foreign_access(info->gref, 0, 0UL); |
300 | info->gref = -1; | 300 | info->gref = -1; |
301 | } | 301 | } |
302 | 302 | ||