From 5975d309ac40b9724f70b46bbfa3747e8dc24ea5 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 9 Feb 2006 08:34:51 +0100 Subject: [PATCH] [PATCH] Pin the mmap'ed output buffers in ram --- blktrace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/blktrace.c b/blktrace.c index 6e62d47..549f484 100644 --- a/blktrace.c +++ b/blktrace.c @@ -387,6 +387,7 @@ static int mmap_subbuf(struct thread_information *tip) */ if (tip->fs_off + buf_size > tip->fs_buf_len) { if (tip->fs_buf) { + munlock(tip->fs_buf, tip->fs_buf_len); munmap(tip->fs_buf, tip->fs_buf_len); tip->fs_buf = NULL; } @@ -406,6 +407,7 @@ static int mmap_subbuf(struct thread_information *tip) perror("mmap"); return -1; } + mlock(tip->fs_buf, tip->fs_buf_len); } ret = read_data(tip, tip->fs_buf + tip->fs_off, buf_size); -- 2.25.1