Skip to contentSkip to conversation

async.c: reduce the critical region in lowest_in_progress()

PATCH New Hui Su 1 participant 1 message Oct 15, 2020

lore
Share & tools
lore

Hui Su

author
#0 lore raw

PATCH 1/1 async.c: reduce the critical region in lowest_in_progress()

The judgement of first do not need to be in the critical region. So move it out.

---
 kernel/async.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/async.c +1 -1
index 33258e6e20f8..9d33ffcc84c7 100644
@@ -96,10 +96,10 @@ static async_cookie_t lowest_in_progress(struct async_domain *domain)
 					struct async_entry, global_list);
 	}
 
+	spin_unlock_irqrestore(&async_lock, flags);
 	if (first)
 		ret = first->cookie;
 
-	spin_unlock_irqrestore(&async_lock, flags);
 	return ret;
 }
 
Signature · 1 line
2.25.1