Lines Matching refs:dm_device

578 static struct hv_dynmem_device dm_device;  variable
614 list_for_each_entry(has, &dm_device.ha_region_list, list) { in hv_page_offline_check()
646 complete(&dm_device.ol_waitevent); in hv_memory_notifier()
650 spin_lock_irqsave(&dm_device.ha_lock, flags); in hv_memory_notifier()
653 if (pfn_count <= dm_device.num_pages_onlined) { in hv_memory_notifier()
654 dm_device.num_pages_onlined -= pfn_count; in hv_memory_notifier()
662 dm_device.num_pages_onlined = 0; in hv_memory_notifier()
664 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in hv_memory_notifier()
693 lockdep_assert_held(&dm_device.ha_lock); in hv_page_online_one()
694 dm_device.num_pages_onlined++; in hv_page_online_one()
721 spin_lock_irqsave(&dm_device.ha_lock, flags); in hv_mem_hot_add()
733 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in hv_mem_hot_add()
735 reinit_completion(&dm_device.ol_waitevent); in hv_mem_hot_add()
753 spin_lock_irqsave(&dm_device.ha_lock, flags); in hv_mem_hot_add()
756 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in hv_mem_hot_add()
768 wait_for_completion_timeout(&dm_device.ol_waitevent, 5 * HZ); in hv_mem_hot_add()
769 post_status(&dm_device); in hv_mem_hot_add()
779 spin_lock_irqsave(&dm_device.ha_lock, flags); in hv_online_page()
780 list_for_each_entry(has, &dm_device.ha_region_list, list) { in hv_online_page()
789 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in hv_online_page()
800 spin_lock_irqsave(&dm_device.ha_lock, flags); in pfn_covered()
801 list_for_each_entry(has, &dm_device.ha_region_list, list) { in pfn_covered()
847 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in pfn_covered()
866 spin_lock_irqsave(&dm_device.ha_lock, flags); in handle_pg_range()
867 list_for_each_entry(has, &dm_device.ha_region_list, list) { in handle_pg_range()
919 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in handle_pg_range()
921 spin_lock_irqsave(&dm_device.ha_lock, flags); in handle_pg_range()
930 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in handle_pg_range()
947 if (!dm_device.host_specified_ha_region) { in process_hot_add()
974 spin_lock_irqsave(&dm_device.ha_lock, flags); in process_hot_add()
975 list_add_tail(&ha_region->list, &dm_device.ha_region_list); in process_hot_add()
976 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in process_hot_add()
996 struct hv_dynmem_device *dm = &dm_device; in hot_add_req()
1285 unsigned int num_pages = dm_device.balloon_wrk.num_pages; in balloon_up()
1321 num_ballooned = alloc_balloon_pages(&dm_device, num_pages, in balloon_up()
1331 num_pages, dm_device.balloon_wrk.num_pages); in balloon_up()
1335 dm_device.state = DM_INITIALIZED; in balloon_up()
1346 ret = vmbus_sendpacket(dm_device.dev->channel, in balloon_up()
1354 post_status(&dm_device); in balloon_up()
1364 free_balloon_pages(&dm_device, in balloon_up()
1384 complete(&dm_device.config_event); in balloon_down()
1398 vmbus_sendpacket(dm_device.dev->channel, &resp, in balloon_down()
1414 &dm_device.config_event, 1*HZ); in dm_thread_func()
1419 reinit_completion(&dm_device.config_event); in dm_thread_func()
1540 dm_device.balloon_wrk.num_pages = bal_msg->num_pages; in balloon_onchannelcallback()
1541 schedule_work(&dm_device.balloon_wrk.wrk); in balloon_onchannelcallback()
1581 schedule_work(&dm_device.ha_wrk.wrk); in balloon_onchannelcallback()
1661 dm_device.pr_dev_info.report = hv_free_page_report; in enable_page_reporting()
1662 ret = page_reporting_register(&dm_device.pr_dev_info); in enable_page_reporting()
1664 dm_device.pr_dev_info.report = NULL; in enable_page_reporting()
1673 if (dm_device.pr_dev_info.report) { in disable_page_reporting()
1674 page_reporting_unregister(&dm_device.pr_dev_info); in disable_page_reporting()
1675 dm_device.pr_dev_info.report = NULL; in disable_page_reporting()
1742 dm_device.version = version_req.version.version; in balloon_connect_vsp()
1750 t = wait_for_completion_timeout(&dm_device.host_event, 5*HZ); in balloon_connect_vsp()
1760 if (dm_device.state == DM_INIT_ERROR) { in balloon_connect_vsp()
1766 DYNMEM_MAJOR_VERSION(dm_device.version), in balloon_connect_vsp()
1767 DYNMEM_MINOR_VERSION(dm_device.version)); in balloon_connect_vsp()
1805 t = wait_for_completion_timeout(&dm_device.host_event, 5*HZ); in balloon_connect_vsp()
1815 if (dm_device.state == DM_INIT_ERROR) { in balloon_connect_vsp()
1943 dm_device.dev = dev; in balloon_probe()
1944 dm_device.state = DM_INITIALIZING; in balloon_probe()
1945 dm_device.next_version = DYNMEM_PROTOCOL_VERSION_WIN8; in balloon_probe()
1946 init_completion(&dm_device.host_event); in balloon_probe()
1947 init_completion(&dm_device.config_event); in balloon_probe()
1948 INIT_LIST_HEAD(&dm_device.ha_region_list); in balloon_probe()
1949 spin_lock_init(&dm_device.ha_lock); in balloon_probe()
1950 INIT_WORK(&dm_device.balloon_wrk.wrk, balloon_up); in balloon_probe()
1951 INIT_WORK(&dm_device.ha_wrk.wrk, hot_add_req); in balloon_probe()
1952 dm_device.host_specified_ha_region = false; in balloon_probe()
1956 init_completion(&dm_device.ol_waitevent); in balloon_probe()
1960 hv_set_drvdata(dev, &dm_device); in balloon_probe()
1967 dm_device.state = DM_INITIALIZED; in balloon_probe()
1969 dm_device.thread = in balloon_probe()
1970 kthread_run(dm_thread_func, &dm_device, "hv_balloon"); in balloon_probe()
1971 if (IS_ERR(dm_device.thread)) { in balloon_probe()
1972 ret = PTR_ERR(dm_device.thread); in balloon_probe()
1976 hv_balloon_debugfs_init(&dm_device); in balloon_probe()
1981 dm_device.state = DM_INIT_ERROR; in balloon_probe()
1982 dm_device.thread = NULL; in balloon_probe()
2015 if (dm_device.state != DM_INIT_ERROR) { in balloon_remove()
2024 spin_lock_irqsave(&dm_device.ha_lock, flags); in balloon_remove()
2033 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in balloon_remove()
2063 dm_device.state = DM_INITIALIZING; in balloon_resume()
2070 dm_device.thread = in balloon_resume()
2071 kthread_run(dm_thread_func, &dm_device, "hv_balloon"); in balloon_resume()
2072 if (IS_ERR(dm_device.thread)) { in balloon_resume()
2073 ret = PTR_ERR(dm_device.thread); in balloon_resume()
2074 dm_device.thread = NULL; in balloon_resume()
2078 dm_device.state = DM_INITIALIZED; in balloon_resume()
2083 dm_device.state = DM_INIT_ERROR; in balloon_resume()