# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1509  -> 1.1510 
#	arch/ia64/kernel/time.c	1.37    -> 1.38   
#	      kernel/sched.c	1.224   -> 1.225  
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/11/24	jbarnes@tomahawk.engr.sgi.com	1.1510
# scheduling hacks for large systems
# --------------------------------------------
#
diff -Nru a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
--- a/arch/ia64/kernel/time.c	Mon Nov 24 12:50:27 2003
+++ b/arch/ia64/kernel/time.c	Mon Nov 24 12:50:27 2003
@@ -47,7 +47,7 @@
 {
 	unsigned long offset = ia64_get_itc();
 
-	return (offset * local_cpu_data->nsec_per_cyc) >> IA64_NSEC_PER_CYC_SHIFT;
+	return jiffies * (1000000000 / HZ);
 }
 
 static void
diff -Nru a/kernel/sched.c b/kernel/sched.c
--- a/kernel/sched.c	Mon Nov 24 12:50:27 2003
+++ b/kernel/sched.c	Mon Nov 24 12:50:27 2003
@@ -1157,7 +1157,7 @@
 {
 	unsigned long delta = sched_clock() - tsk->timestamp;
 
-	if (!idle && (delta <= JIFFIES_TO_NS(cache_decay_ticks)))
+	if (delta <= JIFFIES_TO_NS(cache_decay_ticks))
 		return 0;
 	if (task_running(rq, tsk))
 		return 0;
@@ -1264,9 +1264,9 @@
  * On NUMA, do a node-rebalance every 400 msecs.
  */
 #define IDLE_REBALANCE_TICK (HZ/1000 ?: 1)
-#define BUSY_REBALANCE_TICK (HZ/5 ?: 1)
-#define IDLE_NODE_REBALANCE_TICK (IDLE_REBALANCE_TICK * 5)
-#define BUSY_NODE_REBALANCE_TICK (BUSY_REBALANCE_TICK * 2)
+#define BUSY_REBALANCE_TICK (HZ/10 ?: 1)
+#define IDLE_NODE_REBALANCE_TICK (IDLE_REBALANCE_TICK * 100)
+#define BUSY_NODE_REBALANCE_TICK (BUSY_REBALANCE_TICK * 50)
 
 #ifdef CONFIG_NUMA
 static void balance_node(runqueue_t *this_rq, int idle, int this_cpu)
@@ -1287,8 +1287,10 @@
 {
 #ifdef CONFIG_NUMA
 	int this_cpu = smp_processor_id();
-#endif
+	unsigned long j = jiffies + this_cpu;
+#else
 	unsigned long j = jiffies;
+#endif
 
 	/*
 	 * First do inter-node rebalancing, then intra-node rebalancing,
