Lines Matching full:dm

575 static void post_status(struct hv_dynmem_device *dm);
973 struct hv_dynmem_device *dm = &dm_device; in hot_add_req() local
980 pg_start = dm->ha_wrk.ha_page_range.finfo.start_page; in hot_add_req()
981 pfn_cnt = dm->ha_wrk.ha_page_range.finfo.page_cnt; in hot_add_req()
983 rg_start = dm->ha_wrk.ha_region_range.finfo.start_page; in hot_add_req()
984 rg_sz = dm->ha_wrk.ha_region_range.finfo.page_cnt; in hot_add_req()
986 if (rg_start == 0 && !dm->host_specified_ha_region) { in hot_add_req()
1002 dm->num_pages_added += resp.page_count; in hot_add_req()
1034 dm->state = DM_INITIALIZED; in hot_add_req()
1036 vmbus_sendpacket(dm->dev->channel, &resp, in hot_add_req()
1042 static void process_info(struct hv_dynmem_device *dm, struct dm_info_msg *msg) in process_info() argument
1055 dm->max_dynamic_page_count = *max_page_count; in process_info()
1098 static unsigned long get_pages_committed(struct hv_dynmem_device *dm) in get_pages_committed() argument
1101 dm->num_pages_ballooned + in get_pages_committed()
1102 (dm->num_pages_added > dm->num_pages_onlined ? in get_pages_committed()
1103 dm->num_pages_added - dm->num_pages_onlined : 0) + in get_pages_committed()
1117 static void post_status(struct hv_dynmem_device *dm) in post_status() argument
1148 num_pages_committed = get_pages_committed(dm); in post_status()
1151 vm_memory_committed(), dm->num_pages_ballooned, in post_status()
1152 dm->num_pages_added, dm->num_pages_onlined); in post_status()
1174 vmbus_sendpacket(dm->dev->channel, &status, in post_status()
1180 static void free_balloon_pages(struct hv_dynmem_device *dm, in free_balloon_pages() argument
1192 dm->num_pages_ballooned--; in free_balloon_pages()
1197 static unsigned int alloc_balloon_pages(struct hv_dynmem_device *dm, in alloc_balloon_pages() argument
1221 dm->num_pages_ballooned += alloc_unit; in alloc_balloon_pages()
1336 static void balloon_down(struct hv_dynmem_device *dm, in balloon_down() argument
1343 unsigned int prev_pages_ballooned = dm->num_pages_ballooned; in balloon_down()
1346 free_balloon_pages(dm, &range_array[i]); in balloon_down()
1351 prev_pages_ballooned - dm->num_pages_ballooned); in balloon_down()
1366 dm->state = DM_INITIALIZED; in balloon_down()
1373 struct hv_dynmem_device *dm = dm_dev; in dm_thread_func() local
1383 post_status(dm); in dm_thread_func()
1401 static void version_resp(struct hv_dynmem_device *dm, in version_resp() argument
1413 complete(&dm->host_event); in version_resp()
1423 if (dm->next_version == 0) in version_resp()
1430 version_req.version.version = dm->next_version; in version_resp()
1431 dm->version = version_req.version.version; in version_resp()
1439 dm->next_version = DYNMEM_PROTOCOL_VERSION_WIN7; in version_resp()
1443 dm->next_version = 0; in version_resp()
1447 ret = vmbus_sendpacket(dm->dev->channel, &version_req, in version_resp()
1458 dm->state = DM_INIT_ERROR; in version_resp()
1459 complete(&dm->host_event); in version_resp()
1462 static void cap_resp(struct hv_dynmem_device *dm, in cap_resp() argument
1467 dm->state = DM_INIT_ERROR; in cap_resp()
1469 complete(&dm->host_event); in cap_resp()
1479 struct hv_dynmem_device *dm = hv_get_drvdata(dev); in balloon_onchannelcallback() local
1495 version_resp(dm, in balloon_onchannelcallback()
1500 cap_resp(dm, in balloon_onchannelcallback()
1510 if (dm->state == DM_BALLOON_UP) in balloon_onchannelcallback()
1513 dm->state = DM_BALLOON_UP; in balloon_onchannelcallback()
1524 dm->state = DM_BALLOON_DOWN; in balloon_onchannelcallback()
1525 balloon_down(dm, in balloon_onchannelcallback()
1530 if (dm->state == DM_HOT_ADD) in balloon_onchannelcallback()
1532 dm->state = DM_HOT_ADD; in balloon_onchannelcallback()
1539 dm->host_specified_ha_region = false; in balloon_onchannelcallback()
1541 dm->ha_wrk.ha_page_range = *ha_pg_range; in balloon_onchannelcallback()
1542 dm->ha_wrk.ha_region_range.page_range = 0; in balloon_onchannelcallback()
1549 dm->host_specified_ha_region = true; in balloon_onchannelcallback()
1552 dm->ha_wrk.ha_page_range = *ha_pg_range; in balloon_onchannelcallback()
1553 dm->ha_wrk.ha_region_range = *ha_region; in balloon_onchannelcallback()
1559 process_info(dm, (struct dm_info_msg *)dm_msg); in balloon_onchannelcallback()
1847 struct hv_dynmem_device *dm = f->private; in hv_balloon_debug_show() local
1851 DYNMEM_MAJOR_VERSION(dm->version), in hv_balloon_debug_show()
1852 DYNMEM_MINOR_VERSION(dm->version)); in hv_balloon_debug_show()
1863 seq_printf(f, "%-22s: %u", "state", dm->state); in hv_balloon_debug_show()
1864 switch (dm->state) { in hv_balloon_debug_show()
1892 seq_printf(f, "%-22s: %u\n", "pages_added", dm->num_pages_added); in hv_balloon_debug_show()
1895 seq_printf(f, "%-22s: %u\n", "pages_onlined", dm->num_pages_onlined); in hv_balloon_debug_show()
1898 seq_printf(f, "%-22s: %u\n", "pages_ballooned", dm->num_pages_ballooned); in hv_balloon_debug_show()
1901 get_pages_committed(dm)); in hv_balloon_debug_show()
1904 dm->max_dynamic_page_count); in hv_balloon_debug_show()
2015 struct hv_dynmem_device *dm = hv_get_drvdata(dev); in balloon_remove() local
2019 if (dm->num_pages_ballooned != 0) in balloon_remove()
2020 pr_warn("Ballooned pages: %d\n", dm->num_pages_ballooned); in balloon_remove()
2022 hv_balloon_debugfs_exit(dm); in balloon_remove()
2024 cancel_work_sync(&dm->balloon_wrk.wrk); in balloon_remove()
2025 cancel_work_sync(&dm->ha_wrk.wrk); in balloon_remove()
2027 kthread_stop(dm->thread); in balloon_remove()
2044 list_for_each_entry_safe(has, tmp, &dm->ha_region_list, list) { in balloon_remove()
2056 struct hv_dynmem_device *dm = hv_get_drvdata(hv_dev); in balloon_suspend() local
2060 cancel_work_sync(&dm->balloon_wrk.wrk); in balloon_suspend()
2061 cancel_work_sync(&dm->ha_wrk.wrk); in balloon_suspend()
2063 if (dm->thread) { in balloon_suspend()
2064 kthread_stop(dm->thread); in balloon_suspend()
2065 dm->thread = NULL; in balloon_suspend()