Lines Matching refs:dm_device

571 static struct hv_dynmem_device dm_device;  variable
607 list_for_each_entry(has, &dm_device.ha_region_list, list) { in hv_page_offline_check()
639 complete(&dm_device.ol_waitevent); in hv_memory_notifier()
643 spin_lock_irqsave(&dm_device.ha_lock, flags); in hv_memory_notifier()
646 if (pfn_count <= dm_device.num_pages_onlined) { in hv_memory_notifier()
647 dm_device.num_pages_onlined -= pfn_count; in hv_memory_notifier()
655 dm_device.num_pages_onlined = 0; in hv_memory_notifier()
657 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in hv_memory_notifier()
686 lockdep_assert_held(&dm_device.ha_lock); in hv_page_online_one()
687 dm_device.num_pages_onlined++; in hv_page_online_one()
714 spin_lock_irqsave(&dm_device.ha_lock, flags); in hv_mem_hot_add()
726 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in hv_mem_hot_add()
728 reinit_completion(&dm_device.ol_waitevent); in hv_mem_hot_add()
746 spin_lock_irqsave(&dm_device.ha_lock, flags); in hv_mem_hot_add()
749 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in hv_mem_hot_add()
761 wait_for_completion_timeout(&dm_device.ol_waitevent, 5 * HZ); in hv_mem_hot_add()
762 post_status(&dm_device); in hv_mem_hot_add()
772 spin_lock_irqsave(&dm_device.ha_lock, flags); in hv_online_page()
773 list_for_each_entry(has, &dm_device.ha_region_list, list) { in hv_online_page()
782 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in hv_online_page()
793 spin_lock_irqsave(&dm_device.ha_lock, flags); in pfn_covered()
794 list_for_each_entry(has, &dm_device.ha_region_list, list) { in pfn_covered()
840 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in pfn_covered()
859 spin_lock_irqsave(&dm_device.ha_lock, flags); in handle_pg_range()
860 list_for_each_entry(has, &dm_device.ha_region_list, list) { in handle_pg_range()
912 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in handle_pg_range()
914 spin_lock_irqsave(&dm_device.ha_lock, flags); in handle_pg_range()
923 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in handle_pg_range()
940 if (!dm_device.host_specified_ha_region) { in process_hot_add()
967 spin_lock_irqsave(&dm_device.ha_lock, flags); in process_hot_add()
968 list_add_tail(&ha_region->list, &dm_device.ha_region_list); in process_hot_add()
969 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in process_hot_add()
989 struct hv_dynmem_device *dm = &dm_device; in hot_add_req()
1262 unsigned int num_pages = dm_device.balloon_wrk.num_pages; in balloon_up()
1298 num_ballooned = alloc_balloon_pages(&dm_device, num_pages, in balloon_up()
1308 num_pages, dm_device.balloon_wrk.num_pages); in balloon_up()
1312 dm_device.state = DM_INITIALIZED; in balloon_up()
1323 ret = vmbus_sendpacket(dm_device.dev->channel, in balloon_up()
1331 post_status(&dm_device); in balloon_up()
1341 free_balloon_pages(&dm_device, in balloon_up()
1361 complete(&dm_device.config_event); in balloon_down()
1375 vmbus_sendpacket(dm_device.dev->channel, &resp, in balloon_down()
1391 &dm_device.config_event, 1*HZ); in dm_thread_func()
1396 reinit_completion(&dm_device.config_event); in dm_thread_func()
1517 dm_device.balloon_wrk.num_pages = bal_msg->num_pages; in balloon_onchannelcallback()
1518 schedule_work(&dm_device.balloon_wrk.wrk); in balloon_onchannelcallback()
1558 schedule_work(&dm_device.ha_wrk.wrk); in balloon_onchannelcallback()
1638 dm_device.pr_dev_info.report = hv_free_page_report; in enable_page_reporting()
1639 ret = page_reporting_register(&dm_device.pr_dev_info); in enable_page_reporting()
1641 dm_device.pr_dev_info.report = NULL; in enable_page_reporting()
1650 if (dm_device.pr_dev_info.report) { in disable_page_reporting()
1651 page_reporting_unregister(&dm_device.pr_dev_info); in disable_page_reporting()
1652 dm_device.pr_dev_info.report = NULL; in disable_page_reporting()
1680 dm_device.version = version_req.version.version; in balloon_connect_vsp()
1688 t = wait_for_completion_timeout(&dm_device.host_event, 5*HZ); in balloon_connect_vsp()
1698 if (dm_device.state == DM_INIT_ERROR) { in balloon_connect_vsp()
1704 DYNMEM_MAJOR_VERSION(dm_device.version), in balloon_connect_vsp()
1705 DYNMEM_MINOR_VERSION(dm_device.version)); in balloon_connect_vsp()
1743 t = wait_for_completion_timeout(&dm_device.host_event, 5*HZ); in balloon_connect_vsp()
1753 if (dm_device.state == DM_INIT_ERROR) { in balloon_connect_vsp()
1778 dm_device.dev = dev; in balloon_probe()
1779 dm_device.state = DM_INITIALIZING; in balloon_probe()
1780 dm_device.next_version = DYNMEM_PROTOCOL_VERSION_WIN8; in balloon_probe()
1781 init_completion(&dm_device.host_event); in balloon_probe()
1782 init_completion(&dm_device.config_event); in balloon_probe()
1783 INIT_LIST_HEAD(&dm_device.ha_region_list); in balloon_probe()
1784 spin_lock_init(&dm_device.ha_lock); in balloon_probe()
1785 INIT_WORK(&dm_device.balloon_wrk.wrk, balloon_up); in balloon_probe()
1786 INIT_WORK(&dm_device.ha_wrk.wrk, hot_add_req); in balloon_probe()
1787 dm_device.host_specified_ha_region = false; in balloon_probe()
1791 init_completion(&dm_device.ol_waitevent); in balloon_probe()
1795 hv_set_drvdata(dev, &dm_device); in balloon_probe()
1802 dm_device.state = DM_INITIALIZED; in balloon_probe()
1804 dm_device.thread = in balloon_probe()
1805 kthread_run(dm_thread_func, &dm_device, "hv_balloon"); in balloon_probe()
1806 if (IS_ERR(dm_device.thread)) { in balloon_probe()
1807 ret = PTR_ERR(dm_device.thread); in balloon_probe()
1814 dm_device.state = DM_INIT_ERROR; in balloon_probe()
1815 dm_device.thread = NULL; in balloon_probe()
1845 spin_lock_irqsave(&dm_device.ha_lock, flags); in balloon_remove()
1854 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in balloon_remove()
1884 dm_device.state = DM_INITIALIZING; in balloon_resume()
1891 dm_device.thread = in balloon_resume()
1892 kthread_run(dm_thread_func, &dm_device, "hv_balloon"); in balloon_resume()
1893 if (IS_ERR(dm_device.thread)) { in balloon_resume()
1894 ret = PTR_ERR(dm_device.thread); in balloon_resume()
1895 dm_device.thread = NULL; in balloon_resume()
1899 dm_device.state = DM_INITIALIZED; in balloon_resume()
1904 dm_device.state = DM_INIT_ERROR; in balloon_resume()