Lines Matching refs:dm_device
554 static struct hv_dynmem_device dm_device; variable
566 mutex_lock(&dm_device.ha_region_mutex); in hv_memory_notifier()
570 dm_device.num_pages_onlined += mem->nr_pages; in hv_memory_notifier()
573 mutex_is_locked(&dm_device.ha_region_mutex)) in hv_memory_notifier()
574 mutex_unlock(&dm_device.ha_region_mutex); in hv_memory_notifier()
575 if (dm_device.ha_waiting) { in hv_memory_notifier()
576 dm_device.ha_waiting = false; in hv_memory_notifier()
577 complete(&dm_device.ol_waitevent); in hv_memory_notifier()
582 mutex_lock(&dm_device.ha_region_mutex); in hv_memory_notifier()
583 dm_device.num_pages_onlined -= mem->nr_pages; in hv_memory_notifier()
584 mutex_unlock(&dm_device.ha_region_mutex); in hv_memory_notifier()
636 init_completion(&dm_device.ol_waitevent); in hv_mem_hot_add()
637 dm_device.ha_waiting = true; in hv_mem_hot_add()
639 mutex_unlock(&dm_device.ha_region_mutex); in hv_mem_hot_add()
658 mutex_lock(&dm_device.ha_region_mutex); in hv_mem_hot_add()
668 wait_for_completion_timeout(&dm_device.ol_waitevent, 5*HZ); in hv_mem_hot_add()
669 mutex_lock(&dm_device.ha_region_mutex); in hv_mem_hot_add()
670 post_status(&dm_device); in hv_mem_hot_add()
683 list_for_each(cur, &dm_device.ha_region_list) { in hv_online_page()
707 if (list_empty(&dm_device.ha_region_list)) in pfn_covered()
710 list_for_each(cur, &dm_device.ha_region_list) { in pfn_covered()
761 if (list_empty(&dm_device.ha_region_list)) in handle_pg_range()
764 list_for_each(cur, &dm_device.ha_region_list) { in handle_pg_range()
839 if (!dm_device.host_specified_ha_region) in process_hot_add()
854 list_add_tail(&ha_region->list, &dm_device.ha_region_list); in process_hot_add()
878 struct hv_dynmem_device *dm = &dm_device; in hot_add_req()
885 mutex_lock(&dm_device.ha_region_mutex); in hot_add_req()
919 mutex_unlock(&dm_device.ha_region_mutex); in hot_add_req()
1140 unsigned int num_pages = dm_device.balloon_wrk.num_pages; in balloon_up()
1177 num_ballooned = alloc_balloon_pages(&dm_device, num_pages, in balloon_up()
1188 dm_device.state = DM_INITIALIZED; in balloon_up()
1199 ret = vmbus_sendpacket(dm_device.dev->channel, in balloon_up()
1207 post_status(&dm_device); in balloon_up()
1217 free_balloon_pages(&dm_device, in balloon_up()
1236 complete(&dm_device.config_event); in balloon_down()
1247 vmbus_sendpacket(dm_device.dev->channel, &resp, in balloon_down()
1263 &dm_device.config_event, 1*HZ); in dm_thread_func()
1268 reinit_completion(&dm_device.config_event); in dm_thread_func()
1383 dm_device.balloon_wrk.num_pages = bal_msg->num_pages; in balloon_onchannelcallback()
1384 schedule_work(&dm_device.balloon_wrk.wrk); in balloon_onchannelcallback()
1418 schedule_work(&dm_device.ha_wrk.wrk); in balloon_onchannelcallback()
1457 dm_device.dev = dev; in balloon_probe()
1458 dm_device.state = DM_INITIALIZING; in balloon_probe()
1459 dm_device.next_version = DYNMEM_PROTOCOL_VERSION_WIN8; in balloon_probe()
1460 init_completion(&dm_device.host_event); in balloon_probe()
1461 init_completion(&dm_device.config_event); in balloon_probe()
1462 INIT_LIST_HEAD(&dm_device.ha_region_list); in balloon_probe()
1463 mutex_init(&dm_device.ha_region_mutex); in balloon_probe()
1464 INIT_WORK(&dm_device.balloon_wrk.wrk, balloon_up); in balloon_probe()
1465 INIT_WORK(&dm_device.ha_wrk.wrk, hot_add_req); in balloon_probe()
1466 dm_device.host_specified_ha_region = false; in balloon_probe()
1468 dm_device.thread = in balloon_probe()
1469 kthread_run(dm_thread_func, &dm_device, "hv_balloon"); in balloon_probe()
1470 if (IS_ERR(dm_device.thread)) { in balloon_probe()
1471 ret = PTR_ERR(dm_device.thread); in balloon_probe()
1480 hv_set_drvdata(dev, &dm_device); in balloon_probe()
1501 t = wait_for_completion_timeout(&dm_device.host_event, 5*HZ); in balloon_probe()
1511 if (dm_device.state == DM_INIT_ERROR) { in balloon_probe()
1547 t = wait_for_completion_timeout(&dm_device.host_event, 5*HZ); in balloon_probe()
1557 if (dm_device.state == DM_INIT_ERROR) { in balloon_probe()
1562 dm_device.state = DM_INITIALIZED; in balloon_probe()
1570 kthread_stop(dm_device.thread); in balloon_probe()