File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -569,7 +569,7 @@ static bool bfqq_request_over_limit(struct bfq_queue *bfqq, int limit)
569
569
struct bfq_entity * entity = & bfqq -> entity ;
570
570
struct bfq_entity * inline_entities [BFQ_LIMIT_INLINE_DEPTH ];
571
571
struct bfq_entity * * entities = inline_entities ;
572
- int depth , level ;
572
+ int depth , level , alloc_depth = BFQ_LIMIT_INLINE_DEPTH ;
573
573
int class_idx = bfqq -> ioprio_class - 1 ;
574
574
struct bfq_sched_data * sched_data ;
575
575
unsigned long wsum ;
@@ -578,15 +578,21 @@ static bool bfqq_request_over_limit(struct bfq_queue *bfqq, int limit)
578
578
if (!entity -> on_st_or_in_serv )
579
579
return false;
580
580
581
+ retry :
582
+ spin_lock_irq (& bfqd -> lock );
581
583
/* +1 for bfqq entity, root cgroup not included */
582
584
depth = bfqg_to_blkg (bfqq_group (bfqq ))-> blkcg -> css .cgroup -> level + 1 ;
583
- if (depth > BFQ_LIMIT_INLINE_DEPTH ) {
585
+ if (depth > alloc_depth ) {
586
+ spin_unlock_irq (& bfqd -> lock );
587
+ if (entities != inline_entities )
588
+ kfree (entities );
584
589
entities = kmalloc_array (depth , sizeof (* entities ), GFP_NOIO );
585
590
if (!entities )
586
591
return false;
592
+ alloc_depth = depth ;
593
+ goto retry ;
587
594
}
588
595
589
- spin_lock_irq (& bfqd -> lock );
590
596
sched_data = entity -> sched_data ;
591
597
/* Gather our ancestors as we need to traverse them in reverse order */
592
598
level = 0 ;
You can’t perform that action at this time.
0 commit comments