backend: move iolog compression init before CPU affinity settings
authorJens Axboe <axboe@fb.com>
Thu, 19 May 2016 17:41:28 +0000 (11:41 -0600)
committerJens Axboe <axboe@fb.com>
Thu, 19 May 2016 17:41:28 +0000 (11:41 -0600)
Previously we did this after we had set CPU affinity for the IO
worker. But if we do that, then we limit the log compression
to the exact CPUs that we don't want it to run on.

So let's do this earlier, which means the compression threads can
run anyway. We'll trust the OS scheduler to keep them out of our
way.

Signed-off-by: Jens Axboe <axboe@fb.com>
backend.c

index 243ddd393a576d6cc19d6a79385467ea9a5ee165..f8300405f341785fe090c208f1fbce872eb5e832 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -1471,6 +1471,14 @@ static void *thread_main(void *data)
                goto err;
        }
 
+       /*
+        * Do this early, we don't want the compress threads to be limited
+        * to the same CPUs as the IO workers. So do this before we set
+        * any potential CPU affinity
+        */
+       if (iolog_compress_init(td, sk_out))
+               goto err;
+
        /*
         * If we have a gettimeofday() thread, make sure we exclude that
         * thread from this job
@@ -1605,9 +1613,6 @@ static void *thread_main(void *data)
                        goto err;
        }
 
-       if (iolog_compress_init(td, sk_out))
-               goto err;
-
        fio_verify_init(td);
 
        if (rate_submit_init(td, sk_out))