Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
42a661f5
Commit
42a661f5
authored
Nov 25, 2011
by
Cyrill Gorcunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel: Update patch series
Signed-off-by:
Cyrill Gorcunov
<
gorcunov@gmail.com
>
parent
bb3d02c2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
177 additions
and
0 deletions
+177
-0
0008-mincore-Add-named-constant-for-reported-present-bit.patch
...mincore-Add-named-constant-for-reported-present-bit.patch
+90
-0
0009-mincore-Report-whether-page-is-anon-or-not.patch
kernel/0009-mincore-Report-whether-page-is-anon-or-not.patch
+78
-0
series
kernel/series
+9
-0
No files found.
kernel/0008-mincore-Add-named-constant-for-reported-present-bit.patch
0 → 100644
View file @
42a661f5
From 181ab3a738d454c0aa6f983e25ca076638d43179 Mon Sep 17 00:00:00 2001
From: Pavel Emelyanov <xemul@parallels.com>
Date: Fri, 25 Nov 2011 17:58:28 +0400
Subject: [PATCH 1/2] mincore: Add named constant for reported present bit
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
include/linux/mman.h | 2 ++
mm/huge_memory.c | 2 +-
mm/mincore.c | 10 +++++-----
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/include/linux/mman.h b/include/linux/mman.h
index 8b74e9b..e4fda1e 100644
--- a/include/linux/mman.h
+++ b/include/linux/mman.h
@@ -10,6 +10,8 @@
#define OVERCOMMIT_ALWAYS 1
#define OVERCOMMIT_NEVER 2
+#define MINCORE_RESIDENT 0x1
+
#ifdef __KERNEL__
#include <linux/mm.h>
#include <linux/percpu_counter.h>
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 4298aba..a0acb3e 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1045,7 +1045,7 @@ int mincore_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
* All logical pages in the range are present
* if backed by a huge page.
*/
- memset(vec, 1, (end - addr) >> PAGE_SHIFT);
+ memset(vec, MINCORE_RESIDENT, (end - addr) >> PAGE_SHIFT);
}
} else
spin_unlock(&vma->vm_mm->page_table_lock);
diff --git a/mm/mincore.c b/mm/mincore.c
index 636a8687..b719cdd 100644
--- a/mm/mincore.c
+++ b/mm/mincore.c
@@ -38,7 +38,7 @@ static void mincore_hugetlb_page_range(struct vm_area_struct *vma,
addr & huge_page_mask(h));
present = ptep && !huge_pte_none(huge_ptep_get(ptep));
while (1) {
- *vec = present;
+ *vec = (present ? MINCORE_RESIDENT : 0);
vec++;
addr += PAGE_SIZE;
if (addr == end)
@@ -83,7 +83,7 @@ static unsigned char mincore_page(struct address_space *mapping, pgoff_t pgoff)
page_cache_release(page);
}
- return present;
+ return present ? MINCORE_RESIDENT : 0;
}
static void mincore_unmapped_range(struct vm_area_struct *vma,
@@ -122,7 +122,7 @@ static void mincore_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
if (pte_none(pte))
mincore_unmapped_range(vma, addr, next, vec);
else if (pte_present(pte))
- *vec = 1;
+ *vec = MINCORE_RESIDENT;
else if (pte_file(pte)) {
pgoff = pte_to_pgoff(pte);
*vec = mincore_page(vma->vm_file->f_mapping, pgoff);
@@ -131,14 +131,14 @@ static void mincore_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
if (is_migration_entry(entry)) {
/* migration entries are always uptodate */
- *vec = 1;
+ *vec = MINCORE_RESIDENT;
} else {
#ifdef CONFIG_SWAP
pgoff = entry.val;
*vec = mincore_page(&swapper_space, pgoff);
#else
WARN_ON(1);
- *vec = 1;
+ *vec = MINCORE_RESIDENT;
#endif
}
}
--
1.7.7.3
kernel/0009-mincore-Report-whether-page-is-anon-or-not.patch
0 → 100644
View file @
42a661f5
From 1d2879854a34a16bcfadeb7c71c05290d59eeb36 Mon Sep 17 00:00:00 2001
From: Pavel Emelyanov <xemul@parallels.com>
Date: Fri, 25 Nov 2011 18:01:12 +0400
Subject: [PATCH 2/2] mincore: Report whether page is anon or not
This is required not to dump pages from private file mappings, that are
not mapped or not yet cow-ed.
The thing is that mincode reports bit 1 for pages that are in memory, regardless
of whether they are mapped or not. But in case we have mapped a file of 2 pages and
read a single page mincore will report 1 for both - the 1st one being mapped and
the 2nd one being in page cache due to readahead.
With this fix both pages will be !PageAnon and we can skip them (see further patches
for crtools).
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
include/linux/mman.h | 1 +
mm/mincore.c | 15 +++++++++++++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/include/linux/mman.h b/include/linux/mman.h
index e4fda1e..9d1de16 100644
--- a/include/linux/mman.h
+++ b/include/linux/mman.h
@@ -11,6 +11,7 @@
#define OVERCOMMIT_NEVER 2
#define MINCORE_RESIDENT 0x1
+#define MINCORE_ANON 0x2
#ifdef __KERNEL__
#include <linux/mm.h>
diff --git a/mm/mincore.c b/mm/mincore.c
index b719cdd..f825327 100644
--- a/mm/mincore.c
+++ b/mm/mincore.c
@@ -38,7 +38,7 @@ static void mincore_hugetlb_page_range(struct vm_area_struct *vma,
addr & huge_page_mask(h));
present = ptep && !huge_pte_none(huge_ptep_get(ptep));
while (1) {
- *vec = (present ? MINCORE_RESIDENT : 0);
+ *vec = (present ? MINCORE_RESIDENT : 0) | MINCORE_ANON;
vec++;
addr += PAGE_SIZE;
if (addr == end)
@@ -86,6 +86,17 @@ static unsigned char mincore_page(struct address_space *mapping, pgoff_t pgoff)
return present ? MINCORE_RESIDENT : 0;
}
+static unsigned char mincore_pte(struct vm_area_struct *vma, unsigned long addr, pte_t pte)
+{
+ struct page *pg;
+
+ pg = vm_normal_page(vma, addr, pte);
+ if (pg == NULL)
+ return 0;
+ else
+ return PageAnon(pg) ? MINCORE_ANON : 0;
+}
+
static void mincore_unmapped_range(struct vm_area_struct *vma,
unsigned long addr, unsigned long end,
unsigned char *vec)
@@ -122,7 +133,7 @@ static void mincore_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
if (pte_none(pte))
mincore_unmapped_range(vma, addr, next, vec);
else if (pte_present(pte))
- *vec = MINCORE_RESIDENT;
+ *vec = MINCORE_RESIDENT | mincore_pte(vma, addr, pte);
else if (pte_file(pte)) {
pgoff = pte_to_pgoff(pte);
*vec = mincore_page(vma->vm_file->f_mapping, pgoff);
--
1.7.7.3
kernel/series
0 → 100644
View file @
42a661f5
0001-fs-proc-Make-proc_get_link-to-use-dentry-instead-of-.patch
0002-fs-proc-Introduce-the-proc-pid-map_files-directory-v.patch
0003-procfs-introduce-the-proc-pid-map_files-directory-ch.patch
0004-fs-proc-Add-start_data-end_data-start_brk-members-to.patch
0005-fs-proc-Introduce-the-Children-line-in-proc-pid-stat.patch
0006-clone-Introduce-the-CLONE_CHILD_USEPID-functionality.patch
0007-prctl-Add-PR_-codes-to-restore-vDSO-and-tune-up-mm_s.patch
0008-mincore-Add-named-constant-for-reported-present-bit.patch
0009-mincore-Report-whether-page-is-anon-or-not.patch
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment