Skip to contentSkip to conversation

rcu_sched_grace_period: kill the bogus flush_signals()

PATCH In review Oleg Nesterov 2 participants 3 messages May 3, 2009 – May 5, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rcu_sched_grace_period: kill the bogus flush_signals()

As a kernel thread, rcu_sched_grace_period() runs with all signals ignored. It can never receive a signal even if it sleeps in TASK_INTERRUPTIBLE, it needs the explicit allow_signal() to be visible for signals.

kernel/rcupreempt.c renamed from kernel/rcupreempt.c~ +1 -7
@@ -1356,17 +1356,11 @@ static int rcu_sched_grace_period(void *
 
 		rcu_ctrlblk.sched_sleep = rcu_sched_sleeping;
 		spin_unlock_irqrestore(&rcu_ctrlblk.schedlock, flags);
-		ret = 0;
+		ret = 0; /* unused */
 		__wait_event_interruptible(rcu_ctrlblk.sched_wq,
 			rcu_ctrlblk.sched_sleep != rcu_sched_sleeping,
 			ret);
 
-		/*
-		 * Signals would prevent us from sleeping, and we cannot
-		 * do much with them in any case.  So flush them.
-		 */
-		if (ret)
-			flush_signals(current);
 		couldsleepnext = 0;
 
 	} while (!kthread_should_stop());
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Oleg Nesterov

As a kernel thread, rcu_sched_grace_period() runs with all signals ignored. It can never receive a signal even if it sleeps in TASK_INTERRUPTIBLE, it needs the explicit allow_signal() to be visible for signals.

Good point!!!

Quoted 24 lines
kernel/rcupreempt.c renamed from kernel/rcupreempt.c~ +1 -7
@@ -1356,17 +1356,11 @@ static int rcu_sched_grace_period(void *
 
 		rcu_ctrlblk.sched_sleep = rcu_sched_sleeping;
 		spin_unlock_irqrestore(&rcu_ctrlblk.schedlock, flags);
-		ret = 0;
+		ret = 0; /* unused */
 		__wait_event_interruptible(rcu_ctrlblk.sched_wq,
 			rcu_ctrlblk.sched_sleep != rcu_sched_sleeping,
 			ret);
 
-		/*
-		 * Signals would prevent us from sleeping, and we cannot
-		 * do much with them in any case.  So flush them.
-		 */
-		if (ret)
-			flush_signals(current);
 		couldsleepnext = 0;
 
 	} while (!kthread_should_stop());
#2 lore raw

[tip:core/rcu] rcu: rcu_sched_grace_period(): kill the bogus flush_signals()

In reply to Oleg Nesterov
Commit-ID:  41c51c98f588edcdf6141cff1895df738e03ddd4
Gitweb:     http://git.kernel.org/tip/41c51c98f588edcdf6141cff1895df738e03ddd4
Author:     Oleg Nesterov <[email protected]>
AuthorDate: Sun, 3 May 2009 23:11:18 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 5 May 2009 20:28:05 +0200

rcu: rcu_sched_grace_period(): kill the bogus flush_signals()

As a kernel thread, rcu_sched_grace_period() runs with all signals ignored. It can never receive a signal even if it sleeps in TASK_INTERRUPTIBLE, it needs the explicit allow_signal() to be visible for signals.

[ Impact: reduce kernel size, remove dead code ]

LKML-Reference: <[email protected]>

---
 kernel/rcupreempt.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)
kernel/rcupreempt.c +1 -7
index ce97a4d..beb0e65 100644
@@ -1356,17 +1356,11 @@ static int rcu_sched_grace_period(void *arg)
 
 		rcu_ctrlblk.sched_sleep = rcu_sched_sleeping;
 		spin_unlock_irqrestore(&rcu_ctrlblk.schedlock, flags);
-		ret = 0;
+		ret = 0; /* unused */
 		__wait_event_interruptible(rcu_ctrlblk.sched_wq,
 			rcu_ctrlblk.sched_sleep != rcu_sched_sleeping,
 			ret);
 
-		/*
-		 * Signals would prevent us from sleeping, and we cannot
-		 * do much with them in any case.  So flush them.
-		 */
-		if (ret)
-			flush_signals(current);
 		couldsleepnext = 0;
 
 	} while (!kthread_should_stop());