Re: [PATCH] Avoid always dirtying mapping->flags on O_DIRECT

From: Jens Axboe
Date: Mon May 12 2014 - 11:08:22 EST


On 05/12/2014 08:46 AM, Jeff Moyer wrote:
> Jens Axboe <axboe@xxxxxx> writes:
>
>> Hi,
>>
>> In some testing I ran today, we end up spending 40% of the time in
>> filemap_check_errors(). That smells fishy. Looking further, this is
>> basically what happens:
>>
>> blkdev_aio_read()
>> generic_file_aio_read()
>> filemap_write_and_wait_range()
>> if (!mapping->nr_pages)
>> filemap_check_errors()
>>
>> and filemap_check_errors() always attempts two test_and_clear_bit() on
>> the mapping flags, thus dirtying it for every single invocation. The
>> patch below tests each of these bits before clearing them, avoiding this
>> issue. In my test case (4-socket box), performance went from 1.7M IOPS
>> to 4.0M IOPS.
>
> It might help to use the word cacheline somewhere in here. ;-) Out of

I thought that was self-evident, but yes, I could add that :-)

> curiosity, what workload were you running?

Nothing fancy, just some fio jobs that spread over two nodes.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/