virtio_balloon.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. /*
  2. * Virtio balloon implementation, inspired by Dor Laor and Marcelo
  3. * Tosatti's implementations.
  4. *
  5. * Copyright 2008 Rusty Russell IBM Corporation
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. #include <linux/virtio.h>
  22. #include <linux/virtio_balloon.h>
  23. #include <linux/swap.h>
  24. #include <linux/kthread.h>
  25. #include <linux/freezer.h>
  26. #include <linux/delay.h>
  27. #include <linux/slab.h>
  28. #include <linux/module.h>
  29. #include <linux/balloon_compaction.h>
  30. #include <linux/oom.h>
  31. #include <linux/wait.h>
  32. /*
  33. * Balloon device works in 4K page units. So each page is pointed to by
  34. * multiple balloon pages. All memory counters in this driver are in balloon
  35. * page units.
  36. */
  37. #define VIRTIO_BALLOON_PAGES_PER_PAGE (unsigned)(PAGE_SIZE >> VIRTIO_BALLOON_PFN_SHIFT)
  38. #define VIRTIO_BALLOON_ARRAY_PFNS_MAX 256
  39. #define OOM_VBALLOON_DEFAULT_PAGES 256
  40. #define VIRTBALLOON_OOM_NOTIFY_PRIORITY 80
  41. static int oom_pages = OOM_VBALLOON_DEFAULT_PAGES;
  42. module_param(oom_pages, int, S_IRUSR | S_IWUSR);
  43. MODULE_PARM_DESC(oom_pages, "pages to free on OOM");
  44. struct virtio_balloon {
  45. struct virtio_device *vdev;
  46. struct virtqueue *inflate_vq, *deflate_vq, *stats_vq;
  47. /* Where the ballooning thread waits for config to change. */
  48. wait_queue_head_t config_change;
  49. /* The thread servicing the balloon. */
  50. struct task_struct *thread;
  51. /* Waiting for host to ack the pages we released. */
  52. wait_queue_head_t acked;
  53. /* Number of balloon pages we've told the Host we're not using. */
  54. unsigned int num_pages;
  55. /*
  56. * The pages we've told the Host we're not using are enqueued
  57. * at vb_dev_info->pages list.
  58. * Each page on this list adds VIRTIO_BALLOON_PAGES_PER_PAGE
  59. * to num_pages above.
  60. */
  61. struct balloon_dev_info vb_dev_info;
  62. /* Synchronize access/update to this struct virtio_balloon elements */
  63. struct mutex balloon_lock;
  64. /* The array of pfns we tell the Host about. */
  65. unsigned int num_pfns;
  66. u32 pfns[VIRTIO_BALLOON_ARRAY_PFNS_MAX];
  67. /* Memory statistics */
  68. int need_stats_update;
  69. struct virtio_balloon_stat stats[VIRTIO_BALLOON_S_NR];
  70. /* To register callback in oom notifier call chain */
  71. struct notifier_block nb;
  72. };
  73. static struct virtio_device_id id_table[] = {
  74. { VIRTIO_ID_BALLOON, VIRTIO_DEV_ANY_ID },
  75. { 0 },
  76. };
  77. static u32 page_to_balloon_pfn(struct page *page)
  78. {
  79. unsigned long pfn = page_to_pfn(page);
  80. BUILD_BUG_ON(PAGE_SHIFT < VIRTIO_BALLOON_PFN_SHIFT);
  81. /* Convert pfn from Linux page size to balloon page size. */
  82. return pfn * VIRTIO_BALLOON_PAGES_PER_PAGE;
  83. }
  84. static struct page *balloon_pfn_to_page(u32 pfn)
  85. {
  86. BUG_ON(pfn % VIRTIO_BALLOON_PAGES_PER_PAGE);
  87. return pfn_to_page(pfn / VIRTIO_BALLOON_PAGES_PER_PAGE);
  88. }
  89. static void balloon_ack(struct virtqueue *vq)
  90. {
  91. struct virtio_balloon *vb = vq->vdev->priv;
  92. wake_up(&vb->acked);
  93. }
  94. static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq)
  95. {
  96. struct scatterlist sg;
  97. unsigned int len;
  98. sg_init_one(&sg, vb->pfns, sizeof(vb->pfns[0]) * vb->num_pfns);
  99. /* We should always be able to add one buffer to an empty queue. */
  100. virtqueue_add_outbuf(vq, &sg, 1, vb, GFP_KERNEL);
  101. virtqueue_kick(vq);
  102. /* When host has read buffer, this completes via balloon_ack */
  103. wait_event(vb->acked, virtqueue_get_buf(vq, &len));
  104. }
  105. static void set_page_pfns(u32 pfns[], struct page *page)
  106. {
  107. unsigned int i;
  108. /* Set balloon pfns pointing at this page.
  109. * Note that the first pfn points at start of the page. */
  110. for (i = 0; i < VIRTIO_BALLOON_PAGES_PER_PAGE; i++)
  111. pfns[i] = page_to_balloon_pfn(page) + i;
  112. }
  113. static void fill_balloon(struct virtio_balloon *vb, size_t num)
  114. {
  115. struct balloon_dev_info *vb_dev_info = &vb->vb_dev_info;
  116. /* We can only do one array worth at a time. */
  117. num = min(num, ARRAY_SIZE(vb->pfns));
  118. mutex_lock(&vb->balloon_lock);
  119. for (vb->num_pfns = 0; vb->num_pfns < num;
  120. vb->num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) {
  121. struct page *page = balloon_page_enqueue(vb_dev_info);
  122. if (!page) {
  123. dev_info_ratelimited(&vb->vdev->dev,
  124. "Out of puff! Can't get %u pages\n",
  125. VIRTIO_BALLOON_PAGES_PER_PAGE);
  126. /* Sleep for at least 1/5 of a second before retry. */
  127. msleep(200);
  128. break;
  129. }
  130. set_page_pfns(vb->pfns + vb->num_pfns, page);
  131. vb->num_pages += VIRTIO_BALLOON_PAGES_PER_PAGE;
  132. adjust_managed_page_count(page, -1);
  133. }
  134. /* Did we get any? */
  135. if (vb->num_pfns != 0)
  136. tell_host(vb, vb->inflate_vq);
  137. mutex_unlock(&vb->balloon_lock);
  138. }
  139. static void release_pages_by_pfn(const u32 pfns[], unsigned int num)
  140. {
  141. unsigned int i;
  142. /* Find pfns pointing at start of each page, get pages and free them. */
  143. for (i = 0; i < num; i += VIRTIO_BALLOON_PAGES_PER_PAGE) {
  144. struct page *page = balloon_pfn_to_page(pfns[i]);
  145. adjust_managed_page_count(page, 1);
  146. put_page(page); /* balloon reference */
  147. }
  148. }
  149. static unsigned leak_balloon(struct virtio_balloon *vb, size_t num)
  150. {
  151. unsigned num_freed_pages;
  152. struct page *page;
  153. struct balloon_dev_info *vb_dev_info = &vb->vb_dev_info;
  154. /* We can only do one array worth at a time. */
  155. num = min(num, ARRAY_SIZE(vb->pfns));
  156. mutex_lock(&vb->balloon_lock);
  157. for (vb->num_pfns = 0; vb->num_pfns < num;
  158. vb->num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) {
  159. page = balloon_page_dequeue(vb_dev_info);
  160. if (!page)
  161. break;
  162. set_page_pfns(vb->pfns + vb->num_pfns, page);
  163. vb->num_pages -= VIRTIO_BALLOON_PAGES_PER_PAGE;
  164. }
  165. num_freed_pages = vb->num_pfns;
  166. /*
  167. * Note that if
  168. * virtio_has_feature(vdev, VIRTIO_BALLOON_F_MUST_TELL_HOST);
  169. * is true, we *have* to do it in this order
  170. */
  171. if (vb->num_pfns != 0)
  172. tell_host(vb, vb->deflate_vq);
  173. mutex_unlock(&vb->balloon_lock);
  174. release_pages_by_pfn(vb->pfns, vb->num_pfns);
  175. return num_freed_pages;
  176. }
  177. static inline void update_stat(struct virtio_balloon *vb, int idx,
  178. u16 tag, u64 val)
  179. {
  180. BUG_ON(idx >= VIRTIO_BALLOON_S_NR);
  181. vb->stats[idx].tag = tag;
  182. vb->stats[idx].val = val;
  183. }
  184. #define pages_to_bytes(x) ((u64)(x) << PAGE_SHIFT)
  185. static void update_balloon_stats(struct virtio_balloon *vb)
  186. {
  187. unsigned long events[NR_VM_EVENT_ITEMS];
  188. struct sysinfo i;
  189. int idx = 0;
  190. all_vm_events(events);
  191. si_meminfo(&i);
  192. update_stat(vb, idx++, VIRTIO_BALLOON_S_SWAP_IN,
  193. pages_to_bytes(events[PSWPIN]));
  194. update_stat(vb, idx++, VIRTIO_BALLOON_S_SWAP_OUT,
  195. pages_to_bytes(events[PSWPOUT]));
  196. update_stat(vb, idx++, VIRTIO_BALLOON_S_MAJFLT, events[PGMAJFAULT]);
  197. update_stat(vb, idx++, VIRTIO_BALLOON_S_MINFLT, events[PGFAULT]);
  198. update_stat(vb, idx++, VIRTIO_BALLOON_S_MEMFREE,
  199. pages_to_bytes(i.freeram));
  200. update_stat(vb, idx++, VIRTIO_BALLOON_S_MEMTOT,
  201. pages_to_bytes(i.totalram));
  202. }
  203. /*
  204. * While most virtqueues communicate guest-initiated requests to the hypervisor,
  205. * the stats queue operates in reverse. The driver initializes the virtqueue
  206. * with a single buffer. From that point forward, all conversations consist of
  207. * a hypervisor request (a call to this function) which directs us to refill
  208. * the virtqueue with a fresh stats buffer. Since stats collection can sleep,
  209. * we notify our kthread which does the actual work via stats_handle_request().
  210. */
  211. static void stats_request(struct virtqueue *vq)
  212. {
  213. struct virtio_balloon *vb = vq->vdev->priv;
  214. vb->need_stats_update = 1;
  215. wake_up(&vb->config_change);
  216. }
  217. static void stats_handle_request(struct virtio_balloon *vb)
  218. {
  219. struct virtqueue *vq;
  220. struct scatterlist sg;
  221. unsigned int len;
  222. vb->need_stats_update = 0;
  223. update_balloon_stats(vb);
  224. vq = vb->stats_vq;
  225. if (!virtqueue_get_buf(vq, &len))
  226. return;
  227. sg_init_one(&sg, vb->stats, sizeof(vb->stats));
  228. virtqueue_add_outbuf(vq, &sg, 1, vb, GFP_KERNEL);
  229. virtqueue_kick(vq);
  230. }
  231. static void virtballoon_changed(struct virtio_device *vdev)
  232. {
  233. struct virtio_balloon *vb = vdev->priv;
  234. wake_up(&vb->config_change);
  235. }
  236. static inline s64 towards_target(struct virtio_balloon *vb)
  237. {
  238. __le32 v;
  239. s64 target;
  240. virtio_cread(vb->vdev, struct virtio_balloon_config, num_pages, &v);
  241. target = le32_to_cpu(v);
  242. return target - vb->num_pages;
  243. }
  244. static void update_balloon_size(struct virtio_balloon *vb)
  245. {
  246. __le32 actual = cpu_to_le32(vb->num_pages);
  247. virtio_cwrite(vb->vdev, struct virtio_balloon_config, actual,
  248. &actual);
  249. }
  250. /*
  251. * virtballoon_oom_notify - release pages when system is under severe
  252. * memory pressure (called from out_of_memory())
  253. * @self : notifier block struct
  254. * @dummy: not used
  255. * @parm : returned - number of freed pages
  256. *
  257. * The balancing of memory by use of the virtio balloon should not cause
  258. * the termination of processes while there are pages in the balloon.
  259. * If virtio balloon manages to release some memory, it will make the
  260. * system return and retry the allocation that forced the OOM killer
  261. * to run.
  262. */
  263. static int virtballoon_oom_notify(struct notifier_block *self,
  264. unsigned long dummy, void *parm)
  265. {
  266. struct virtio_balloon *vb;
  267. unsigned long *freed;
  268. unsigned num_freed_pages;
  269. vb = container_of(self, struct virtio_balloon, nb);
  270. if (!virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_DEFLATE_ON_OOM))
  271. return NOTIFY_OK;
  272. freed = parm;
  273. num_freed_pages = leak_balloon(vb, oom_pages);
  274. update_balloon_size(vb);
  275. *freed += num_freed_pages;
  276. return NOTIFY_OK;
  277. }
  278. static int balloon(void *_vballoon)
  279. {
  280. struct virtio_balloon *vb = _vballoon;
  281. DEFINE_WAIT_FUNC(wait, woken_wake_function);
  282. set_freezable();
  283. while (!kthread_should_stop()) {
  284. s64 diff;
  285. try_to_freeze();
  286. add_wait_queue(&vb->config_change, &wait);
  287. for (;;) {
  288. if ((diff = towards_target(vb)) != 0 ||
  289. vb->need_stats_update ||
  290. kthread_should_stop() ||
  291. freezing(current))
  292. break;
  293. wait_woken(&wait, TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT);
  294. }
  295. remove_wait_queue(&vb->config_change, &wait);
  296. if (vb->need_stats_update)
  297. stats_handle_request(vb);
  298. if (diff > 0)
  299. fill_balloon(vb, diff);
  300. else if (diff < 0)
  301. leak_balloon(vb, -diff);
  302. update_balloon_size(vb);
  303. /*
  304. * For large balloon changes, we could spend a lot of time
  305. * and always have work to do. Be nice if preempt disabled.
  306. */
  307. cond_resched();
  308. }
  309. return 0;
  310. }
  311. static int init_vqs(struct virtio_balloon *vb)
  312. {
  313. struct virtqueue *vqs[3];
  314. vq_callback_t *callbacks[] = { balloon_ack, balloon_ack, stats_request };
  315. const char *names[] = { "inflate", "deflate", "stats" };
  316. int err, nvqs;
  317. /*
  318. * We expect two virtqueues: inflate and deflate, and
  319. * optionally stat.
  320. */
  321. nvqs = virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_STATS_VQ) ? 3 : 2;
  322. err = vb->vdev->config->find_vqs(vb->vdev, nvqs, vqs, callbacks, names);
  323. if (err)
  324. return err;
  325. vb->inflate_vq = vqs[0];
  326. vb->deflate_vq = vqs[1];
  327. if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_STATS_VQ)) {
  328. struct scatterlist sg;
  329. vb->stats_vq = vqs[2];
  330. /*
  331. * Prime this virtqueue with one buffer so the hypervisor can
  332. * use it to signal us later (it can't be broken yet!).
  333. */
  334. sg_init_one(&sg, vb->stats, sizeof vb->stats);
  335. if (virtqueue_add_outbuf(vb->stats_vq, &sg, 1, vb, GFP_KERNEL)
  336. < 0)
  337. BUG();
  338. virtqueue_kick(vb->stats_vq);
  339. }
  340. return 0;
  341. }
  342. #ifdef CONFIG_BALLOON_COMPACTION
  343. /*
  344. * virtballoon_migratepage - perform the balloon page migration on behalf of
  345. * a compation thread. (called under page lock)
  346. * @vb_dev_info: the balloon device
  347. * @newpage: page that will replace the isolated page after migration finishes.
  348. * @page : the isolated (old) page that is about to be migrated to newpage.
  349. * @mode : compaction mode -- not used for balloon page migration.
  350. *
  351. * After a ballooned page gets isolated by compaction procedures, this is the
  352. * function that performs the page migration on behalf of a compaction thread
  353. * The page migration for virtio balloon is done in a simple swap fashion which
  354. * follows these two macro steps:
  355. * 1) insert newpage into vb->pages list and update the host about it;
  356. * 2) update the host about the old page removed from vb->pages list;
  357. *
  358. * This function preforms the balloon page migration task.
  359. * Called through balloon_mapping->a_ops->migratepage
  360. */
  361. static int virtballoon_migratepage(struct balloon_dev_info *vb_dev_info,
  362. struct page *newpage, struct page *page, enum migrate_mode mode)
  363. {
  364. struct virtio_balloon *vb = container_of(vb_dev_info,
  365. struct virtio_balloon, vb_dev_info);
  366. unsigned long flags;
  367. /*
  368. * In order to avoid lock contention while migrating pages concurrently
  369. * to leak_balloon() or fill_balloon() we just give up the balloon_lock
  370. * this turn, as it is easier to retry the page migration later.
  371. * This also prevents fill_balloon() getting stuck into a mutex
  372. * recursion in the case it ends up triggering memory compaction
  373. * while it is attempting to inflate the ballon.
  374. */
  375. if (!mutex_trylock(&vb->balloon_lock))
  376. return -EAGAIN;
  377. get_page(newpage); /* balloon reference */
  378. /* balloon's page migration 1st step -- inflate "newpage" */
  379. spin_lock_irqsave(&vb_dev_info->pages_lock, flags);
  380. balloon_page_insert(vb_dev_info, newpage);
  381. vb_dev_info->isolated_pages--;
  382. __count_vm_event(BALLOON_MIGRATE);
  383. spin_unlock_irqrestore(&vb_dev_info->pages_lock, flags);
  384. vb->num_pfns = VIRTIO_BALLOON_PAGES_PER_PAGE;
  385. set_page_pfns(vb->pfns, newpage);
  386. tell_host(vb, vb->inflate_vq);
  387. /* balloon's page migration 2nd step -- deflate "page" */
  388. balloon_page_delete(page);
  389. vb->num_pfns = VIRTIO_BALLOON_PAGES_PER_PAGE;
  390. set_page_pfns(vb->pfns, page);
  391. tell_host(vb, vb->deflate_vq);
  392. mutex_unlock(&vb->balloon_lock);
  393. put_page(page); /* balloon reference */
  394. return MIGRATEPAGE_SUCCESS;
  395. }
  396. #endif /* CONFIG_BALLOON_COMPACTION */
  397. static int virtballoon_probe(struct virtio_device *vdev)
  398. {
  399. struct virtio_balloon *vb;
  400. int err;
  401. if (!vdev->config->get) {
  402. dev_err(&vdev->dev, "%s failure: config access disabled\n",
  403. __func__);
  404. return -EINVAL;
  405. }
  406. vdev->priv = vb = kmalloc(sizeof(*vb), GFP_KERNEL);
  407. if (!vb) {
  408. err = -ENOMEM;
  409. goto out;
  410. }
  411. vb->num_pages = 0;
  412. mutex_init(&vb->balloon_lock);
  413. init_waitqueue_head(&vb->config_change);
  414. init_waitqueue_head(&vb->acked);
  415. vb->vdev = vdev;
  416. vb->need_stats_update = 0;
  417. balloon_devinfo_init(&vb->vb_dev_info);
  418. #ifdef CONFIG_BALLOON_COMPACTION
  419. vb->vb_dev_info.migratepage = virtballoon_migratepage;
  420. #endif
  421. err = init_vqs(vb);
  422. if (err)
  423. goto out_free_vb;
  424. vb->nb.notifier_call = virtballoon_oom_notify;
  425. vb->nb.priority = VIRTBALLOON_OOM_NOTIFY_PRIORITY;
  426. err = register_oom_notifier(&vb->nb);
  427. if (err < 0)
  428. goto out_oom_notify;
  429. virtio_device_ready(vdev);
  430. vb->thread = kthread_run(balloon, vb, "vballoon");
  431. if (IS_ERR(vb->thread)) {
  432. err = PTR_ERR(vb->thread);
  433. goto out_del_vqs;
  434. }
  435. return 0;
  436. out_del_vqs:
  437. unregister_oom_notifier(&vb->nb);
  438. out_oom_notify:
  439. vdev->config->del_vqs(vdev);
  440. out_free_vb:
  441. kfree(vb);
  442. out:
  443. return err;
  444. }
  445. static void remove_common(struct virtio_balloon *vb)
  446. {
  447. /* There might be pages left in the balloon: free them. */
  448. while (vb->num_pages)
  449. leak_balloon(vb, vb->num_pages);
  450. update_balloon_size(vb);
  451. /* Now we reset the device so we can clean up the queues. */
  452. vb->vdev->config->reset(vb->vdev);
  453. vb->vdev->config->del_vqs(vb->vdev);
  454. }
  455. static void virtballoon_remove(struct virtio_device *vdev)
  456. {
  457. struct virtio_balloon *vb = vdev->priv;
  458. unregister_oom_notifier(&vb->nb);
  459. kthread_stop(vb->thread);
  460. remove_common(vb);
  461. kfree(vb);
  462. }
  463. #ifdef CONFIG_PM_SLEEP
  464. static int virtballoon_freeze(struct virtio_device *vdev)
  465. {
  466. struct virtio_balloon *vb = vdev->priv;
  467. /*
  468. * The kthread is already frozen by the PM core before this
  469. * function is called.
  470. */
  471. remove_common(vb);
  472. return 0;
  473. }
  474. static int virtballoon_restore(struct virtio_device *vdev)
  475. {
  476. struct virtio_balloon *vb = vdev->priv;
  477. int ret;
  478. ret = init_vqs(vdev->priv);
  479. if (ret)
  480. return ret;
  481. virtio_device_ready(vdev);
  482. fill_balloon(vb, towards_target(vb));
  483. update_balloon_size(vb);
  484. return 0;
  485. }
  486. #endif
  487. static unsigned int features[] = {
  488. VIRTIO_BALLOON_F_MUST_TELL_HOST,
  489. VIRTIO_BALLOON_F_STATS_VQ,
  490. VIRTIO_BALLOON_F_DEFLATE_ON_OOM,
  491. };
  492. static struct virtio_driver virtio_balloon_driver = {
  493. .feature_table = features,
  494. .feature_table_size = ARRAY_SIZE(features),
  495. .driver.name = KBUILD_MODNAME,
  496. .driver.owner = THIS_MODULE,
  497. .id_table = id_table,
  498. .probe = virtballoon_probe,
  499. .remove = virtballoon_remove,
  500. .config_changed = virtballoon_changed,
  501. #ifdef CONFIG_PM_SLEEP
  502. .freeze = virtballoon_freeze,
  503. .restore = virtballoon_restore,
  504. #endif
  505. };
  506. module_virtio_driver(virtio_balloon_driver);
  507. MODULE_DEVICE_TABLE(virtio, id_table);
  508. MODULE_DESCRIPTION("Virtio balloon driver");
  509. MODULE_LICENSE("GPL");