lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAJd=RBCGT09TZL-KfAi5Ccm9MjHhzocyyQfgaNhTwzWBjjTuUg@mail.gmail.com>
Date:	Fri, 25 May 2012 21:34:19 +0800
From:	Hillf Danton <dhillf@...il.com>
To:	LKML <linux-kernel@...r.kernel.org>,
	Hillf Danton <dhillf@...il.com>
Subject: [patch 2/4] BFS 420: fix ttwu_stat

The last parameter, wake_flags, as not used, is replaced by the result that the
sleeper is activated successfully or not. If not, only to increase ttwu counter.

--- a/kernel/sched/bfs.c	Mon May 14 20:50:38 2012
+++ b/kernel/sched/bfs.c	Fri May 25 20:28:00 2012
@@ -1486,7 +1486,7 @@ static void try_preempt(struct task_stru
 #endif /* CONFIG_SMP */

 static void
-ttwu_stat(struct task_struct *p, int cpu, int wake_flags)
+ttwu_stat(struct task_struct *p, int cpu, bool success)
 {
 #ifdef CONFIG_SCHEDSTATS
 	struct rq *rq = this_rq();
@@ -1494,6 +1494,8 @@ ttwu_stat(struct task_struct *p, int cpu
 #ifdef CONFIG_SMP
 	int this_cpu = smp_processor_id();

+	if (!success)
+		goto out;
 	if (cpu == this_cpu)
 		schedstat_inc(rq, ttwu_local);
 	else {
@@ -1508,7 +1510,7 @@ ttwu_stat(struct task_struct *p, int cpu
 		}
 		rcu_read_unlock();
 	}
-
+out:
 #endif /* CONFIG_SMP */

 	schedstat_inc(rq, ttwu_count);
@@ -1603,7 +1605,7 @@ out_running:
 out_unlock:
 	task_grq_unlock(&flags);

-	ttwu_stat(p, cpu, wake_flags);
+	ttwu_stat(p, cpu, success);

 	put_cpu();

@@ -1634,7 +1636,7 @@ static void try_to_wake_up_local(struct
 			schedstat_inc(rq, ttwu_local);
 		}
 		ttwu_activate(p, rq, false);
-		ttwu_stat(p, smp_processor_id(), 0);
+		ttwu_stat(p, smp_processor_id(), true);
 		success = true;
 	}
 	ttwu_post_activation(p, rq, success);
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ