Reenable io_u->buf_filled_len optimization
authorJens Axboe <axboe@kernel.dk>
Thu, 2 Feb 2012 08:20:09 +0000 (09:20 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 2 Feb 2012 08:20:09 +0000 (09:20 +0100)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_u.c
verify.c

diff --git a/io_u.c b/io_u.c
index 428b312..54f8685 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -1147,6 +1147,7 @@ static void small_content_scramble(struct io_u *io_u)
 
        p = io_u->xfer_buf;
        boffset = io_u->offset;
+       io_u->buf_filled_len = 0;
 
        for (i = 0; i < nr_blocks; i++) {
                /*
index 91a9077..9ee3bc4 100644 (file)
--- a/verify.c
+++ b/verify.c
@@ -39,38 +39,24 @@ void fill_pattern(struct thread_data *td, void *p, unsigned int len, struct io_u
                        io_u->rand_seed = fill_random_buf(&td->buf_state, p, len);
                break;
        case 1:
-               /*
-                * See below write barrier comment
-                */
-#if 0
-               read_barrier();
                if (io_u->buf_filled_len >= len) {
                        dprint(FD_VERIFY, "using already filled verify pattern b=0 len=%u\n", len);
                        return;
                }
-#endif
                dprint(FD_VERIFY, "fill verify pattern b=0 len=%u\n", len);
                memset(p, td->o.verify_pattern[0], len);
-               /*
-                * We need to ensure that the pattern stores are seen before
-                * the fill length store, or we could observe headers that
-                * aren't valid to the extent notified by the fill length
-                */
-               write_barrier();
                io_u->buf_filled_len = len;
                break;
        default: {
                unsigned int i = 0, size = 0;
                unsigned char *b = p;
 
-#if 0
-               read_barrier();
                if (io_u->buf_filled_len >= len) {
                        dprint(FD_VERIFY, "using already filled verify pattern b=%d len=%u\n",
                                        td->o.verify_pattern_bytes, len);
                        return;
                }
-#endif
+
                dprint(FD_VERIFY, "fill verify pattern b=%d len=%u\n",
                                        td->o.verify_pattern_bytes, len);
 
@@ -81,7 +67,6 @@ void fill_pattern(struct thread_data *td, void *p, unsigned int len, struct io_u
                        memcpy(b+i, td->o.verify_pattern, size);
                        i += size;
                }
-               write_barrier();
                io_u->buf_filled_len = len;
                break;
                }