Lines Matching refs:dirty

84 	struct vmw_bo_dirty *dirty = vbo->dirty;  in vmw_bo_dirty_scan_pagetable()  local
91 offset, dirty->bitmap_size, in vmw_bo_dirty_scan_pagetable()
92 offset, &dirty->bitmap[0], in vmw_bo_dirty_scan_pagetable()
93 &dirty->start, &dirty->end); in vmw_bo_dirty_scan_pagetable()
95 dirty->change_count++; in vmw_bo_dirty_scan_pagetable()
97 dirty->change_count = 0; in vmw_bo_dirty_scan_pagetable()
99 if (dirty->change_count > VMW_DIRTY_NUM_CHANGE_TRIGGERS) { in vmw_bo_dirty_scan_pagetable()
100 dirty->change_count = 0; in vmw_bo_dirty_scan_pagetable()
101 dirty->method = VMW_BO_DIRTY_MKWRITE; in vmw_bo_dirty_scan_pagetable()
103 offset, dirty->bitmap_size); in vmw_bo_dirty_scan_pagetable()
105 offset, dirty->bitmap_size, in vmw_bo_dirty_scan_pagetable()
106 offset, &dirty->bitmap[0], in vmw_bo_dirty_scan_pagetable()
107 &dirty->start, &dirty->end); in vmw_bo_dirty_scan_pagetable()
122 struct vmw_bo_dirty *dirty = vbo->dirty; in vmw_bo_dirty_scan_mkwrite() local
127 if (dirty->end <= dirty->start) in vmw_bo_dirty_scan_mkwrite()
131 dirty->start + offset, in vmw_bo_dirty_scan_mkwrite()
132 dirty->end - dirty->start); in vmw_bo_dirty_scan_mkwrite()
134 if (100UL * num_marked / dirty->bitmap_size > in vmw_bo_dirty_scan_mkwrite()
136 dirty->change_count++; in vmw_bo_dirty_scan_mkwrite()
138 dirty->change_count = 0; in vmw_bo_dirty_scan_mkwrite()
140 if (dirty->change_count > VMW_DIRTY_NUM_CHANGE_TRIGGERS) { in vmw_bo_dirty_scan_mkwrite()
142 pgoff_t end = dirty->bitmap_size; in vmw_bo_dirty_scan_mkwrite()
144 dirty->method = VMW_BO_DIRTY_PAGETABLE; in vmw_bo_dirty_scan_mkwrite()
146 &dirty->bitmap[0], in vmw_bo_dirty_scan_mkwrite()
148 bitmap_clear(&dirty->bitmap[0], 0, dirty->bitmap_size); in vmw_bo_dirty_scan_mkwrite()
149 if (dirty->start < dirty->end) in vmw_bo_dirty_scan_mkwrite()
150 bitmap_set(&dirty->bitmap[0], dirty->start, in vmw_bo_dirty_scan_mkwrite()
151 dirty->end - dirty->start); in vmw_bo_dirty_scan_mkwrite()
152 dirty->change_count = 0; in vmw_bo_dirty_scan_mkwrite()
165 struct vmw_bo_dirty *dirty = vbo->dirty; in vmw_bo_dirty_scan() local
167 if (dirty->method == VMW_BO_DIRTY_PAGETABLE) in vmw_bo_dirty_scan()
187 struct vmw_bo_dirty *dirty = vbo->dirty; in vmw_bo_dirty_pre_unmap() local
191 if (dirty->method != VMW_BO_DIRTY_PAGETABLE || start >= end) in vmw_bo_dirty_pre_unmap()
197 &dirty->bitmap[0], &dirty->start, in vmw_bo_dirty_pre_unmap()
198 &dirty->end); in vmw_bo_dirty_pre_unmap()
232 struct vmw_bo_dirty *dirty = vbo->dirty; in vmw_bo_dirty_add() local
237 if (dirty) { in vmw_bo_dirty_add()
238 dirty->ref_count++; in vmw_bo_dirty_add()
242 size = sizeof(*dirty) + BITS_TO_LONGS(num_pages) * sizeof(long); in vmw_bo_dirty_add()
243 dirty = kvzalloc(size, GFP_KERNEL); in vmw_bo_dirty_add()
244 if (!dirty) { in vmw_bo_dirty_add()
249 dirty->bitmap_size = num_pages; in vmw_bo_dirty_add()
250 dirty->start = dirty->bitmap_size; in vmw_bo_dirty_add()
251 dirty->end = 0; in vmw_bo_dirty_add()
252 dirty->ref_count = 1; in vmw_bo_dirty_add()
254 dirty->method = VMW_BO_DIRTY_PAGETABLE; in vmw_bo_dirty_add()
259 dirty->method = VMW_BO_DIRTY_MKWRITE; in vmw_bo_dirty_add()
265 &dirty->bitmap[0], in vmw_bo_dirty_add()
266 &dirty->start, &dirty->end); in vmw_bo_dirty_add()
269 vbo->dirty = dirty; in vmw_bo_dirty_add()
289 struct vmw_bo_dirty *dirty = vbo->dirty; in vmw_bo_dirty_release() local
291 if (dirty && --dirty->ref_count == 0) { in vmw_bo_dirty_release()
292 kvfree(dirty); in vmw_bo_dirty_release()
293 vbo->dirty = NULL; in vmw_bo_dirty_release()
310 struct vmw_bo_dirty *dirty = vbo->dirty; in vmw_bo_dirty_transfer_to_res() local
319 if (res_start >= dirty->end || res_end <= dirty->start) in vmw_bo_dirty_transfer_to_res()
322 cur = max(res_start, dirty->start); in vmw_bo_dirty_transfer_to_res()
323 res_end = max(res_end, dirty->end); in vmw_bo_dirty_transfer_to_res()
327 start = find_next_bit(&dirty->bitmap[0], res_end, cur); in vmw_bo_dirty_transfer_to_res()
331 end = find_next_zero_bit(&dirty->bitmap[0], res_end, start + 1); in vmw_bo_dirty_transfer_to_res()
334 bitmap_clear(&dirty->bitmap[0], start, num); in vmw_bo_dirty_transfer_to_res()
338 if (res_start <= dirty->start && res_end > dirty->start) in vmw_bo_dirty_transfer_to_res()
339 dirty->start = res_end; in vmw_bo_dirty_transfer_to_res()
340 if (res_start < dirty->end && res_end >= dirty->end) in vmw_bo_dirty_transfer_to_res()
341 dirty->end = res_start; in vmw_bo_dirty_transfer_to_res()
357 struct vmw_bo_dirty *dirty = vbo->dirty; in vmw_bo_dirty_clear_res() local
362 if (res_start >= dirty->end || res_end <= dirty->start) in vmw_bo_dirty_clear_res()
365 res_start = max(res_start, dirty->start); in vmw_bo_dirty_clear_res()
366 res_end = min(res_end, dirty->end); in vmw_bo_dirty_clear_res()
367 bitmap_clear(&dirty->bitmap[0], res_start, res_end - res_start); in vmw_bo_dirty_clear_res()
369 if (res_start <= dirty->start && res_end > dirty->start) in vmw_bo_dirty_clear_res()
370 dirty->start = res_end; in vmw_bo_dirty_clear_res()
371 if (res_start < dirty->end && res_end >= dirty->end) in vmw_bo_dirty_clear_res()
372 dirty->end = res_start; in vmw_bo_dirty_clear_res()
402 if (vbo->dirty && vbo->dirty->method == VMW_BO_DIRTY_MKWRITE && in vmw_bo_vm_mkwrite()
403 !test_bit(page_offset, &vbo->dirty->bitmap[0])) { in vmw_bo_vm_mkwrite()
404 struct vmw_bo_dirty *dirty = vbo->dirty; in vmw_bo_vm_mkwrite() local
406 __set_bit(page_offset, &dirty->bitmap[0]); in vmw_bo_vm_mkwrite()
407 dirty->start = min(dirty->start, page_offset); in vmw_bo_vm_mkwrite()
408 dirty->end = max(dirty->end, page_offset + 1); in vmw_bo_vm_mkwrite()
433 if (vbo->dirty) { in vmw_bo_vm_fault()
455 if (vbo->dirty && vbo->dirty->method == VMW_BO_DIRTY_MKWRITE) in vmw_bo_vm_fault()