X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=fio.c;h=81854818d6bd81ae3cd503a8eb4e4661d99bfc93;hp=48c728eb2cb9370f2242ca0a5df0c36cc40e972b;hb=be18a94f51296cce03d51501858e5f704c5e1950;hpb=def1d8e3019d8757b8214691013880ebb414d396;ds=inline diff --git a/fio.c b/fio.c index 48c728eb..81854818 100644 --- a/fio.c +++ b/fio.c @@ -1092,6 +1092,22 @@ static void *thread_main(void *data) goto err; } + /* + * If we have a gettimeofday() thread, make sure we exclude that + * thread from this job + */ + if (td->o.gtod_cpu) + fio_cpu_clear(&td->o.cpumask, td->o.gtod_cpu); + + /* + * Set affinity first, in case it has an impact on the memory + * allocations. + */ + if (td->o.cpumask_set && fio_setaffinity(td->pid, td->o.cpumask) == -1) { + td_verror(td, errno, "cpu_set_affinity"); + goto err; + } + /* * May alter parameters that init_io_u() will use, so we need to * do this first. @@ -1105,23 +1121,6 @@ static void *thread_main(void *data) if (td->o.verify_async && verify_async_init(td)) goto err; - if (td->o.cpumask_set && fio_setaffinity(td->pid, td->o.cpumask) == -1) { - td_verror(td, errno, "cpu_set_affinity"); - goto err; - } - - /* - * If we have a gettimeofday() thread, make sure we exclude that - * thread from this job - */ - if (td->o.gtod_cpu) { - fio_cpu_clear(&td->o.cpumask, td->o.gtod_cpu); - if (fio_setaffinity(td->pid, td->o.cpumask) == -1) { - td_verror(td, errno, "cpu_set_affinity"); - goto err; - } - } - if (td->ioprio_set) { if (ioprio_set(IOPRIO_WHO_PROCESS, 0, td->ioprio) == -1) { td_verror(td, errno, "ioprio_set");