All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@tv-sign.ru>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>
Subject: [PATCH,TRIVIAL] unused task_struct.shared_unblocked variable.
Date: Mon, 16 Sep 2002 20:00:13 +0400	[thread overview]
Message-ID: <3D86000D.311CAE4F@tv-sign.ru> (raw)

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

                 reply	other threads:[~2002-09-16 15:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D86000D.311CAE4F@tv-sign.ru \
    --to=oleg@tv-sign.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.