diff options
Diffstat (limited to 'fs/proc')
| -rw-r--r-- | fs/proc/base.c | 8 | ||||
| -rw-r--r-- | fs/proc/softirqs.c | 4 | ||||
| -rw-r--r-- | fs/proc/stat.c | 14 | ||||
| -rw-r--r-- | fs/proc/task_mmu.c | 6 |
4 files changed, 15 insertions, 17 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 9b094c1c8465..f3d02ca461ec 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
| @@ -226,7 +226,7 @@ struct mm_struct *mm_for_maps(struct task_struct *task) | |||
| 226 | { | 226 | { |
| 227 | struct mm_struct *mm; | 227 | struct mm_struct *mm; |
| 228 | 228 | ||
| 229 | if (mutex_lock_killable(&task->cred_guard_mutex)) | 229 | if (mutex_lock_killable(&task->signal->cred_guard_mutex)) |
| 230 | return NULL; | 230 | return NULL; |
| 231 | 231 | ||
| 232 | mm = get_task_mm(task); | 232 | mm = get_task_mm(task); |
| @@ -235,7 +235,7 @@ struct mm_struct *mm_for_maps(struct task_struct *task) | |||
| 235 | mmput(mm); | 235 | mmput(mm); |
| 236 | mm = NULL; | 236 | mm = NULL; |
| 237 | } | 237 | } |
| 238 | mutex_unlock(&task->cred_guard_mutex); | 238 | mutex_unlock(&task->signal->cred_guard_mutex); |
| 239 | 239 | ||
| 240 | return mm; | 240 | return mm; |
| 241 | } | 241 | } |
| @@ -2354,14 +2354,14 @@ static ssize_t proc_pid_attr_write(struct file * file, const char __user * buf, | |||
| 2354 | goto out_free; | 2354 | goto out_free; |
| 2355 | 2355 | ||
| 2356 | /* Guard against adverse ptrace interaction */ | 2356 | /* Guard against adverse ptrace interaction */ |
| 2357 | length = mutex_lock_interruptible(&task->cred_guard_mutex); | 2357 | length = mutex_lock_interruptible(&task->signal->cred_guard_mutex); |
| 2358 | if (length < 0) | 2358 | if (length < 0) |
| 2359 | goto out_free; | 2359 | goto out_free; |
| 2360 | 2360 | ||
| 2361 | length = security_setprocattr(task, | 2361 | length = security_setprocattr(task, |
| 2362 | (char*)file->f_path.dentry->d_name.name, | 2362 | (char*)file->f_path.dentry->d_name.name, |
| 2363 | (void*)page, count); | 2363 | (void*)page, count); |
| 2364 | mutex_unlock(&task->cred_guard_mutex); | 2364 | mutex_unlock(&task->signal->cred_guard_mutex); |
| 2365 | out_free: | 2365 | out_free: |
| 2366 | free_page((unsigned long) page); | 2366 | free_page((unsigned long) page); |
| 2367 | out: | 2367 | out: |
diff --git a/fs/proc/softirqs.c b/fs/proc/softirqs.c index 1807c2419f17..37994737c983 100644 --- a/fs/proc/softirqs.c +++ b/fs/proc/softirqs.c | |||
| @@ -10,13 +10,13 @@ static int show_softirqs(struct seq_file *p, void *v) | |||
| 10 | { | 10 | { |
| 11 | int i, j; | 11 | int i, j; |
| 12 | 12 | ||
| 13 | seq_printf(p, " "); | 13 | seq_printf(p, " "); |
| 14 | for_each_possible_cpu(i) | 14 | for_each_possible_cpu(i) |
| 15 | seq_printf(p, "CPU%-8d", i); | 15 | seq_printf(p, "CPU%-8d", i); |
| 16 | seq_printf(p, "\n"); | 16 | seq_printf(p, "\n"); |
| 17 | 17 | ||
| 18 | for (i = 0; i < NR_SOFTIRQS; i++) { | 18 | for (i = 0; i < NR_SOFTIRQS; i++) { |
| 19 | seq_printf(p, "%8s:", softirq_to_name[i]); | 19 | seq_printf(p, "%12s:", softirq_to_name[i]); |
| 20 | for_each_possible_cpu(j) | 20 | for_each_possible_cpu(j) |
| 21 | seq_printf(p, " %10u", kstat_softirqs_cpu(i, j)); | 21 | seq_printf(p, " %10u", kstat_softirqs_cpu(i, j)); |
| 22 | seq_printf(p, "\n"); | 22 | seq_printf(p, "\n"); |
diff --git a/fs/proc/stat.c b/fs/proc/stat.c index bf31b03fc275..e15a19c93bae 100644 --- a/fs/proc/stat.c +++ b/fs/proc/stat.c | |||
| @@ -31,7 +31,6 @@ static int show_stat(struct seq_file *p, void *v) | |||
| 31 | u64 sum_softirq = 0; | 31 | u64 sum_softirq = 0; |
| 32 | unsigned int per_softirq_sums[NR_SOFTIRQS] = {0}; | 32 | unsigned int per_softirq_sums[NR_SOFTIRQS] = {0}; |
| 33 | struct timespec boottime; | 33 | struct timespec boottime; |
| 34 | unsigned int per_irq_sum; | ||
| 35 | 34 | ||
| 36 | user = nice = system = idle = iowait = | 35 | user = nice = system = idle = iowait = |
| 37 | irq = softirq = steal = cputime64_zero; | 36 | irq = softirq = steal = cputime64_zero; |
| @@ -52,9 +51,7 @@ static int show_stat(struct seq_file *p, void *v) | |||
| 52 | guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest); | 51 | guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest); |
| 53 | guest_nice = cputime64_add(guest_nice, | 52 | guest_nice = cputime64_add(guest_nice, |
| 54 | kstat_cpu(i).cpustat.guest_nice); | 53 | kstat_cpu(i).cpustat.guest_nice); |
| 55 | for_each_irq_nr(j) { | 54 | sum += kstat_cpu_irqs_sum(i); |
| 56 | sum += kstat_irqs_cpu(j, i); | ||
| 57 | } | ||
| 58 | sum += arch_irq_stat_cpu(i); | 55 | sum += arch_irq_stat_cpu(i); |
| 59 | 56 | ||
| 60 | for (j = 0; j < NR_SOFTIRQS; j++) { | 57 | for (j = 0; j < NR_SOFTIRQS; j++) { |
| @@ -110,13 +107,8 @@ static int show_stat(struct seq_file *p, void *v) | |||
| 110 | seq_printf(p, "intr %llu", (unsigned long long)sum); | 107 | seq_printf(p, "intr %llu", (unsigned long long)sum); |
| 111 | 108 | ||
| 112 | /* sum again ? it could be updated? */ | 109 | /* sum again ? it could be updated? */ |
| 113 | for_each_irq_nr(j) { | 110 | for_each_irq_nr(j) |
| 114 | per_irq_sum = 0; | 111 | seq_printf(p, " %u", kstat_irqs(j)); |
| 115 | for_each_possible_cpu(i) | ||
| 116 | per_irq_sum += kstat_irqs_cpu(j, i); | ||
| 117 | |||
| 118 | seq_printf(p, " %u", per_irq_sum); | ||
| 119 | } | ||
| 120 | 112 | ||
| 121 | seq_printf(p, | 113 | seq_printf(p, |
| 122 | "\nctxt %llu\n" | 114 | "\nctxt %llu\n" |
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 871e25ed0069..da6b01d70f01 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c | |||
| @@ -327,6 +327,7 @@ struct mem_size_stats { | |||
| 327 | unsigned long private_clean; | 327 | unsigned long private_clean; |
| 328 | unsigned long private_dirty; | 328 | unsigned long private_dirty; |
| 329 | unsigned long referenced; | 329 | unsigned long referenced; |
| 330 | unsigned long anonymous; | ||
| 330 | unsigned long swap; | 331 | unsigned long swap; |
| 331 | u64 pss; | 332 | u64 pss; |
| 332 | }; | 333 | }; |
| @@ -357,6 +358,9 @@ static int smaps_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, | |||
| 357 | if (!page) | 358 | if (!page) |
| 358 | continue; | 359 | continue; |
| 359 | 360 | ||
| 361 | if (PageAnon(page)) | ||
| 362 | mss->anonymous += PAGE_SIZE; | ||
| 363 | |||
| 360 | mss->resident += PAGE_SIZE; | 364 | mss->resident += PAGE_SIZE; |
| 361 | /* Accumulate the size in pages that have been accessed. */ | 365 | /* Accumulate the size in pages that have been accessed. */ |
| 362 | if (pte_young(ptent) || PageReferenced(page)) | 366 | if (pte_young(ptent) || PageReferenced(page)) |
| @@ -410,6 +414,7 @@ static int show_smap(struct seq_file *m, void *v) | |||
| 410 | "Private_Clean: %8lu kB\n" | 414 | "Private_Clean: %8lu kB\n" |
| 411 | "Private_Dirty: %8lu kB\n" | 415 | "Private_Dirty: %8lu kB\n" |
| 412 | "Referenced: %8lu kB\n" | 416 | "Referenced: %8lu kB\n" |
| 417 | "Anonymous: %8lu kB\n" | ||
| 413 | "Swap: %8lu kB\n" | 418 | "Swap: %8lu kB\n" |
| 414 | "KernelPageSize: %8lu kB\n" | 419 | "KernelPageSize: %8lu kB\n" |
| 415 | "MMUPageSize: %8lu kB\n", | 420 | "MMUPageSize: %8lu kB\n", |
| @@ -421,6 +426,7 @@ static int show_smap(struct seq_file *m, void *v) | |||
| 421 | mss.private_clean >> 10, | 426 | mss.private_clean >> 10, |
| 422 | mss.private_dirty >> 10, | 427 | mss.private_dirty >> 10, |
| 423 | mss.referenced >> 10, | 428 | mss.referenced >> 10, |
| 429 | mss.anonymous >> 10, | ||
| 424 | mss.swap >> 10, | 430 | mss.swap >> 10, |
| 425 | vma_kernel_pagesize(vma) >> 10, | 431 | vma_kernel_pagesize(vma) >> 10, |
| 426 | vma_mmu_pagesize(vma) >> 10); | 432 | vma_mmu_pagesize(vma) >> 10); |
