[PATCH] Pin the mmap'ed output buffers in ram
authorJens Axboe <axboe@suse.de>
Thu, 9 Feb 2006 07:34:51 +0000 (08:34 +0100)
committerJens Axboe <axboe@suse.de>
Thu, 9 Feb 2006 07:34:51 +0000 (08:34 +0100)
blktrace.c

index 6e62d4796912532d76d54372f98c021d5c2b1840..549f484d22006587c551d68c2127959d7d69e9d4 100644 (file)
@@ -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);