From: Jens Axboe Date: Thu, 9 Feb 2006 07:34:51 +0000 (+0100) Subject: [PATCH] Pin the mmap'ed output buffers in ram X-Git-Tag: blktrace-0.99.1~60 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=5975d309ac40b9724f70b46bbfa3747e8dc24ea5;p=blktrace.git [PATCH] Pin the mmap'ed output buffers in ram --- 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);