Lines Matching refs:dm_device

567 static struct hv_dynmem_device dm_device;  variable
603 list_for_each_entry(has, &dm_device.ha_region_list, list) { in hv_page_offline_check()
635 if (dm_device.ha_waiting) { in hv_memory_notifier()
636 dm_device.ha_waiting = false; in hv_memory_notifier()
637 complete(&dm_device.ol_waitevent); in hv_memory_notifier()
642 spin_lock_irqsave(&dm_device.ha_lock, flags); in hv_memory_notifier()
645 if (pfn_count <= dm_device.num_pages_onlined) { in hv_memory_notifier()
646 dm_device.num_pages_onlined -= pfn_count; in hv_memory_notifier()
654 dm_device.num_pages_onlined = 0; in hv_memory_notifier()
656 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in hv_memory_notifier()
687 lockdep_assert_held(&dm_device.ha_lock); in hv_page_online_one()
688 dm_device.num_pages_onlined++; in hv_page_online_one()
715 spin_lock_irqsave(&dm_device.ha_lock, flags); in hv_mem_hot_add()
727 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in hv_mem_hot_add()
729 init_completion(&dm_device.ol_waitevent); in hv_mem_hot_add()
730 dm_device.ha_waiting = !memhp_auto_online; in hv_mem_hot_add()
748 spin_lock_irqsave(&dm_device.ha_lock, flags); in hv_mem_hot_add()
751 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in hv_mem_hot_add()
762 if (dm_device.ha_waiting) in hv_mem_hot_add()
763 wait_for_completion_timeout(&dm_device.ol_waitevent, in hv_mem_hot_add()
765 post_status(&dm_device); in hv_mem_hot_add()
775 spin_lock_irqsave(&dm_device.ha_lock, flags); in hv_online_page()
776 list_for_each_entry(has, &dm_device.ha_region_list, list) { in hv_online_page()
785 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in hv_online_page()
796 spin_lock_irqsave(&dm_device.ha_lock, flags); in pfn_covered()
797 list_for_each_entry(has, &dm_device.ha_region_list, list) { in pfn_covered()
843 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in pfn_covered()
862 spin_lock_irqsave(&dm_device.ha_lock, flags); in handle_pg_range()
863 list_for_each_entry(has, &dm_device.ha_region_list, list) { in handle_pg_range()
915 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in handle_pg_range()
917 spin_lock_irqsave(&dm_device.ha_lock, flags); in handle_pg_range()
926 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in handle_pg_range()
943 if (!dm_device.host_specified_ha_region) { in process_hot_add()
970 spin_lock_irqsave(&dm_device.ha_lock, flags); in process_hot_add()
971 list_add_tail(&ha_region->list, &dm_device.ha_region_list); in process_hot_add()
972 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in process_hot_add()
992 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()
1302 num_ballooned = alloc_balloon_pages(&dm_device, num_pages, in balloon_up()
1312 num_pages, dm_device.balloon_wrk.num_pages); in balloon_up()
1316 dm_device.state = DM_INITIALIZED; in balloon_up()
1327 ret = vmbus_sendpacket(dm_device.dev->channel, in balloon_up()
1335 post_status(&dm_device); in balloon_up()
1345 free_balloon_pages(&dm_device, in balloon_up()
1365 complete(&dm_device.config_event); in balloon_down()
1379 vmbus_sendpacket(dm_device.dev->channel, &resp, in balloon_down()
1395 &dm_device.config_event, 1*HZ); in dm_thread_func()
1400 reinit_completion(&dm_device.config_event); in dm_thread_func()
1516 dm_device.balloon_wrk.num_pages = bal_msg->num_pages; in balloon_onchannelcallback()
1517 schedule_work(&dm_device.balloon_wrk.wrk); in balloon_onchannelcallback()
1552 schedule_work(&dm_device.ha_wrk.wrk); in balloon_onchannelcallback()
1591 dm_device.version = version_req.version.version; in balloon_connect_vsp()
1599 t = wait_for_completion_timeout(&dm_device.host_event, 5*HZ); in balloon_connect_vsp()
1609 if (dm_device.state == DM_INIT_ERROR) { in balloon_connect_vsp()
1615 DYNMEM_MAJOR_VERSION(dm_device.version), in balloon_connect_vsp()
1616 DYNMEM_MINOR_VERSION(dm_device.version)); in balloon_connect_vsp()
1649 t = wait_for_completion_timeout(&dm_device.host_event, 5*HZ); in balloon_connect_vsp()
1659 if (dm_device.state == DM_INIT_ERROR) { in balloon_connect_vsp()
1680 dm_device.dev = dev; in balloon_probe()
1681 dm_device.state = DM_INITIALIZING; in balloon_probe()
1682 dm_device.next_version = DYNMEM_PROTOCOL_VERSION_WIN8; in balloon_probe()
1683 init_completion(&dm_device.host_event); in balloon_probe()
1684 init_completion(&dm_device.config_event); in balloon_probe()
1685 INIT_LIST_HEAD(&dm_device.ha_region_list); in balloon_probe()
1686 spin_lock_init(&dm_device.ha_lock); in balloon_probe()
1687 INIT_WORK(&dm_device.balloon_wrk.wrk, balloon_up); in balloon_probe()
1688 INIT_WORK(&dm_device.ha_wrk.wrk, hot_add_req); in balloon_probe()
1689 dm_device.host_specified_ha_region = false; in balloon_probe()
1696 hv_set_drvdata(dev, &dm_device); in balloon_probe()
1702 dm_device.state = DM_INITIALIZED; in balloon_probe()
1704 dm_device.thread = in balloon_probe()
1705 kthread_run(dm_thread_func, &dm_device, "hv_balloon"); in balloon_probe()
1706 if (IS_ERR(dm_device.thread)) { in balloon_probe()
1707 ret = PTR_ERR(dm_device.thread); in balloon_probe()
1741 spin_lock_irqsave(&dm_device.ha_lock, flags); in balloon_remove()
1750 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in balloon_remove()