aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-13 01:45:43 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-13 01:45:43 -0500
commit5cbb3d216e2041700231bcfc383ee5f8b7fc8b74 (patch)
treea738fa82dbcefa9bd283c08bc67f38827be63937 /fs/proc
parent9bc9ccd7db1c9f043f75380b5a5b94912046a60e (diff)
parent4e9b45a19241354daec281d7a785739829b52359 (diff)
Merge branch 'akpm' (patches from Andrew Morton)
Merge first patch-bomb from Andrew Morton: "Quite a lot of other stuff is banked up awaiting further next->mainline merging, but this batch contains: - Lots of random misc patches - OCFS2 - Most of MM - backlight updates - lib/ updates - printk updates - checkpatch updates - epoll tweaking - rtc updates - hfs - hfsplus - documentation - procfs - update gcov to gcc-4.7 format - IPC" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (269 commits) ipc, msg: fix message length check for negative values ipc/util.c: remove unnecessary work pending test devpts: plug the memory leak in kill_sb ./Makefile: export initial ramdisk compression config option init/Kconfig: add option to disable kernel compression drivers: w1: make w1_slave::flags long to avoid memory corruption drivers/w1/masters/ds1wm.cuse dev_get_platdata() drivers/memstick/core/ms_block.c: fix unreachable state in h_msb_read_page() drivers/memstick/core/mspro_block.c: fix attributes array allocation drivers/pps/clients/pps-gpio.c: remove redundant of_match_ptr kernel/panic.c: reduce 1 byte usage for print tainted buffer gcov: reuse kbasename helper kernel/gcov/fs.c: use pr_warn() kernel/module.c: use pr_foo() gcov: compile specific gcov implementation based on gcc version gcov: add support for gcc 4.7 gcov format gcov: move gcov structs definitions to a gcc version specific file kernel/taskstats.c: return -ENOMEM when alloc memory fails in add_del_listener() kernel/taskstats.c: add nla_nest_cancel() for failure processing between nla_nest_start() and nla_nest_end() kernel/sysctl_binary.c: use scnprintf() instead of snprintf() ...
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/Kconfig4
-rw-r--r--fs/proc/inode.c16
-rw-r--r--fs/proc/kcore.c3
-rw-r--r--fs/proc/meminfo.c5
-rw-r--r--fs/proc/task_mmu.c17
5 files changed, 25 insertions, 20 deletions
diff --git a/fs/proc/Kconfig b/fs/proc/Kconfig
index 15af6222f8a4..2183fcf41d59 100644
--- a/fs/proc/Kconfig
+++ b/fs/proc/Kconfig
@@ -31,6 +31,10 @@ config PROC_FS
31config PROC_KCORE 31config PROC_KCORE
32 bool "/proc/kcore support" if !ARM 32 bool "/proc/kcore support" if !ARM
33 depends on PROC_FS && MMU 33 depends on PROC_FS && MMU
34 help
35 Provides a virtual ELF core file of the live kernel. This can
36 be read with gdb and other ELF tools. No modifications can be
37 made using this mechanism.
34 38
35config PROC_VMCORE 39config PROC_VMCORE
36 bool "/proc/vmcore support" 40 bool "/proc/vmcore support"
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 8eaa1ba793fc..28955d4b7218 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -285,19 +285,23 @@ static int proc_reg_mmap(struct file *file, struct vm_area_struct *vma)
285 return rv; 285 return rv;
286} 286}
287 287
288static unsigned long proc_reg_get_unmapped_area(struct file *file, unsigned long orig_addr, unsigned long len, unsigned long pgoff, unsigned long flags) 288static unsigned long
289proc_reg_get_unmapped_area(struct file *file, unsigned long orig_addr,
290 unsigned long len, unsigned long pgoff,
291 unsigned long flags)
289{ 292{
290 struct proc_dir_entry *pde = PDE(file_inode(file)); 293 struct proc_dir_entry *pde = PDE(file_inode(file));
291 unsigned long rv = -EIO; 294 unsigned long rv = -EIO;
292 unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long) = NULL; 295 unsigned long (*get_area)(struct file *, unsigned long, unsigned long,
296 unsigned long, unsigned long) = NULL;
293 if (use_pde(pde)) { 297 if (use_pde(pde)) {
294#ifdef CONFIG_MMU 298#ifdef CONFIG_MMU
295 get_unmapped_area = current->mm->get_unmapped_area; 299 get_area = current->mm->get_unmapped_area;
296#endif 300#endif
297 if (pde->proc_fops->get_unmapped_area) 301 if (pde->proc_fops->get_unmapped_area)
298 get_unmapped_area = pde->proc_fops->get_unmapped_area; 302 get_area = pde->proc_fops->get_unmapped_area;
299 if (get_unmapped_area) 303 if (get_area)
300 rv = get_unmapped_area(file, orig_addr, len, pgoff, flags); 304 rv = get_area(file, orig_addr, len, pgoff, flags);
301 unuse_pde(pde); 305 unuse_pde(pde);
302 } 306 }
303 return rv; 307 return rv;
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
index 06ea155e1a59..5ed0e52d6aa0 100644
--- a/fs/proc/kcore.c
+++ b/fs/proc/kcore.c
@@ -255,8 +255,7 @@ static int kcore_update_ram(void)
255 end_pfn = 0; 255 end_pfn = 0;
256 for_each_node_state(nid, N_MEMORY) { 256 for_each_node_state(nid, N_MEMORY) {
257 unsigned long node_end; 257 unsigned long node_end;
258 node_end = NODE_DATA(nid)->node_start_pfn + 258 node_end = node_end_pfn(nid);
259 NODE_DATA(nid)->node_spanned_pages;
260 if (end_pfn < node_end) 259 if (end_pfn < node_end)
261 end_pfn = node_end; 260 end_pfn = node_end;
262 } 261 }
diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
index 59d85d608898..c805d5b69ba1 100644
--- a/fs/proc/meminfo.c
+++ b/fs/proc/meminfo.c
@@ -24,7 +24,6 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
24{ 24{
25 struct sysinfo i; 25 struct sysinfo i;
26 unsigned long committed; 26 unsigned long committed;
27 unsigned long allowed;
28 struct vmalloc_info vmi; 27 struct vmalloc_info vmi;
29 long cached; 28 long cached;
30 unsigned long pages[NR_LRU_LISTS]; 29 unsigned long pages[NR_LRU_LISTS];
@@ -37,8 +36,6 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
37 si_meminfo(&i); 36 si_meminfo(&i);
38 si_swapinfo(&i); 37 si_swapinfo(&i);
39 committed = percpu_counter_read_positive(&vm_committed_as); 38 committed = percpu_counter_read_positive(&vm_committed_as);
40 allowed = ((totalram_pages - hugetlb_total_pages())
41 * sysctl_overcommit_ratio / 100) + total_swap_pages;
42 39
43 cached = global_page_state(NR_FILE_PAGES) - 40 cached = global_page_state(NR_FILE_PAGES) -
44 total_swapcache_pages() - i.bufferram; 41 total_swapcache_pages() - i.bufferram;
@@ -147,7 +144,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
147 K(global_page_state(NR_UNSTABLE_NFS)), 144 K(global_page_state(NR_UNSTABLE_NFS)),
148 K(global_page_state(NR_BOUNCE)), 145 K(global_page_state(NR_BOUNCE)),
149 K(global_page_state(NR_WRITEBACK_TEMP)), 146 K(global_page_state(NR_WRITEBACK_TEMP)),
150 K(allowed), 147 K(vm_commit_limit()),
151 K(committed), 148 K(committed),
152 (unsigned long)VMALLOC_TOTAL >> 10, 149 (unsigned long)VMALLOC_TOTAL >> 10,
153 vmi.used >> 10, 150 vmi.used >> 10,
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 390bdab01c3c..abbe825d20ff 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -561,6 +561,9 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma)
561 [ilog2(VM_NONLINEAR)] = "nl", 561 [ilog2(VM_NONLINEAR)] = "nl",
562 [ilog2(VM_ARCH_1)] = "ar", 562 [ilog2(VM_ARCH_1)] = "ar",
563 [ilog2(VM_DONTDUMP)] = "dd", 563 [ilog2(VM_DONTDUMP)] = "dd",
564#ifdef CONFIG_MEM_SOFT_DIRTY
565 [ilog2(VM_SOFTDIRTY)] = "sd",
566#endif
564 [ilog2(VM_MIXEDMAP)] = "mm", 567 [ilog2(VM_MIXEDMAP)] = "mm",
565 [ilog2(VM_HUGEPAGE)] = "hg", 568 [ilog2(VM_HUGEPAGE)] = "hg",
566 [ilog2(VM_NOHUGEPAGE)] = "nh", 569 [ilog2(VM_NOHUGEPAGE)] = "nh",
@@ -1387,8 +1390,8 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
1387 struct mm_struct *mm = vma->vm_mm; 1390 struct mm_struct *mm = vma->vm_mm;
1388 struct mm_walk walk = {}; 1391 struct mm_walk walk = {};
1389 struct mempolicy *pol; 1392 struct mempolicy *pol;
1390 int n; 1393 char buffer[64];
1391 char buffer[50]; 1394 int nid;
1392 1395
1393 if (!mm) 1396 if (!mm)
1394 return 0; 1397 return 0;
@@ -1404,10 +1407,8 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
1404 walk.mm = mm; 1407 walk.mm = mm;
1405 1408
1406 pol = get_vma_policy(task, vma, vma->vm_start); 1409 pol = get_vma_policy(task, vma, vma->vm_start);
1407 n = mpol_to_str(buffer, sizeof(buffer), pol); 1410 mpol_to_str(buffer, sizeof(buffer), pol);
1408 mpol_cond_put(pol); 1411 mpol_cond_put(pol);
1409 if (n < 0)
1410 return n;
1411 1412
1412 seq_printf(m, "%08lx %s", vma->vm_start, buffer); 1413 seq_printf(m, "%08lx %s", vma->vm_start, buffer);
1413 1414
@@ -1460,9 +1461,9 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
1460 if (md->writeback) 1461 if (md->writeback)
1461 seq_printf(m, " writeback=%lu", md->writeback); 1462 seq_printf(m, " writeback=%lu", md->writeback);
1462 1463
1463 for_each_node_state(n, N_MEMORY) 1464 for_each_node_state(nid, N_MEMORY)
1464 if (md->node[n]) 1465 if (md->node[nid])
1465 seq_printf(m, " N%d=%lu", n, md->node[n]); 1466 seq_printf(m, " N%d=%lu", nid, md->node[nid]);
1466out: 1467out:
1467 seq_putc(m, '\n'); 1468 seq_putc(m, '\n');
1468 1469