linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] async: Let kfree() out of the critical area of the lock
@ 2019-09-25 12:52 Yunfeng Ye
  2019-09-25 13:38 ` gregkh
  2019-09-25 15:20 ` Alexander Duyck
  0 siblings, 2 replies; 8+ messages in thread
From: Yunfeng Ye @ 2019-09-25 12:52 UTC (permalink / raw)
  To: gregkh, bvanassche, bhelgaas, dsterba, tglx, alexander.h.duyck,
	sakari.ailus
  Cc: linux-kernel

It's not necessary to put kfree() in the critical area of the lock, so
let it out.

Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
---
 kernel/async.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/async.c b/kernel/async.c
index 4f9c1d6..1de270d 100644
--- a/kernel/async.c
+++ b/kernel/async.c
@@ -135,12 +135,12 @@ static void async_run_entry_fn(struct work_struct *work)
 	list_del_init(&entry->domain_list);
 	list_del_init(&entry->global_list);

-	/* 3) free the entry */
-	kfree(entry);
 	atomic_dec(&entry_count);
-
 	spin_unlock_irqrestore(&async_lock, flags);

+	/* 3) free the entry */
+	kfree(entry);
+
 	/* 4) wake up any waiters */
 	wake_up(&async_done);
 }
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-09-27  1:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-25 12:52 [PATCH] async: Let kfree() out of the critical area of the lock Yunfeng Ye
2019-09-25 13:38 ` gregkh
2019-09-25 13:45   ` Yunfeng Ye
2019-09-25 15:20 ` Alexander Duyck
2019-09-26  7:58   ` Yunfeng Ye
2019-09-26 11:06     ` David Sterba
2019-09-26 15:18       ` Bart Van Assche
2019-09-27  1:00         ` Yunfeng Ye

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).