Lines Matching refs:dm_device
573 static struct hv_dynmem_device dm_device; variable
613 list_for_each_entry(has, &dm_device.ha_region_list, list) { in hv_page_offline_check()
645 complete(&dm_device.ol_waitevent); in hv_memory_notifier()
649 scoped_guard(spinlock_irqsave, &dm_device.ha_lock) { in hv_memory_notifier()
652 if (pfn_count <= dm_device.num_pages_onlined) { in hv_memory_notifier()
653 dm_device.num_pages_onlined -= pfn_count; in hv_memory_notifier()
662 dm_device.num_pages_onlined = 0; in hv_memory_notifier()
692 lockdep_assert_held(&dm_device.ha_lock); in hv_page_online_one()
693 dm_device.num_pages_onlined++; in hv_page_online_one()
719 scoped_guard(spinlock_irqsave, &dm_device.ha_lock) { in hv_mem_hot_add()
726 reinit_completion(&dm_device.ol_waitevent); in hv_mem_hot_add()
744 scoped_guard(spinlock_irqsave, &dm_device.ha_lock) { in hv_mem_hot_add()
759 wait_for_completion_timeout(&dm_device.ol_waitevent, 5 * HZ); in hv_mem_hot_add()
760 post_status(&dm_device); in hv_mem_hot_add()
769 guard(spinlock_irqsave)(&dm_device.ha_lock); in hv_online_page()
770 list_for_each_entry(has, &dm_device.ha_region_list, list) { in hv_online_page()
788 guard(spinlock_irqsave)(&dm_device.ha_lock); in pfn_covered()
789 list_for_each_entry(has, &dm_device.ha_region_list, list) { in pfn_covered()
847 spin_lock_irqsave(&dm_device.ha_lock, flags); in handle_pg_range()
848 list_for_each_entry(has, &dm_device.ha_region_list, list) { in handle_pg_range()
897 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in handle_pg_range()
899 spin_lock_irqsave(&dm_device.ha_lock, flags); in handle_pg_range()
908 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in handle_pg_range()
924 if (!dm_device.host_specified_ha_region) { in process_hot_add()
951 scoped_guard(spinlock_irqsave, &dm_device.ha_lock) { in process_hot_add()
952 list_add_tail(&ha_region->list, &dm_device.ha_region_list); in process_hot_add()
973 struct hv_dynmem_device *dm = &dm_device; in hot_add_req()
1249 unsigned int num_pages = dm_device.balloon_wrk.num_pages; in balloon_up()
1285 num_ballooned = alloc_balloon_pages(&dm_device, num_pages, in balloon_up()
1295 num_pages, dm_device.balloon_wrk.num_pages); in balloon_up()
1299 dm_device.state = DM_INITIALIZED; in balloon_up()
1310 ret = vmbus_sendpacket(dm_device.dev->channel, in balloon_up()
1318 post_status(&dm_device); in balloon_up()
1328 free_balloon_pages(&dm_device, in balloon_up()
1347 complete(&dm_device.config_event); in balloon_down()
1361 vmbus_sendpacket(dm_device.dev->channel, &resp, in balloon_down()
1376 wait_for_completion_interruptible_timeout(&dm_device.config_event, 1 * HZ); in dm_thread_func()
1381 reinit_completion(&dm_device.config_event); in dm_thread_func()
1513 dm_device.balloon_wrk.num_pages = bal_msg->num_pages; in balloon_onchannelcallback()
1514 schedule_work(&dm_device.balloon_wrk.wrk); in balloon_onchannelcallback()
1554 schedule_work(&dm_device.ha_wrk.wrk); in balloon_onchannelcallback()
1656 dm_device.pr_dev_info.report = hv_free_page_report; in enable_page_reporting()
1661 dm_device.pr_dev_info.order = 0; 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()
1674 if (dm_device.pr_dev_info.report) { in disable_page_reporting()
1675 page_reporting_unregister(&dm_device.pr_dev_info); in disable_page_reporting()
1676 dm_device.pr_dev_info.report = NULL; in disable_page_reporting()
1743 dm_device.version = version_req.version.version; in balloon_connect_vsp()
1751 t = wait_for_completion_timeout(&dm_device.host_event, 5 * HZ); in balloon_connect_vsp()
1761 if (dm_device.state == DM_INIT_ERROR) { in balloon_connect_vsp()
1767 DYNMEM_MAJOR_VERSION(dm_device.version), in balloon_connect_vsp()
1768 DYNMEM_MINOR_VERSION(dm_device.version)); in balloon_connect_vsp()
1809 t = wait_for_completion_timeout(&dm_device.host_event, 5 * HZ); in balloon_connect_vsp()
1819 if (dm_device.state == DM_INIT_ERROR) { in balloon_connect_vsp()
1962 dm_device.dev = dev; in balloon_probe()
1963 dm_device.state = DM_INITIALIZING; in balloon_probe()
1964 dm_device.next_version = DYNMEM_PROTOCOL_VERSION_WIN8; in balloon_probe()
1965 init_completion(&dm_device.host_event); in balloon_probe()
1966 init_completion(&dm_device.config_event); in balloon_probe()
1967 INIT_LIST_HEAD(&dm_device.ha_region_list); in balloon_probe()
1968 spin_lock_init(&dm_device.ha_lock); in balloon_probe()
1969 INIT_WORK(&dm_device.balloon_wrk.wrk, balloon_up); in balloon_probe()
1970 INIT_WORK(&dm_device.ha_wrk.wrk, hot_add_req); in balloon_probe()
1971 dm_device.host_specified_ha_region = false; in balloon_probe()
1975 init_completion(&dm_device.ol_waitevent); in balloon_probe()
1979 hv_set_drvdata(dev, &dm_device); in balloon_probe()
1986 dm_device.state = DM_INITIALIZED; in balloon_probe()
1988 dm_device.thread = in balloon_probe()
1989 kthread_run(dm_thread_func, &dm_device, "hv_balloon"); in balloon_probe()
1990 if (IS_ERR(dm_device.thread)) { in balloon_probe()
1991 ret = PTR_ERR(dm_device.thread); in balloon_probe()
1995 hv_balloon_debugfs_init(&dm_device); in balloon_probe()
2000 dm_device.state = DM_INIT_ERROR; in balloon_probe()
2001 dm_device.thread = NULL; in balloon_probe()
2033 if (dm_device.state != DM_INIT_ERROR) { in balloon_remove()
2042 guard(spinlock_irqsave)(&dm_device.ha_lock); in balloon_remove()
2077 dm_device.state = DM_INITIALIZING; in balloon_resume()
2084 dm_device.thread = in balloon_resume()
2085 kthread_run(dm_thread_func, &dm_device, "hv_balloon"); in balloon_resume()
2086 if (IS_ERR(dm_device.thread)) { in balloon_resume()
2087 ret = PTR_ERR(dm_device.thread); in balloon_resume()
2088 dm_device.thread = NULL; in balloon_resume()
2092 dm_device.state = DM_INITIALIZED; in balloon_resume()
2097 dm_device.state = DM_INIT_ERROR; in balloon_resume()