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>] [thread-next>] [day] [month] [year] [list]
Message-ID: <79ab3616c1a9206d3d5c5cfcd1b63c94ab8bddfc.1399366240.git.yangds.fnst@cn.fujitsu.com>
Date:	Tue, 6 May 2014 17:52:22 +0900
From:	Dongsheng Yang <yangds.fnst@...fujitsu.com>
To:	<mingo@...hat.com>, <peterz@...radead.org>
CC:	<linux-kernel@...r.kernel.org>,
	Dongsheng Yang <yangds.fnst@...fujitsu.com>
Subject: [PATCH 1/2] sched: Remove macro of NS_TO_JIFFIES in kernel/sched/sched.h.

As there is already a implementation in linux/jiffies.h to convert
a nsec to jiffies, so we can use it here rather than reimplement
it in sched.h.

Signed-off-by: Dongsheng Yang <yangds.fnst@...fujitsu.com>
---
 kernel/sched/fair.c  | 2 +-
 kernel/sched/sched.h | 6 +-----
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 43232b8..448ac443 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7636,7 +7636,7 @@ static unsigned int get_rr_interval_fair(struct rq *rq, struct task_struct *task
 	 * idle runqueue:
 	 */
 	if (rq->cfs.load.weight)
-		rr_interval = NS_TO_JIFFIES(sched_slice(cfs_rq_of(se), se));
+		rr_interval = nsecs_to_jiffies(sched_slice(cfs_rq_of(se), se));
 
 	return rr_interval;
 }
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 3563c81..bbc7e07 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -8,6 +8,7 @@
 #include <linux/stop_machine.h>
 #include <linux/tick.h>
 #include <linux/slab.h>
+#include <linux/jiffies.h>
 
 #include "cpupri.h"
 #include "cpudeadline.h"
@@ -24,11 +25,6 @@ extern long calc_load_fold_active(struct rq *this_rq);
 extern void update_cpu_load_active(struct rq *this_rq);
 
 /*
- * Helpers for converting nanosecond timing to jiffy resolution
- */
-#define NS_TO_JIFFIES(TIME)	((unsigned long)(TIME) / (NSEC_PER_SEC / HZ))
-
-/*
  * Increase resolution of nice-level calculations for 64-bit architectures.
  * The extra resolution improves shares distribution and load balancing of
  * low-weight task groups (eg. nice +19 on an autogroup), deeper taskgroup
-- 
1.8.2.1

--
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