[PATCH] 3/6: 64 bit process start times

Tim Schmielau (tim@physik3.uni-rostock.de)
Sat, 11 May 2002 12:27:25 +0200 (CEST)


Bump up the start_time value of processes to 64 bit. This actually is overkill,
since "borrowing" a few bits from some other variable would suffice.
I just didn't know were to steal them and how to make access less ugly then.

Without this patch, processes that survive 32 bit jiffies wraparound are
reported as having started in the future.

--- linux-2.5.15/include/linux/sched.h Thu May 9 17:47:15 2002
+++ linux-2.5.15-j64/include/linux/sched.h Thu May 9 17:48:20 2002
@@ -294,7 +294,7 @@
unsigned long it_real_incr, it_prof_incr, it_virt_incr;
struct timer_list real_timer;
struct tms times;
- unsigned long start_time;
+ u64 start_time;
long per_cpu_utime[NR_CPUS], per_cpu_stime[NR_CPUS];
/* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */
unsigned long min_flt, maj_flt, nswap, cmin_flt, cmaj_flt, cnswap;

--- linux-2.5.15/kernel/fork.c Sun May 5 08:30:40 2002
+++ linux-2.5.15-j64/kernel/fork.c Thu May 9 17:48:21 2002
@@ -709,7 +709,7 @@
#endif
p->array = NULL;
p->lock_depth = -1; /* -1 = no lock */
- p->start_time = jiffies;
+ p->start_time = get_jiffies64();

INIT_LIST_HEAD(&p->local_pages);

--- linux-2.5.15/fs/proc/array.c Thu May 9 17:47:15 2002
+++ linux-2.5.15-j64/fs/proc/array.c Thu May 9 17:48:21 2002
@@ -345,7 +345,7 @@
ppid = task->pid ? task->real_parent->pid : 0;
read_unlock(&tasklist_lock);
res = sprintf(buffer,"%d (%s) %c %d %d %d %d %d %lu %lu \
-%lu %lu %lu %lu %lu %ld %ld %ld %ld %ld %ld %lu %lu %ld %lu %lu %lu %lu %lu \
+%lu %lu %lu %lu %lu %ld %ld %ld %ld %ld %ld %llu %lu %ld %lu %lu %lu %lu %lu \
%lu %lu %lu %lu %lu %lu %lu %lu %d %d\n",
task->pid,
task->comm,
@@ -368,7 +368,7 @@
nice,
0UL /* removed */,
task->it_real_value,
- task->start_time,
+ (unsigned long long)(task->start_time),
vsize,
mm ? mm->rss : 0, /* you might want to shift this left 3 */
task->rlim[RLIMIT_RSS].rlim_cur,

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