hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/oprofile/buffer_sync.c
....@@ -91,11 +91,11 @@
9191 struct mm_struct *mm = current->mm;
9292 struct vm_area_struct *mpnt;
9393
94
- down_read(&mm->mmap_sem);
94
+ mmap_read_lock(mm);
9595
9696 mpnt = find_vma(mm, addr);
9797 if (mpnt && mpnt->vm_file && (mpnt->vm_flags & VM_EXEC)) {
98
- up_read(&mm->mmap_sem);
98
+ mmap_read_unlock(mm);
9999 /* To avoid latency problems, we only process the current CPU,
100100 * hoping that most samples for the task are on this CPU
101101 */
....@@ -103,7 +103,7 @@
103103 return 0;
104104 }
105105
106
- up_read(&mm->mmap_sem);
106
+ mmap_read_unlock(mm);
107107 return 0;
108108 }
109109
....@@ -116,7 +116,7 @@
116116 {
117117 #ifdef CONFIG_MODULES
118118 if (val != MODULE_STATE_COMING)
119
- return 0;
119
+ return NOTIFY_DONE;
120120
121121 /* FIXME: should we process all CPU buffers ? */
122122 mutex_lock(&buffer_mutex);
....@@ -124,7 +124,7 @@
124124 add_event_entry(MODULE_LOADED_CODE);
125125 mutex_unlock(&buffer_mutex);
126126 #endif
127
- return 0;
127
+ return NOTIFY_OK;
128128 }
129129
130130
....@@ -256,7 +256,7 @@
256256 unsigned long cookie = NO_COOKIE;
257257 struct vm_area_struct *vma;
258258
259
- down_read(&mm->mmap_sem);
259
+ mmap_read_lock(mm);
260260 for (vma = find_vma(mm, addr); vma; vma = vma->vm_next) {
261261
262262 if (addr < vma->vm_start || addr >= vma->vm_end)
....@@ -276,7 +276,7 @@
276276
277277 if (!vma)
278278 cookie = INVALID_COOKIE;
279
- up_read(&mm->mmap_sem);
279
+ mmap_read_unlock(mm);
280280
281281 return cookie;
282282 }
....@@ -486,7 +486,7 @@
486486
487487 /* Sync one of the CPU's buffers into the global event buffer.
488488 * Here we need to go through each batch of samples punctuated
489
- * by context switch notes, taking the task's mmap_sem and doing
489
+ * by context switch notes, taking the task's mmap_lock and doing
490490 * lookup in task->mm->mmap to convert EIP into dcookie/offset
491491 * value.
492492 */