diff options
author | Christopher Kenna <cjk@cs.unc.edu> | 2012-03-26 23:40:04 -0400 |
---|---|---|
committer | Christopher Kenna <cjk@cs.unc.edu> | 2012-03-26 23:40:04 -0400 |
commit | 65f96c53bc0db7733ae7908470ddb3f17dc369b4 (patch) | |
tree | 6ab5198c9513885dc1e6fddd8461001510fddb7c /mm | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
First commit.
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memory.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c index 9b8a01d941c..36e889cca24 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -3016,6 +3016,35 @@ static inline int check_stack_guard_page(struct vm_area_struct *vma, unsigned lo | |||
3016 | return 0; | 3016 | return 0; |
3017 | } | 3017 | } |
3018 | 3018 | ||
3019 | static inline void print_page_fault_info(struct mm_struct *mm, | ||
3020 | unsigned long address, struct page *page) | ||
3021 | { | ||
3022 | struct task_struct *ts = current; | ||
3023 | char ts_name[TASK_COMM_LEN]; | ||
3024 | char mismatch[4]; | ||
3025 | #if 0 | ||
3026 | struct file *file = mm->exe_file; | ||
3027 | const unsigned char *name_null = "NULL"; | ||
3028 | const unsigned char *name = | ||
3029 | (file) ?file->f_dentry->d_name.name : name_null; | ||
3030 | #endif | ||
3031 | |||
3032 | get_task_comm(ts_name, ts); | ||
3033 | if (likely(ts->mm == mm)) | ||
3034 | mismatch[0] = '\0'; | ||
3035 | else | ||
3036 | snprintf(mismatch, 4, "(M)"); | ||
3037 | #if 0 | ||
3038 | printk("%s: cur: %15s name: %15s user_addr: 0x%12lx pfn: %12lu " | ||
3039 | "addr: 0x%13llx\n", | ||
3040 | __FUNCTION__, ts_name, name, address, | ||
3041 | page_to_pfn(page), page_to_phys(page)); | ||
3042 | #endif | ||
3043 | printk("%s: %3s %15s laddr: 0x%12lx pfn: %19lu paddr: 0x%13llx\n", | ||
3044 | __FUNCTION__, mismatch, ts_name, address >> PAGE_SHIFT, | ||
3045 | page_to_pfn(page), page_to_phys(page) >> PAGE_SHIFT); | ||
3046 | } | ||
3047 | |||
3019 | /* | 3048 | /* |
3020 | * We enter with non-exclusive mmap_sem (to exclude vma changes, | 3049 | * We enter with non-exclusive mmap_sem (to exclude vma changes, |
3021 | * but allow concurrent faults), and pte mapped but not yet locked. | 3050 | * but allow concurrent faults), and pte mapped but not yet locked. |
@@ -3066,6 +3095,9 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
3066 | 3095 | ||
3067 | inc_mm_counter_fast(mm, MM_ANONPAGES); | 3096 | inc_mm_counter_fast(mm, MM_ANONPAGES); |
3068 | page_add_new_anon_rmap(page, vma, address); | 3097 | page_add_new_anon_rmap(page, vma, address); |
3098 | #if 0 | ||
3099 | print_page_fault_info(mm, address, page); | ||
3100 | #endif | ||
3069 | setpte: | 3101 | setpte: |
3070 | set_pte_at(mm, address, page_table, entry); | 3102 | set_pte_at(mm, address, page_table, entry); |
3071 | 3103 | ||
@@ -3075,6 +3107,9 @@ unlock: | |||
3075 | pte_unmap_unlock(page_table, ptl); | 3107 | pte_unmap_unlock(page_table, ptl); |
3076 | return 0; | 3108 | return 0; |
3077 | release: | 3109 | release: |
3110 | #if 0 | ||
3111 | printk("%s: release label\n", __FUNCTION__); | ||
3112 | #endif | ||
3078 | mem_cgroup_uncharge_page(page); | 3113 | mem_cgroup_uncharge_page(page); |
3079 | page_cache_release(page); | 3114 | page_cache_release(page); |
3080 | goto unlock; | 3115 | goto unlock; |