Lines Matching full:block

12 			     struct i915_buddy_block *block,  in __igt_dump_block()  argument
15 pr_err("block info: header=%llx, state=%u, order=%d, offset=%llx size=%llx root=%s buddy=%s\n", in __igt_dump_block()
16 block->header, in __igt_dump_block()
17 i915_buddy_block_state(block), in __igt_dump_block()
18 i915_buddy_block_order(block), in __igt_dump_block()
19 i915_buddy_block_offset(block), in __igt_dump_block()
20 i915_buddy_block_size(mm, block), in __igt_dump_block()
21 yesno(!block->parent), in __igt_dump_block()
26 struct i915_buddy_block *block) in igt_dump_block() argument
30 __igt_dump_block(mm, block, false); in igt_dump_block()
32 buddy = get_buddy(block); in igt_dump_block()
38 struct i915_buddy_block *block) in igt_check_block() argument
46 block_state = i915_buddy_block_state(block); in igt_check_block()
51 pr_err("block state mismatch\n"); in igt_check_block()
55 block_size = i915_buddy_block_size(mm, block); in igt_check_block()
56 offset = i915_buddy_block_offset(block); in igt_check_block()
59 pr_err("block size smaller than min size\n"); in igt_check_block()
64 pr_err("block size not power of two\n"); in igt_check_block()
69 pr_err("block size not aligned to min size\n"); in igt_check_block()
74 pr_err("block offset not aligned to min size\n"); in igt_check_block()
79 pr_err("block offset not aligned to block size\n"); in igt_check_block()
83 buddy = get_buddy(block); in igt_check_block()
85 if (!buddy && block->parent) { in igt_check_block()
103 pr_err("block and its buddy are free\n"); in igt_check_block()
116 struct i915_buddy_block *block; in igt_check_blocks() local
121 block = NULL; in igt_check_blocks()
125 list_for_each_entry(block, blocks, link) { in igt_check_blocks()
126 err = igt_check_block(mm, block); in igt_check_blocks()
128 if (!i915_buddy_block_is_allocated(block)) { in igt_check_blocks()
129 pr_err("block not allocated\n"), in igt_check_blocks()
140 offset = i915_buddy_block_offset(block); in igt_check_blocks()
143 pr_err("block offset mismatch\n"); in igt_check_blocks()
151 total += i915_buddy_block_size(mm, block); in igt_check_blocks()
152 prev = block; in igt_check_blocks()
165 pr_err("prev block, dump:\n"); in igt_check_blocks()
169 if (block) { in igt_check_blocks()
170 pr_err("bad block, dump:\n"); in igt_check_blocks()
171 igt_dump_block(mm, block); in igt_check_blocks()
201 struct i915_buddy_block *block; in igt_check_mm() local
242 block = list_first_entry_or_null(&mm->free_list[order], in igt_check_mm()
245 if (block != root) { in igt_check_mm()
325 struct i915_buddy_block *block; in igt_buddy_alloc_smoke() local
345 block = i915_buddy_alloc(&mm, order); in igt_buddy_alloc_smoke()
346 if (IS_ERR(block)) { in igt_buddy_alloc_smoke()
347 err = PTR_ERR(block); in igt_buddy_alloc_smoke()
364 list_add_tail(&block->link, &blocks); in igt_buddy_alloc_smoke()
366 if (i915_buddy_block_order(block) != order) { in igt_buddy_alloc_smoke()
372 total += i915_buddy_block_size(&mm, block); in igt_buddy_alloc_smoke()
410 struct i915_buddy_block *block, *bn; in igt_buddy_alloc_pessimistic() local
430 block = i915_buddy_alloc(&mm, order); in igt_buddy_alloc_pessimistic()
431 if (IS_ERR(block)) { in igt_buddy_alloc_pessimistic()
434 err = PTR_ERR(block); in igt_buddy_alloc_pessimistic()
438 list_add_tail(&block->link, &blocks); in igt_buddy_alloc_pessimistic()
441 /* And now the last remaining block available */ in igt_buddy_alloc_pessimistic()
442 block = i915_buddy_alloc(&mm, 0); in igt_buddy_alloc_pessimistic()
443 if (IS_ERR(block)) { in igt_buddy_alloc_pessimistic()
445 err = PTR_ERR(block); in igt_buddy_alloc_pessimistic()
448 list_add_tail(&block->link, &blocks); in igt_buddy_alloc_pessimistic()
452 block = i915_buddy_alloc(&mm, order); in igt_buddy_alloc_pessimistic()
453 if (!IS_ERR(block)) { in igt_buddy_alloc_pessimistic()
456 list_add_tail(&block->link, &blocks); in igt_buddy_alloc_pessimistic()
462 block = list_last_entry(&blocks, typeof(*block), link); in igt_buddy_alloc_pessimistic()
463 list_del(&block->link); in igt_buddy_alloc_pessimistic()
464 i915_buddy_free(&mm, block); in igt_buddy_alloc_pessimistic()
468 list_for_each_entry_safe(block, bn, &blocks, link) { in igt_buddy_alloc_pessimistic()
469 list_del(&block->link); in igt_buddy_alloc_pessimistic()
470 i915_buddy_free(&mm, block); in igt_buddy_alloc_pessimistic()
472 block = i915_buddy_alloc(&mm, order); in igt_buddy_alloc_pessimistic()
473 if (IS_ERR(block)) { in igt_buddy_alloc_pessimistic()
476 err = PTR_ERR(block); in igt_buddy_alloc_pessimistic()
479 i915_buddy_free(&mm, block); in igt_buddy_alloc_pessimistic()
484 block = i915_buddy_alloc(&mm, max_order); in igt_buddy_alloc_pessimistic()
485 if (IS_ERR(block)) { in igt_buddy_alloc_pessimistic()
488 err = PTR_ERR(block); in igt_buddy_alloc_pessimistic()
491 i915_buddy_free(&mm, block); in igt_buddy_alloc_pessimistic()
502 struct i915_buddy_block *block; in igt_buddy_alloc_optimistic() local
509 * Create a mm with one block of each order available, and in igt_buddy_alloc_optimistic()
523 block = i915_buddy_alloc(&mm, order); in igt_buddy_alloc_optimistic()
524 if (IS_ERR(block)) { in igt_buddy_alloc_optimistic()
527 err = PTR_ERR(block); in igt_buddy_alloc_optimistic()
531 list_add_tail(&block->link, &blocks); in igt_buddy_alloc_optimistic()
535 block = i915_buddy_alloc(&mm, 0); in igt_buddy_alloc_optimistic()
536 if (!IS_ERR(block)) { in igt_buddy_alloc_optimistic()
538 list_add_tail(&block->link, &blocks); in igt_buddy_alloc_optimistic()
552 struct i915_buddy_block *block; in igt_buddy_alloc_pathological() local
562 * page left. Free the largest block, then whittle down again. in igt_buddy_alloc_pathological()
574 /* Make room by freeing the largest allocated block */ in igt_buddy_alloc_pathological()
575 block = list_first_entry_or_null(&blocks, typeof(*block), link); in igt_buddy_alloc_pathological()
576 if (block) { in igt_buddy_alloc_pathological()
577 list_del(&block->link); in igt_buddy_alloc_pathological()
578 i915_buddy_free(&mm, block); in igt_buddy_alloc_pathological()
582 block = i915_buddy_alloc(&mm, order); in igt_buddy_alloc_pathological()
583 if (IS_ERR(block)) { in igt_buddy_alloc_pathological()
586 err = PTR_ERR(block); in igt_buddy_alloc_pathological()
589 list_add_tail(&block->link, &blocks); in igt_buddy_alloc_pathological()
593 block = i915_buddy_alloc(&mm, 0); in igt_buddy_alloc_pathological()
594 if (IS_ERR(block)) { in igt_buddy_alloc_pathological()
596 err = PTR_ERR(block); in igt_buddy_alloc_pathological()
599 list_add_tail(&block->link, &holes); in igt_buddy_alloc_pathological()
601 block = i915_buddy_alloc(&mm, top); in igt_buddy_alloc_pathological()
602 if (!IS_ERR(block)) { in igt_buddy_alloc_pathological()
605 list_add_tail(&block->link, &blocks); in igt_buddy_alloc_pathological()
615 block = i915_buddy_alloc(&mm, order); in igt_buddy_alloc_pathological()
616 if (!IS_ERR(block)) { in igt_buddy_alloc_pathological()
619 list_add_tail(&block->link, &blocks); in igt_buddy_alloc_pathological()
663 struct i915_buddy_block *block; in igt_buddy_alloc_range() local
681 block = list_first_entry_or_null(&tmp, in igt_buddy_alloc_range()
684 if (!block) { in igt_buddy_alloc_range()
690 if (i915_buddy_block_offset(block) != offset) { in igt_buddy_alloc_range()
692 i915_buddy_block_offset(block), offset); in igt_buddy_alloc_range()