Lines Matching refs:dm_device
568 static struct hv_dynmem_device dm_device; variable
604 list_for_each_entry(has, &dm_device.ha_region_list, list) { in hv_page_offline_check()
636 complete(&dm_device.ol_waitevent); in hv_memory_notifier()
640 spin_lock_irqsave(&dm_device.ha_lock, flags); in hv_memory_notifier()
643 if (pfn_count <= dm_device.num_pages_onlined) { in hv_memory_notifier()
644 dm_device.num_pages_onlined -= pfn_count; in hv_memory_notifier()
652 dm_device.num_pages_onlined = 0; in hv_memory_notifier()
654 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in hv_memory_notifier()
683 lockdep_assert_held(&dm_device.ha_lock); in hv_page_online_one()
684 dm_device.num_pages_onlined++; in hv_page_online_one()
711 spin_lock_irqsave(&dm_device.ha_lock, flags); in hv_mem_hot_add()
723 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in hv_mem_hot_add()
725 reinit_completion(&dm_device.ol_waitevent); in hv_mem_hot_add()
743 spin_lock_irqsave(&dm_device.ha_lock, flags); in hv_mem_hot_add()
746 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in hv_mem_hot_add()
758 wait_for_completion_timeout(&dm_device.ol_waitevent, 5 * HZ); in hv_mem_hot_add()
759 post_status(&dm_device); in hv_mem_hot_add()
769 spin_lock_irqsave(&dm_device.ha_lock, flags); in hv_online_page()
770 list_for_each_entry(has, &dm_device.ha_region_list, list) { in hv_online_page()
779 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in hv_online_page()
790 spin_lock_irqsave(&dm_device.ha_lock, flags); in pfn_covered()
791 list_for_each_entry(has, &dm_device.ha_region_list, list) { in pfn_covered()
837 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in pfn_covered()
856 spin_lock_irqsave(&dm_device.ha_lock, flags); in handle_pg_range()
857 list_for_each_entry(has, &dm_device.ha_region_list, list) { in handle_pg_range()
909 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in handle_pg_range()
911 spin_lock_irqsave(&dm_device.ha_lock, flags); in handle_pg_range()
920 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in handle_pg_range()
937 if (!dm_device.host_specified_ha_region) { in process_hot_add()
964 spin_lock_irqsave(&dm_device.ha_lock, flags); in process_hot_add()
965 list_add_tail(&ha_region->list, &dm_device.ha_region_list); in process_hot_add()
966 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in process_hot_add()
986 struct hv_dynmem_device *dm = &dm_device; in hot_add_req()
1257 unsigned int num_pages = dm_device.balloon_wrk.num_pages; in balloon_up()
1293 num_ballooned = alloc_balloon_pages(&dm_device, num_pages, in balloon_up()
1303 num_pages, dm_device.balloon_wrk.num_pages); in balloon_up()
1307 dm_device.state = DM_INITIALIZED; in balloon_up()
1318 ret = vmbus_sendpacket(dm_device.dev->channel, in balloon_up()
1326 post_status(&dm_device); in balloon_up()
1336 free_balloon_pages(&dm_device, in balloon_up()
1356 complete(&dm_device.config_event); in balloon_down()
1370 vmbus_sendpacket(dm_device.dev->channel, &resp, in balloon_down()
1386 &dm_device.config_event, 1*HZ); in dm_thread_func()
1391 reinit_completion(&dm_device.config_event); in dm_thread_func()
1512 dm_device.balloon_wrk.num_pages = bal_msg->num_pages; in balloon_onchannelcallback()
1513 schedule_work(&dm_device.balloon_wrk.wrk); in balloon_onchannelcallback()
1553 schedule_work(&dm_device.ha_wrk.wrk); in balloon_onchannelcallback()
1592 dm_device.version = version_req.version.version; in balloon_connect_vsp()
1600 t = wait_for_completion_timeout(&dm_device.host_event, 5*HZ); in balloon_connect_vsp()
1610 if (dm_device.state == DM_INIT_ERROR) { in balloon_connect_vsp()
1616 DYNMEM_MAJOR_VERSION(dm_device.version), in balloon_connect_vsp()
1617 DYNMEM_MINOR_VERSION(dm_device.version)); in balloon_connect_vsp()
1655 t = wait_for_completion_timeout(&dm_device.host_event, 5*HZ); in balloon_connect_vsp()
1665 if (dm_device.state == DM_INIT_ERROR) { in balloon_connect_vsp()
1690 dm_device.dev = dev; in balloon_probe()
1691 dm_device.state = DM_INITIALIZING; in balloon_probe()
1692 dm_device.next_version = DYNMEM_PROTOCOL_VERSION_WIN8; in balloon_probe()
1693 init_completion(&dm_device.host_event); in balloon_probe()
1694 init_completion(&dm_device.config_event); in balloon_probe()
1695 INIT_LIST_HEAD(&dm_device.ha_region_list); in balloon_probe()
1696 spin_lock_init(&dm_device.ha_lock); in balloon_probe()
1697 INIT_WORK(&dm_device.balloon_wrk.wrk, balloon_up); in balloon_probe()
1698 INIT_WORK(&dm_device.ha_wrk.wrk, hot_add_req); in balloon_probe()
1699 dm_device.host_specified_ha_region = false; in balloon_probe()
1703 init_completion(&dm_device.ol_waitevent); in balloon_probe()
1707 hv_set_drvdata(dev, &dm_device); in balloon_probe()
1713 dm_device.state = DM_INITIALIZED; in balloon_probe()
1715 dm_device.thread = in balloon_probe()
1716 kthread_run(dm_thread_func, &dm_device, "hv_balloon"); in balloon_probe()
1717 if (IS_ERR(dm_device.thread)) { in balloon_probe()
1718 ret = PTR_ERR(dm_device.thread); in balloon_probe()
1725 dm_device.state = DM_INIT_ERROR; in balloon_probe()
1726 dm_device.thread = NULL; in balloon_probe()
1754 spin_lock_irqsave(&dm_device.ha_lock, flags); in balloon_remove()
1763 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in balloon_remove()
1793 dm_device.state = DM_INITIALIZING; in balloon_resume()
1800 dm_device.thread = in balloon_resume()
1801 kthread_run(dm_thread_func, &dm_device, "hv_balloon"); in balloon_resume()
1802 if (IS_ERR(dm_device.thread)) { in balloon_resume()
1803 ret = PTR_ERR(dm_device.thread); in balloon_resume()
1804 dm_device.thread = NULL; in balloon_resume()
1808 dm_device.state = DM_INITIALIZED; in balloon_resume()
1813 dm_device.state = DM_INIT_ERROR; in balloon_resume()