[Devel] [PATCH vz7 v2 2/7] ub statd: small optimisations and clean ups

Stanislav Kinsburskiy skinsbursky at odin.com
Thu Oct 1 06:38:22 PDT 2015


From: Stanislav Kinsburskiy <skinsbursky at parallels.com>

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at parallels.com>
---
 kernel/bc/statd.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/kernel/bc/statd.c b/kernel/bc/statd.c
index b0b58a4..97602da 100644
--- a/kernel/bc/statd.c
+++ b/kernel/bc/statd.c
@@ -441,18 +441,16 @@ static inline void do_notifies(void)
 	ubstat_save_statistics();
 	/* send signals */
 	read_lock(&tasklist_lock);
-	while (!list_empty(&ubs_notify_list)) {
-		notify = list_entry(ubs_notify_list.next,
-				struct ub_stat_notify, list);
+	list_for_each_entry_safe(notify, tmp, &ubs_notify_list, list) {
 		task_send_sig(notify);
-		list_del(&notify->list);
-		list_add(&notify->list, &notif_free_list);
+		list_move(&notify->list, &notif_free_list);
 	}
 	read_unlock(&tasklist_lock);
 	spin_unlock(&ubs_notify_lock);
 
 	list_for_each_entry_safe(notify, tmp, &notif_free_list, list) {
 		put_task_struct(notify->task);
+		list_del(&notify->list);
 		kfree(notify);
 	}
 }




More information about the Devel mailing list