@@ -1400,11 +1400,12 @@ static void free_one_page(struct zone *zone, struct page *page,
1400
1400
struct llist_head * llhead ;
1401
1401
unsigned long flags ;
1402
1402
1403
- if (! spin_trylock_irqsave ( & zone -> lock , flags )) {
1404
- if (unlikely ( fpi_flags & FPI_TRYLOCK )) {
1403
+ if (unlikely ( fpi_flags & FPI_TRYLOCK )) {
1404
+ if (! spin_trylock_irqsave ( & zone -> lock , flags )) {
1405
1405
add_page_to_zone_llist (zone , page , order );
1406
1406
return ;
1407
1407
}
1408
+ } else {
1408
1409
spin_lock_irqsave (& zone -> lock , flags );
1409
1410
}
1410
1411
@@ -2314,9 +2315,10 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order,
2314
2315
unsigned long flags ;
2315
2316
int i ;
2316
2317
2317
- if (! spin_trylock_irqsave ( & zone -> lock , flags )) {
2318
- if (unlikely ( alloc_flags & ALLOC_TRYLOCK ))
2318
+ if (unlikely ( alloc_flags & ALLOC_TRYLOCK )) {
2319
+ if (! spin_trylock_irqsave ( & zone -> lock , flags ))
2319
2320
return 0 ;
2321
+ } else {
2320
2322
spin_lock_irqsave (& zone -> lock , flags );
2321
2323
}
2322
2324
for (i = 0 ; i < count ; ++ i ) {
@@ -2937,9 +2939,10 @@ struct page *rmqueue_buddy(struct zone *preferred_zone, struct zone *zone,
2937
2939
2938
2940
do {
2939
2941
page = NULL ;
2940
- if (! spin_trylock_irqsave ( & zone -> lock , flags )) {
2941
- if (unlikely ( alloc_flags & ALLOC_TRYLOCK ))
2942
+ if (unlikely ( alloc_flags & ALLOC_TRYLOCK )) {
2943
+ if (! spin_trylock_irqsave ( & zone -> lock , flags ))
2942
2944
return NULL ;
2945
+ } else {
2943
2946
spin_lock_irqsave (& zone -> lock , flags );
2944
2947
}
2945
2948
if (alloc_flags & ALLOC_HIGHATOMIC )
0 commit comments