diff options
Diffstat (limited to 'mm/memory.c')
-rw-r--r-- | mm/memory.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/mm/memory.c b/mm/memory.c index c1e14c9e67e4..109e9866237e 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #include <linux/pagemap.h> | 47 | #include <linux/pagemap.h> |
48 | #include <linux/rmap.h> | 48 | #include <linux/rmap.h> |
49 | #include <linux/module.h> | 49 | #include <linux/module.h> |
50 | #include <linux/delayacct.h> | ||
50 | #include <linux/init.h> | 51 | #include <linux/init.h> |
51 | 52 | ||
52 | #include <asm/pgalloc.h> | 53 | #include <asm/pgalloc.h> |
@@ -1549,9 +1550,9 @@ gotten: | |||
1549 | flush_cache_page(vma, address, pte_pfn(orig_pte)); | 1550 | flush_cache_page(vma, address, pte_pfn(orig_pte)); |
1550 | entry = mk_pte(new_page, vma->vm_page_prot); | 1551 | entry = mk_pte(new_page, vma->vm_page_prot); |
1551 | entry = maybe_mkwrite(pte_mkdirty(entry), vma); | 1552 | entry = maybe_mkwrite(pte_mkdirty(entry), vma); |
1553 | lazy_mmu_prot_update(entry); | ||
1552 | ptep_establish(vma, address, page_table, entry); | 1554 | ptep_establish(vma, address, page_table, entry); |
1553 | update_mmu_cache(vma, address, entry); | 1555 | update_mmu_cache(vma, address, entry); |
1554 | lazy_mmu_prot_update(entry); | ||
1555 | lru_cache_add_active(new_page); | 1556 | lru_cache_add_active(new_page); |
1556 | page_add_new_anon_rmap(new_page, vma, address); | 1557 | page_add_new_anon_rmap(new_page, vma, address); |
1557 | 1558 | ||
@@ -1853,7 +1854,7 @@ int vmtruncate_range(struct inode *inode, loff_t offset, loff_t end) | |||
1853 | 1854 | ||
1854 | return 0; | 1855 | return 0; |
1855 | } | 1856 | } |
1856 | EXPORT_SYMBOL(vmtruncate_range); | 1857 | EXPORT_UNUSED_SYMBOL(vmtruncate_range); /* June 2006 */ |
1857 | 1858 | ||
1858 | /* | 1859 | /* |
1859 | * Primitive swap readahead code. We simply read an aligned block of | 1860 | * Primitive swap readahead code. We simply read an aligned block of |
@@ -1934,6 +1935,7 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
1934 | migration_entry_wait(mm, pmd, address); | 1935 | migration_entry_wait(mm, pmd, address); |
1935 | goto out; | 1936 | goto out; |
1936 | } | 1937 | } |
1938 | delayacct_set_flag(DELAYACCT_PF_SWAPIN); | ||
1937 | page = lookup_swap_cache(entry); | 1939 | page = lookup_swap_cache(entry); |
1938 | if (!page) { | 1940 | if (!page) { |
1939 | swapin_readahead(entry, address, vma); | 1941 | swapin_readahead(entry, address, vma); |
@@ -1946,6 +1948,7 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
1946 | page_table = pte_offset_map_lock(mm, pmd, address, &ptl); | 1948 | page_table = pte_offset_map_lock(mm, pmd, address, &ptl); |
1947 | if (likely(pte_same(*page_table, orig_pte))) | 1949 | if (likely(pte_same(*page_table, orig_pte))) |
1948 | ret = VM_FAULT_OOM; | 1950 | ret = VM_FAULT_OOM; |
1951 | delayacct_clear_flag(DELAYACCT_PF_SWAPIN); | ||
1949 | goto unlock; | 1952 | goto unlock; |
1950 | } | 1953 | } |
1951 | 1954 | ||
@@ -1955,6 +1958,7 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
1955 | grab_swap_token(); | 1958 | grab_swap_token(); |
1956 | } | 1959 | } |
1957 | 1960 | ||
1961 | delayacct_clear_flag(DELAYACCT_PF_SWAPIN); | ||
1958 | mark_page_accessed(page); | 1962 | mark_page_accessed(page); |
1959 | lock_page(page); | 1963 | lock_page(page); |
1960 | 1964 | ||