Lines Matching full:block
14 struct i915_buddy_block *block, in __igt_dump_block() argument
17 pr_err("block info: header=%llx, state=%u, order=%d, offset=%llx size=%llx root=%s buddy=%s\n", in __igt_dump_block()
18 block->header, in __igt_dump_block()
19 i915_buddy_block_state(block), in __igt_dump_block()
20 i915_buddy_block_order(block), in __igt_dump_block()
21 i915_buddy_block_offset(block), in __igt_dump_block()
22 i915_buddy_block_size(mm, block), in __igt_dump_block()
23 yesno(!block->parent), in __igt_dump_block()
28 struct i915_buddy_block *block) in igt_dump_block() argument
32 __igt_dump_block(mm, block, false); in igt_dump_block()
34 buddy = get_buddy(block); in igt_dump_block()
40 struct i915_buddy_block *block) in igt_check_block() argument
48 block_state = i915_buddy_block_state(block); in igt_check_block()
53 pr_err("block state mismatch\n"); in igt_check_block()
57 block_size = i915_buddy_block_size(mm, block); in igt_check_block()
58 offset = i915_buddy_block_offset(block); in igt_check_block()
61 pr_err("block size smaller than min size\n"); in igt_check_block()
66 pr_err("block size not power of two\n"); in igt_check_block()
71 pr_err("block size not aligned to min size\n"); in igt_check_block()
76 pr_err("block offset not aligned to min size\n"); in igt_check_block()
81 pr_err("block offset not aligned to block size\n"); in igt_check_block()
85 buddy = get_buddy(block); in igt_check_block()
87 if (!buddy && block->parent) { in igt_check_block()
105 pr_err("block and its buddy are free\n"); in igt_check_block()
118 struct i915_buddy_block *block; in igt_check_blocks() local
123 block = NULL; in igt_check_blocks()
127 list_for_each_entry(block, blocks, link) { in igt_check_blocks()
128 err = igt_check_block(mm, block); in igt_check_blocks()
130 if (!i915_buddy_block_is_allocated(block)) { in igt_check_blocks()
131 pr_err("block not allocated\n"), in igt_check_blocks()
142 offset = i915_buddy_block_offset(block); in igt_check_blocks()
145 pr_err("block offset mismatch\n"); in igt_check_blocks()
153 total += i915_buddy_block_size(mm, block); in igt_check_blocks()
154 prev = block; in igt_check_blocks()
167 pr_err("prev block, dump:\n"); in igt_check_blocks()
171 if (block) { in igt_check_blocks()
172 pr_err("bad block, dump:\n"); in igt_check_blocks()
173 igt_dump_block(mm, block); in igt_check_blocks()
203 struct i915_buddy_block *block; in igt_check_mm() local
244 block = list_first_entry_or_null(&mm->free_list[order], in igt_check_mm()
247 if (block != root) { in igt_check_mm()
317 struct i915_buddy_block *block; in igt_buddy_alloc_smoke() local
335 block = i915_buddy_alloc(&mm, order); in igt_buddy_alloc_smoke()
336 if (IS_ERR(block)) { in igt_buddy_alloc_smoke()
337 err = PTR_ERR(block); in igt_buddy_alloc_smoke()
354 list_add_tail(&block->link, &blocks); in igt_buddy_alloc_smoke()
356 if (i915_buddy_block_order(block) != order) { in igt_buddy_alloc_smoke()
362 total += i915_buddy_block_size(&mm, block); in igt_buddy_alloc_smoke()
391 struct i915_buddy_block *block, *bn; in igt_buddy_alloc_pessimistic() local
411 block = i915_buddy_alloc(&mm, order); in igt_buddy_alloc_pessimistic()
412 if (IS_ERR(block)) { in igt_buddy_alloc_pessimistic()
415 err = PTR_ERR(block); in igt_buddy_alloc_pessimistic()
419 list_add_tail(&block->link, &blocks); in igt_buddy_alloc_pessimistic()
422 /* And now the last remaining block available */ in igt_buddy_alloc_pessimistic()
423 block = i915_buddy_alloc(&mm, 0); in igt_buddy_alloc_pessimistic()
424 if (IS_ERR(block)) { in igt_buddy_alloc_pessimistic()
426 err = PTR_ERR(block); in igt_buddy_alloc_pessimistic()
429 list_add_tail(&block->link, &blocks); in igt_buddy_alloc_pessimistic()
433 block = i915_buddy_alloc(&mm, order); in igt_buddy_alloc_pessimistic()
434 if (!IS_ERR(block)) { in igt_buddy_alloc_pessimistic()
437 list_add_tail(&block->link, &blocks); in igt_buddy_alloc_pessimistic()
443 block = list_last_entry(&blocks, typeof(*block), link); in igt_buddy_alloc_pessimistic()
444 list_del(&block->link); in igt_buddy_alloc_pessimistic()
445 i915_buddy_free(&mm, block); in igt_buddy_alloc_pessimistic()
449 list_for_each_entry_safe(block, bn, &blocks, link) { in igt_buddy_alloc_pessimistic()
450 list_del(&block->link); in igt_buddy_alloc_pessimistic()
451 i915_buddy_free(&mm, block); in igt_buddy_alloc_pessimistic()
453 block = i915_buddy_alloc(&mm, order); in igt_buddy_alloc_pessimistic()
454 if (IS_ERR(block)) { in igt_buddy_alloc_pessimistic()
457 err = PTR_ERR(block); in igt_buddy_alloc_pessimistic()
460 i915_buddy_free(&mm, block); in igt_buddy_alloc_pessimistic()
465 block = i915_buddy_alloc(&mm, max_order); in igt_buddy_alloc_pessimistic()
466 if (IS_ERR(block)) { in igt_buddy_alloc_pessimistic()
469 err = PTR_ERR(block); in igt_buddy_alloc_pessimistic()
472 i915_buddy_free(&mm, block); in igt_buddy_alloc_pessimistic()
483 struct i915_buddy_block *block; in igt_buddy_alloc_optimistic() local
490 * Create a mm with one block of each order available, and in igt_buddy_alloc_optimistic()
504 block = i915_buddy_alloc(&mm, order); in igt_buddy_alloc_optimistic()
505 if (IS_ERR(block)) { in igt_buddy_alloc_optimistic()
508 err = PTR_ERR(block); in igt_buddy_alloc_optimistic()
512 list_add_tail(&block->link, &blocks); in igt_buddy_alloc_optimistic()
516 block = i915_buddy_alloc(&mm, 0); in igt_buddy_alloc_optimistic()
517 if (!IS_ERR(block)) { in igt_buddy_alloc_optimistic()
519 list_add_tail(&block->link, &blocks); in igt_buddy_alloc_optimistic()
533 struct i915_buddy_block *block; in igt_buddy_alloc_pathological() local
543 * page left. Free the largest block, then whittle down again. in igt_buddy_alloc_pathological()
555 /* Make room by freeing the largest allocated block */ in igt_buddy_alloc_pathological()
556 block = list_first_entry_or_null(&blocks, typeof(*block), link); in igt_buddy_alloc_pathological()
557 if (block) { in igt_buddy_alloc_pathological()
558 list_del(&block->link); in igt_buddy_alloc_pathological()
559 i915_buddy_free(&mm, block); in igt_buddy_alloc_pathological()
563 block = i915_buddy_alloc(&mm, order); in igt_buddy_alloc_pathological()
564 if (IS_ERR(block)) { in igt_buddy_alloc_pathological()
567 err = PTR_ERR(block); in igt_buddy_alloc_pathological()
570 list_add_tail(&block->link, &blocks); in igt_buddy_alloc_pathological()
574 block = i915_buddy_alloc(&mm, 0); in igt_buddy_alloc_pathological()
575 if (IS_ERR(block)) { in igt_buddy_alloc_pathological()
577 err = PTR_ERR(block); in igt_buddy_alloc_pathological()
580 list_add_tail(&block->link, &holes); in igt_buddy_alloc_pathological()
582 block = i915_buddy_alloc(&mm, top); in igt_buddy_alloc_pathological()
583 if (!IS_ERR(block)) { in igt_buddy_alloc_pathological()
586 list_add_tail(&block->link, &blocks); in igt_buddy_alloc_pathological()
596 block = i915_buddy_alloc(&mm, order); in igt_buddy_alloc_pathological()
597 if (!IS_ERR(block)) { in igt_buddy_alloc_pathological()
600 list_add_tail(&block->link, &blocks); in igt_buddy_alloc_pathological()
644 struct i915_buddy_block *block; in igt_buddy_alloc_range() local
662 block = list_first_entry_or_null(&tmp, in igt_buddy_alloc_range()
665 if (!block) { in igt_buddy_alloc_range()
671 if (i915_buddy_block_offset(block) != offset) { in igt_buddy_alloc_range()
673 i915_buddy_block_offset(block), offset); in igt_buddy_alloc_range()