diff options
-rw-r--r-- | drivers/oprofile/buffer_sync.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c index 69a732778ba7..615929f6f0c2 100644 --- a/drivers/oprofile/buffer_sync.c +++ b/drivers/oprofile/buffer_sync.c | |||
@@ -268,6 +268,17 @@ lookup_dcookie(struct mm_struct *mm, unsigned long addr, off_t *offset) | |||
268 | return cookie; | 268 | return cookie; |
269 | } | 269 | } |
270 | 270 | ||
271 | static void increment_tail(struct oprofile_cpu_buffer *b) | ||
272 | { | ||
273 | unsigned long new_tail = b->tail_pos + 1; | ||
274 | |||
275 | rmb(); | ||
276 | |||
277 | if (new_tail < b->buffer_size) | ||
278 | b->tail_pos = new_tail; | ||
279 | else | ||
280 | b->tail_pos = 0; | ||
281 | } | ||
271 | 282 | ||
272 | static unsigned long last_cookie = INVALID_COOKIE; | 283 | static unsigned long last_cookie = INVALID_COOKIE; |
273 | 284 | ||
@@ -417,19 +428,6 @@ static unsigned long get_slots(struct oprofile_cpu_buffer *b) | |||
417 | } | 428 | } |
418 | 429 | ||
419 | 430 | ||
420 | static void increment_tail(struct oprofile_cpu_buffer *b) | ||
421 | { | ||
422 | unsigned long new_tail = b->tail_pos + 1; | ||
423 | |||
424 | rmb(); | ||
425 | |||
426 | if (new_tail < b->buffer_size) | ||
427 | b->tail_pos = new_tail; | ||
428 | else | ||
429 | b->tail_pos = 0; | ||
430 | } | ||
431 | |||
432 | |||
433 | /* Move tasks along towards death. Any tasks on dead_tasks | 431 | /* Move tasks along towards death. Any tasks on dead_tasks |
434 | * will definitely have no remaining references in any | 432 | * will definitely have no remaining references in any |
435 | * CPU buffers at this point, because we use two lists, | 433 | * CPU buffers at this point, because we use two lists, |