public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] async.c: reduce the critical region in lowest_in_progress()
@ 2020-10-15 14:05 Hui Su
  0 siblings, 0 replies; only message in thread
From: Hui Su @ 2020-10-15 14:05 UTC (permalink / raw)
  To: sh_def, leon, jgg, keescook, kvalo, linux-kernel

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

Signed-off-by: Hui Su <sh_def@163.com>
---
 kernel/async.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/async.c b/kernel/async.c
index 33258e6e20f8..9d33ffcc84c7 100644
--- a/kernel/async.c
+++ b/kernel/async.c
@@ -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;
 }
 
-- 
2.25.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-10-15 14:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-15 14:05 [PATCH] async.c: reduce the critical region in lowest_in_progress() Hui Su

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox