Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 295275
b: refs/heads/master
c: accb61f
h: refs/heads/master
i:
  295273: 2a46ca4
  295271: 38f547a
v: v3
  • Loading branch information
Jason Baron authored and Linus Torvalds committed Mar 23, 2012
1 parent f317870 commit 3630481
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 909af768e88867016f427264ae39d27a57b6a8ed
refs/heads/master: accb61fe7bb0f5c2a4102239e4981650f9048519
4 changes: 4 additions & 0 deletions trunk/arch/alpha/include/asm/mman.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
#define MADV_HUGEPAGE 14 /* Worth backing with hugepages */
#define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages */

#define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
overrides the coredump filter bits */
#define MADV_DODUMP 17 /* Clear the MADV_NODUMP flag */

/* compatibility flags */
#define MAP_FILE 0

Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/mips/include/asm/mman.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@
#define MADV_HUGEPAGE 14 /* Worth backing with hugepages */
#define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages */

#define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
overrides the coredump filter bits */
#define MADV_DODUMP 17 /* Clear the MADV_NODUMP flag */

/* compatibility flags */
#define MAP_FILE 0

Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/parisc/include/asm/mman.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
#define MADV_HUGEPAGE 67 /* Worth backing with hugepages */
#define MADV_NOHUGEPAGE 68 /* Not worth backing with hugepages */

#define MADV_DONTDUMP 69 /* Explicity exclude from the core dump,
overrides the coredump filter bits */
#define MADV_DODUMP 70 /* Clear the MADV_NODUMP flag */

/* compatibility flags */
#define MAP_FILE 0
#define MAP_VARIABLE 0
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/xtensa/include/asm/mman.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
#define MADV_HUGEPAGE 14 /* Worth backing with hugepages */
#define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages */

#define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
overrides the coredump filter bits */
#define MADV_DODUMP 17 /* Clear the MADV_NODUMP flag */

/* compatibility flags */
#define MAP_FILE 0

Expand Down
3 changes: 3 additions & 0 deletions trunk/fs/binfmt_elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,9 @@ static unsigned long vma_dump_size(struct vm_area_struct *vma,
if (always_dump_vma(vma))
goto whole;

if (vma->vm_flags & VM_NODUMP)
return 0;

/* Hugetlb memory check */
if (vma->vm_flags & VM_HUGETLB) {
if ((vma->vm_flags & VM_SHARED) && FILTER(HUGETLB_SHARED))
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/asm-generic/mman-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
#define MADV_HUGEPAGE 14 /* Worth backing with hugepages */
#define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages */

#define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
overrides the coredump filter bits */
#define MADV_DODUMP 17 /* Clear the MADV_NODUMP flag */

/* compatibility flags */
#define MAP_FILE 0

Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ extern unsigned int kobjsize(const void *objp);
#define VM_HUGEPAGE 0x01000000 /* MADV_HUGEPAGE marked this vma */
#endif
#define VM_INSERTPAGE 0x02000000 /* The vma has had "vm_insert_page()" done on it */
#define VM_NODUMP 0x04000000 /* Do not include in the core dump */

#define VM_CAN_NONLINEAR 0x08000000 /* Has ->fault & does nonlinear pages */
#define VM_MIXEDMAP 0x10000000 /* Can contain "struct page" and pure PFN pages */
Expand Down
8 changes: 8 additions & 0 deletions trunk/mm/madvise.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ static long madvise_behavior(struct vm_area_struct * vma,
}
new_flags &= ~VM_DONTCOPY;
break;
case MADV_DONTDUMP:
new_flags |= VM_NODUMP;
break;
case MADV_DODUMP:
new_flags &= ~VM_NODUMP;
break;
case MADV_MERGEABLE:
case MADV_UNMERGEABLE:
error = ksm_madvise(vma, start, end, behavior, &new_flags);
Expand Down Expand Up @@ -293,6 +299,8 @@ madvise_behavior_valid(int behavior)
case MADV_HUGEPAGE:
case MADV_NOHUGEPAGE:
#endif
case MADV_DONTDUMP:
case MADV_DODUMP:
return 1;

default:
Expand Down

0 comments on commit 3630481

Please sign in to comment.