[PATCH,TRIVIAL] unused task_struct.shared_unblocked variable.

Oleg Nesterov (oleg@tv-sign.ru)
Mon, 16 Sep 2002 20:00:13 +0400


Hello.

The task_struct.shared_unblocked variable is unused.

The 'old_state' variable in try_to_wake_up() is unneeded.

The third recheck of rq->nr_running after load_balance()
in schedule() is unneeded. Compiler should optimize it,
but it looks slightly confusing (imho).

2.5.34 introduced this change in force_sig_info()

- return send_sig_info(sig, info, t);
+ return send_sig_info(sig, (void *)1, t);

I beleive, it is wrong, info can carry useful information
from do_page_fault, traps. And this (info *)1 does not
prevent send_signal() from allocation of siginfo struct.
Ingo, could you please clarify?

Oleg.

--- linux-2.5.35/include/linux/sched.h.orig Mon Sep 16 18:11:32 2002
+++ linux-2.5.35/include/linux/sched.h Mon Sep 16 18:12:21 2002
@@ -374,7 +374,7 @@
spinlock_t sigmask_lock; /* Protects signal and blocked */
struct signal_struct *sig;

- sigset_t blocked, real_blocked, shared_unblocked;
+ sigset_t blocked, real_blocked;
struct sigpending pending;

unsigned long sas_ss_sp;
--- linux-2.5.35/kernel/sched.c.orig Mon Sep 16 13:36:59 2002
+++ linux-2.5.35/kernel/sched.c Mon Sep 16 18:39:11 2002
@@ -401,12 +401,10 @@
{
unsigned long flags;
int success = 0;
- long old_state;
runqueue_t *rq;

repeat_lock_task:
rq = task_rq_lock(p, &flags);
- old_state = p->state;
if (!p->array) {
/*
* Fast-migrate the task if it's not running or runnable
@@ -420,7 +418,7 @@
task_rq_unlock(rq, &flags);
goto repeat_lock_task;
}
- if (old_state == TASK_UNINTERRUPTIBLE)
+ if (p->state == TASK_UNINTERRUPTIBLE)
rq->nr_uninterruptible--;
activate_task(p, rq);

@@ -977,12 +975,13 @@
if (unlikely(!rq->nr_running)) {
#if CONFIG_SMP
load_balance(rq, 1);
- if (rq->nr_running)
- goto pick_next_task;
+ if (!rq->nr_running)
#endif
- next = rq->idle;
- rq->expired_timestamp = 0;
- goto switch_tasks;
+ {
+ next = rq->idle;
+ rq->expired_timestamp = 0;
+ goto switch_tasks;
+ }
}

array = rq->active;
--- linux-2.5.35/kernel/signal.c.orig Mon Sep 16 19:31:23 2002
+++ linux-2.5.35/kernel/signal.c Mon Sep 16 19:32:53 2002
@@ -783,7 +783,7 @@
recalc_sigpending_tsk(t);
spin_unlock_irqrestore(&t->sigmask_lock, flags);

- return send_sig_info(sig, (void *)1, t);
+ return send_sig_info(sig, info, t);
}

static int
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/