diff options
author | David S. Miller <davem@davemloft.net> | 2008-07-27 19:51:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-27 19:51:21 -0400 |
commit | 281c7413ed914623d3245299a4761b6b27ab9fdb (patch) | |
tree | 182b5222a7ad4b77c32f7845ea777ca665d7def2 /kernel | |
parent | 2ab61b01110aa04cd853c619a74881e3225a5e24 (diff) | |
parent | c9272c4f9fbe2087beb3392f526dc5b19efaa56b (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/exit.c | 30 | ||||
-rw-r--r-- | kernel/fork.c | 15 | ||||
-rw-r--r-- | kernel/sysctl.c | 16 | ||||
-rw-r--r-- | kernel/trace/trace.c | 1 | ||||
-rw-r--r-- | kernel/tsacct.c | 8 |
5 files changed, 18 insertions, 52 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 0caf590548a0..eb4d6470d1d0 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -121,18 +121,7 @@ static void __exit_signal(struct task_struct *tsk) | |||
121 | sig->nivcsw += tsk->nivcsw; | 121 | sig->nivcsw += tsk->nivcsw; |
122 | sig->inblock += task_io_get_inblock(tsk); | 122 | sig->inblock += task_io_get_inblock(tsk); |
123 | sig->oublock += task_io_get_oublock(tsk); | 123 | sig->oublock += task_io_get_oublock(tsk); |
124 | #ifdef CONFIG_TASK_XACCT | 124 | task_io_accounting_add(&sig->ioac, &tsk->ioac); |
125 | sig->rchar += tsk->rchar; | ||
126 | sig->wchar += tsk->wchar; | ||
127 | sig->syscr += tsk->syscr; | ||
128 | sig->syscw += tsk->syscw; | ||
129 | #endif /* CONFIG_TASK_XACCT */ | ||
130 | #ifdef CONFIG_TASK_IO_ACCOUNTING | ||
131 | sig->ioac.read_bytes += tsk->ioac.read_bytes; | ||
132 | sig->ioac.write_bytes += tsk->ioac.write_bytes; | ||
133 | sig->ioac.cancelled_write_bytes += | ||
134 | tsk->ioac.cancelled_write_bytes; | ||
135 | #endif /* CONFIG_TASK_IO_ACCOUNTING */ | ||
136 | sig->sum_sched_runtime += tsk->se.sum_exec_runtime; | 125 | sig->sum_sched_runtime += tsk->se.sum_exec_runtime; |
137 | sig = NULL; /* Marker for below. */ | 126 | sig = NULL; /* Marker for below. */ |
138 | } | 127 | } |
@@ -1363,21 +1352,8 @@ static int wait_task_zombie(struct task_struct *p, int options, | |||
1363 | psig->coublock += | 1352 | psig->coublock += |
1364 | task_io_get_oublock(p) + | 1353 | task_io_get_oublock(p) + |
1365 | sig->oublock + sig->coublock; | 1354 | sig->oublock + sig->coublock; |
1366 | #ifdef CONFIG_TASK_XACCT | 1355 | task_io_accounting_add(&psig->ioac, &p->ioac); |
1367 | psig->rchar += p->rchar + sig->rchar; | 1356 | task_io_accounting_add(&psig->ioac, &sig->ioac); |
1368 | psig->wchar += p->wchar + sig->wchar; | ||
1369 | psig->syscr += p->syscr + sig->syscr; | ||
1370 | psig->syscw += p->syscw + sig->syscw; | ||
1371 | #endif /* CONFIG_TASK_XACCT */ | ||
1372 | #ifdef CONFIG_TASK_IO_ACCOUNTING | ||
1373 | psig->ioac.read_bytes += | ||
1374 | p->ioac.read_bytes + sig->ioac.read_bytes; | ||
1375 | psig->ioac.write_bytes += | ||
1376 | p->ioac.write_bytes + sig->ioac.write_bytes; | ||
1377 | psig->ioac.cancelled_write_bytes += | ||
1378 | p->ioac.cancelled_write_bytes + | ||
1379 | sig->ioac.cancelled_write_bytes; | ||
1380 | #endif /* CONFIG_TASK_IO_ACCOUNTING */ | ||
1381 | spin_unlock_irq(&p->parent->sighand->siglock); | 1357 | spin_unlock_irq(&p->parent->sighand->siglock); |
1382 | } | 1358 | } |
1383 | 1359 | ||
diff --git a/kernel/fork.c b/kernel/fork.c index 5e050c1317c4..8214ba7c8bb1 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -806,12 +806,7 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) | |||
806 | sig->nvcsw = sig->nivcsw = sig->cnvcsw = sig->cnivcsw = 0; | 806 | sig->nvcsw = sig->nivcsw = sig->cnvcsw = sig->cnivcsw = 0; |
807 | sig->min_flt = sig->maj_flt = sig->cmin_flt = sig->cmaj_flt = 0; | 807 | sig->min_flt = sig->maj_flt = sig->cmin_flt = sig->cmaj_flt = 0; |
808 | sig->inblock = sig->oublock = sig->cinblock = sig->coublock = 0; | 808 | sig->inblock = sig->oublock = sig->cinblock = sig->coublock = 0; |
809 | #ifdef CONFIG_TASK_XACCT | 809 | task_io_accounting_init(&sig->ioac); |
810 | sig->rchar = sig->wchar = sig->syscr = sig->syscw = 0; | ||
811 | #endif | ||
812 | #ifdef CONFIG_TASK_IO_ACCOUNTING | ||
813 | memset(&sig->ioac, 0, sizeof(sig->ioac)); | ||
814 | #endif | ||
815 | sig->sum_sched_runtime = 0; | 810 | sig->sum_sched_runtime = 0; |
816 | INIT_LIST_HEAD(&sig->cpu_timers[0]); | 811 | INIT_LIST_HEAD(&sig->cpu_timers[0]); |
817 | INIT_LIST_HEAD(&sig->cpu_timers[1]); | 812 | INIT_LIST_HEAD(&sig->cpu_timers[1]); |
@@ -994,13 +989,7 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
994 | p->last_switch_timestamp = 0; | 989 | p->last_switch_timestamp = 0; |
995 | #endif | 990 | #endif |
996 | 991 | ||
997 | #ifdef CONFIG_TASK_XACCT | 992 | task_io_accounting_init(&p->ioac); |
998 | p->rchar = 0; /* I/O counter: bytes read */ | ||
999 | p->wchar = 0; /* I/O counter: bytes written */ | ||
1000 | p->syscr = 0; /* I/O counter: read syscalls */ | ||
1001 | p->syscw = 0; /* I/O counter: write syscalls */ | ||
1002 | #endif | ||
1003 | task_io_accounting_init(p); | ||
1004 | acct_clear_integrals(p); | 993 | acct_clear_integrals(p); |
1005 | 994 | ||
1006 | p->it_virt_expires = cputime_zero; | 995 | p->it_virt_expires = cputime_zero; |
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 911d846f0503..fe4713347275 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -1680,43 +1680,45 @@ static __init int sysctl_init(void) | |||
1680 | 1680 | ||
1681 | core_initcall(sysctl_init); | 1681 | core_initcall(sysctl_init); |
1682 | 1682 | ||
1683 | static int is_branch_in(struct ctl_table *branch, struct ctl_table *table) | 1683 | static struct ctl_table *is_branch_in(struct ctl_table *branch, |
1684 | struct ctl_table *table) | ||
1684 | { | 1685 | { |
1685 | struct ctl_table *p; | 1686 | struct ctl_table *p; |
1686 | const char *s = branch->procname; | 1687 | const char *s = branch->procname; |
1687 | 1688 | ||
1688 | /* branch should have named subdirectory as its first element */ | 1689 | /* branch should have named subdirectory as its first element */ |
1689 | if (!s || !branch->child) | 1690 | if (!s || !branch->child) |
1690 | return 0; | 1691 | return NULL; |
1691 | 1692 | ||
1692 | /* ... and nothing else */ | 1693 | /* ... and nothing else */ |
1693 | if (branch[1].procname || branch[1].ctl_name) | 1694 | if (branch[1].procname || branch[1].ctl_name) |
1694 | return 0; | 1695 | return NULL; |
1695 | 1696 | ||
1696 | /* table should contain subdirectory with the same name */ | 1697 | /* table should contain subdirectory with the same name */ |
1697 | for (p = table; p->procname || p->ctl_name; p++) { | 1698 | for (p = table; p->procname || p->ctl_name; p++) { |
1698 | if (!p->child) | 1699 | if (!p->child) |
1699 | continue; | 1700 | continue; |
1700 | if (p->procname && strcmp(p->procname, s) == 0) | 1701 | if (p->procname && strcmp(p->procname, s) == 0) |
1701 | return 1; | 1702 | return p; |
1702 | } | 1703 | } |
1703 | return 0; | 1704 | return NULL; |
1704 | } | 1705 | } |
1705 | 1706 | ||
1706 | /* see if attaching q to p would be an improvement */ | 1707 | /* see if attaching q to p would be an improvement */ |
1707 | static void try_attach(struct ctl_table_header *p, struct ctl_table_header *q) | 1708 | static void try_attach(struct ctl_table_header *p, struct ctl_table_header *q) |
1708 | { | 1709 | { |
1709 | struct ctl_table *to = p->ctl_table, *by = q->ctl_table; | 1710 | struct ctl_table *to = p->ctl_table, *by = q->ctl_table; |
1711 | struct ctl_table *next; | ||
1710 | int is_better = 0; | 1712 | int is_better = 0; |
1711 | int not_in_parent = !p->attached_by; | 1713 | int not_in_parent = !p->attached_by; |
1712 | 1714 | ||
1713 | while (is_branch_in(by, to)) { | 1715 | while ((next = is_branch_in(by, to)) != NULL) { |
1714 | if (by == q->attached_by) | 1716 | if (by == q->attached_by) |
1715 | is_better = 1; | 1717 | is_better = 1; |
1716 | if (to == p->attached_by) | 1718 | if (to == p->attached_by) |
1717 | not_in_parent = 1; | 1719 | not_in_parent = 1; |
1718 | by = by->child; | 1720 | by = by->child; |
1719 | to = to->child; | 1721 | to = next->child; |
1720 | } | 1722 | } |
1721 | 1723 | ||
1722 | if (is_better && not_in_parent) { | 1724 | if (is_better && not_in_parent) { |
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index fc20e09a6cb1..8f3fb3db61c3 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -1183,7 +1183,6 @@ static void *find_next_entry_inc(struct trace_iterator *iter) | |||
1183 | static void *s_next(struct seq_file *m, void *v, loff_t *pos) | 1183 | static void *s_next(struct seq_file *m, void *v, loff_t *pos) |
1184 | { | 1184 | { |
1185 | struct trace_iterator *iter = m->private; | 1185 | struct trace_iterator *iter = m->private; |
1186 | void *last_ent = iter->ent; | ||
1187 | int i = (int)*pos; | 1186 | int i = (int)*pos; |
1188 | void *ent; | 1187 | void *ent; |
1189 | 1188 | ||
diff --git a/kernel/tsacct.c b/kernel/tsacct.c index 3da47ccdc5e5..8ebcd8532dfb 100644 --- a/kernel/tsacct.c +++ b/kernel/tsacct.c | |||
@@ -94,10 +94,10 @@ void xacct_add_tsk(struct taskstats *stats, struct task_struct *p) | |||
94 | stats->hiwater_vm = mm->hiwater_vm * PAGE_SIZE / KB; | 94 | stats->hiwater_vm = mm->hiwater_vm * PAGE_SIZE / KB; |
95 | mmput(mm); | 95 | mmput(mm); |
96 | } | 96 | } |
97 | stats->read_char = p->rchar; | 97 | stats->read_char = p->ioac.rchar; |
98 | stats->write_char = p->wchar; | 98 | stats->write_char = p->ioac.wchar; |
99 | stats->read_syscalls = p->syscr; | 99 | stats->read_syscalls = p->ioac.syscr; |
100 | stats->write_syscalls = p->syscw; | 100 | stats->write_syscalls = p->ioac.syscw; |
101 | #ifdef CONFIG_TASK_IO_ACCOUNTING | 101 | #ifdef CONFIG_TASK_IO_ACCOUNTING |
102 | stats->read_bytes = p->ioac.read_bytes; | 102 | stats->read_bytes = p->ioac.read_bytes; |
103 | stats->write_bytes = p->ioac.write_bytes; | 103 | stats->write_bytes = p->ioac.write_bytes; |