diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/taskstats.c | 1 | ||||
| -rw-r--r-- | kernel/tsacct.c | 15 | ||||
| -rw-r--r-- | kernel/workqueue.c | 7 |
3 files changed, 15 insertions, 8 deletions
diff --git a/kernel/taskstats.c b/kernel/taskstats.c index e19ce1454ee1..e66046456f4f 100644 --- a/kernel/taskstats.c +++ b/kernel/taskstats.c | |||
| @@ -655,6 +655,7 @@ static struct genl_ops taskstats_ops = { | |||
| 655 | .cmd = TASKSTATS_CMD_GET, | 655 | .cmd = TASKSTATS_CMD_GET, |
| 656 | .doit = taskstats_user_cmd, | 656 | .doit = taskstats_user_cmd, |
| 657 | .policy = taskstats_cmd_get_policy, | 657 | .policy = taskstats_cmd_get_policy, |
| 658 | .flags = GENL_ADMIN_PERM, | ||
| 658 | }; | 659 | }; |
| 659 | 660 | ||
| 660 | static struct genl_ops cgroupstats_ops = { | 661 | static struct genl_ops cgroupstats_ops = { |
diff --git a/kernel/tsacct.c b/kernel/tsacct.c index 24dc60d9fa1f..5bbfac85866e 100644 --- a/kernel/tsacct.c +++ b/kernel/tsacct.c | |||
| @@ -78,6 +78,7 @@ void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk) | |||
| 78 | 78 | ||
| 79 | #define KB 1024 | 79 | #define KB 1024 |
| 80 | #define MB (1024*KB) | 80 | #define MB (1024*KB) |
| 81 | #define KB_MASK (~(KB-1)) | ||
| 81 | /* | 82 | /* |
| 82 | * fill in extended accounting fields | 83 | * fill in extended accounting fields |
| 83 | */ | 84 | */ |
| @@ -95,14 +96,14 @@ void xacct_add_tsk(struct taskstats *stats, struct task_struct *p) | |||
| 95 | stats->hiwater_vm = get_mm_hiwater_vm(mm) * PAGE_SIZE / KB; | 96 | stats->hiwater_vm = get_mm_hiwater_vm(mm) * PAGE_SIZE / KB; |
| 96 | mmput(mm); | 97 | mmput(mm); |
| 97 | } | 98 | } |
| 98 | stats->read_char = p->ioac.rchar; | 99 | stats->read_char = p->ioac.rchar & KB_MASK; |
| 99 | stats->write_char = p->ioac.wchar; | 100 | stats->write_char = p->ioac.wchar & KB_MASK; |
| 100 | stats->read_syscalls = p->ioac.syscr; | 101 | stats->read_syscalls = p->ioac.syscr & KB_MASK; |
| 101 | stats->write_syscalls = p->ioac.syscw; | 102 | stats->write_syscalls = p->ioac.syscw & KB_MASK; |
| 102 | #ifdef CONFIG_TASK_IO_ACCOUNTING | 103 | #ifdef CONFIG_TASK_IO_ACCOUNTING |
| 103 | stats->read_bytes = p->ioac.read_bytes; | 104 | stats->read_bytes = p->ioac.read_bytes & KB_MASK; |
| 104 | stats->write_bytes = p->ioac.write_bytes; | 105 | stats->write_bytes = p->ioac.write_bytes & KB_MASK; |
| 105 | stats->cancelled_write_bytes = p->ioac.cancelled_write_bytes; | 106 | stats->cancelled_write_bytes = p->ioac.cancelled_write_bytes & KB_MASK; |
| 106 | #else | 107 | #else |
| 107 | stats->read_bytes = 0; | 108 | stats->read_bytes = 0; |
| 108 | stats->write_bytes = 0; | 109 | stats->write_bytes = 0; |
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 25fb1b0e53fa..1783aabc6128 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
| @@ -2412,8 +2412,13 @@ reflush: | |||
| 2412 | 2412 | ||
| 2413 | for_each_cwq_cpu(cpu, wq) { | 2413 | for_each_cwq_cpu(cpu, wq) { |
| 2414 | struct cpu_workqueue_struct *cwq = get_cwq(cpu, wq); | 2414 | struct cpu_workqueue_struct *cwq = get_cwq(cpu, wq); |
| 2415 | bool drained; | ||
| 2415 | 2416 | ||
| 2416 | if (!cwq->nr_active && list_empty(&cwq->delayed_works)) | 2417 | spin_lock_irq(&cwq->gcwq->lock); |
| 2418 | drained = !cwq->nr_active && list_empty(&cwq->delayed_works); | ||
| 2419 | spin_unlock_irq(&cwq->gcwq->lock); | ||
| 2420 | |||
| 2421 | if (drained) | ||
| 2417 | continue; | 2422 | continue; |
| 2418 | 2423 | ||
| 2419 | if (++flush_cnt == 10 || | 2424 | if (++flush_cnt == 10 || |
