diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/exit.c | 9 | ||||
-rw-r--r-- | kernel/fork.c | 1 | ||||
-rw-r--r-- | kernel/sys.c | 7 |
3 files changed, 17 insertions, 0 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index b0c6f0c3a2df..7a5fd77f8fb0 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <linux/audit.h> /* for audit_free() */ | 42 | #include <linux/audit.h> /* for audit_free() */ |
43 | #include <linux/resource.h> | 43 | #include <linux/resource.h> |
44 | #include <linux/blkdev.h> | 44 | #include <linux/blkdev.h> |
45 | #include <linux/task_io_accounting_ops.h> | ||
45 | 46 | ||
46 | #include <asm/uaccess.h> | 47 | #include <asm/uaccess.h> |
47 | #include <asm/unistd.h> | 48 | #include <asm/unistd.h> |
@@ -113,6 +114,8 @@ static void __exit_signal(struct task_struct *tsk) | |||
113 | sig->nvcsw += tsk->nvcsw; | 114 | sig->nvcsw += tsk->nvcsw; |
114 | sig->nivcsw += tsk->nivcsw; | 115 | sig->nivcsw += tsk->nivcsw; |
115 | sig->sched_time += tsk->sched_time; | 116 | sig->sched_time += tsk->sched_time; |
117 | sig->inblock += task_io_get_inblock(tsk); | ||
118 | sig->oublock += task_io_get_oublock(tsk); | ||
116 | sig = NULL; /* Marker for below. */ | 119 | sig = NULL; /* Marker for below. */ |
117 | } | 120 | } |
118 | 121 | ||
@@ -1193,6 +1196,12 @@ static int wait_task_zombie(struct task_struct *p, int noreap, | |||
1193 | p->nvcsw + sig->nvcsw + sig->cnvcsw; | 1196 | p->nvcsw + sig->nvcsw + sig->cnvcsw; |
1194 | psig->cnivcsw += | 1197 | psig->cnivcsw += |
1195 | p->nivcsw + sig->nivcsw + sig->cnivcsw; | 1198 | p->nivcsw + sig->nivcsw + sig->cnivcsw; |
1199 | psig->cinblock += | ||
1200 | task_io_get_inblock(p) + | ||
1201 | sig->inblock + sig->cinblock; | ||
1202 | psig->coublock += | ||
1203 | task_io_get_oublock(p) + | ||
1204 | sig->oublock + sig->coublock; | ||
1196 | spin_unlock_irq(&p->parent->sighand->siglock); | 1205 | spin_unlock_irq(&p->parent->sighand->siglock); |
1197 | } | 1206 | } |
1198 | 1207 | ||
diff --git a/kernel/fork.c b/kernel/fork.c index 5dd3979747f5..da92e01aba6b 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -875,6 +875,7 @@ static inline int copy_signal(unsigned long clone_flags, struct task_struct * ts | |||
875 | sig->utime = sig->stime = sig->cutime = sig->cstime = cputime_zero; | 875 | sig->utime = sig->stime = sig->cutime = sig->cstime = cputime_zero; |
876 | sig->nvcsw = sig->nivcsw = sig->cnvcsw = sig->cnivcsw = 0; | 876 | sig->nvcsw = sig->nivcsw = sig->cnvcsw = sig->cnivcsw = 0; |
877 | sig->min_flt = sig->maj_flt = sig->cmin_flt = sig->cmaj_flt = 0; | 877 | sig->min_flt = sig->maj_flt = sig->cmin_flt = sig->cmaj_flt = 0; |
878 | sig->inblock = sig->oublock = sig->cinblock = sig->coublock = 0; | ||
878 | sig->sched_time = 0; | 879 | sig->sched_time = 0; |
879 | INIT_LIST_HEAD(&sig->cpu_timers[0]); | 880 | INIT_LIST_HEAD(&sig->cpu_timers[0]); |
880 | INIT_LIST_HEAD(&sig->cpu_timers[1]); | 881 | INIT_LIST_HEAD(&sig->cpu_timers[1]); |
diff --git a/kernel/sys.c b/kernel/sys.c index cdb7e9457ba6..ec319bbb0bd4 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/signal.h> | 29 | #include <linux/signal.h> |
30 | #include <linux/cn_proc.h> | 30 | #include <linux/cn_proc.h> |
31 | #include <linux/getcpu.h> | 31 | #include <linux/getcpu.h> |
32 | #include <linux/task_io_accounting_ops.h> | ||
32 | 33 | ||
33 | #include <linux/compat.h> | 34 | #include <linux/compat.h> |
34 | #include <linux/syscalls.h> | 35 | #include <linux/syscalls.h> |
@@ -2082,6 +2083,8 @@ static void k_getrusage(struct task_struct *p, int who, struct rusage *r) | |||
2082 | r->ru_nivcsw = p->signal->cnivcsw; | 2083 | r->ru_nivcsw = p->signal->cnivcsw; |
2083 | r->ru_minflt = p->signal->cmin_flt; | 2084 | r->ru_minflt = p->signal->cmin_flt; |
2084 | r->ru_majflt = p->signal->cmaj_flt; | 2085 | r->ru_majflt = p->signal->cmaj_flt; |
2086 | r->ru_inblock = p->signal->cinblock; | ||
2087 | r->ru_oublock = p->signal->coublock; | ||
2085 | 2088 | ||
2086 | if (who == RUSAGE_CHILDREN) | 2089 | if (who == RUSAGE_CHILDREN) |
2087 | break; | 2090 | break; |
@@ -2093,6 +2096,8 @@ static void k_getrusage(struct task_struct *p, int who, struct rusage *r) | |||
2093 | r->ru_nivcsw += p->signal->nivcsw; | 2096 | r->ru_nivcsw += p->signal->nivcsw; |
2094 | r->ru_minflt += p->signal->min_flt; | 2097 | r->ru_minflt += p->signal->min_flt; |
2095 | r->ru_majflt += p->signal->maj_flt; | 2098 | r->ru_majflt += p->signal->maj_flt; |
2099 | r->ru_inblock += p->signal->inblock; | ||
2100 | r->ru_oublock += p->signal->oublock; | ||
2096 | t = p; | 2101 | t = p; |
2097 | do { | 2102 | do { |
2098 | utime = cputime_add(utime, t->utime); | 2103 | utime = cputime_add(utime, t->utime); |
@@ -2101,6 +2106,8 @@ static void k_getrusage(struct task_struct *p, int who, struct rusage *r) | |||
2101 | r->ru_nivcsw += t->nivcsw; | 2106 | r->ru_nivcsw += t->nivcsw; |
2102 | r->ru_minflt += t->min_flt; | 2107 | r->ru_minflt += t->min_flt; |
2103 | r->ru_majflt += t->maj_flt; | 2108 | r->ru_majflt += t->maj_flt; |
2109 | r->ru_inblock += task_io_get_inblock(t); | ||
2110 | r->ru_oublock += task_io_get_oublock(t); | ||
2104 | t = next_thread(t); | 2111 | t = next_thread(t); |
2105 | } while (t != p); | 2112 | } while (t != p); |
2106 | break; | 2113 | break; |