All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@fb.com>
To: Jeff Moyer <jmoyer@redhat.com>
Cc: linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	linux-mm@kvack.org
Subject: Re: [PATCH] Avoid always dirtying mapping->flags on O_DIRECT
Date: Mon, 12 May 2014 09:08:16 -0600	[thread overview]
Message-ID: <5370E3E0.4050109@fb.com> (raw)
In-Reply-To: <x49r43z837o.fsf@segfault.boston.devel.redhat.com>

On 05/12/2014 08:46 AM, Jeff Moyer wrote:
> Jens Axboe <axboe@fb.com> 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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Jens Axboe <axboe@fb.com>
To: Jeff Moyer <jmoyer@redhat.com>
Cc: <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Al Viro <viro@zeniv.linux.org.uk>, <linux-mm@kvack.org>
Subject: Re: [PATCH] Avoid always dirtying mapping->flags on O_DIRECT
Date: Mon, 12 May 2014 09:08:16 -0600	[thread overview]
Message-ID: <5370E3E0.4050109@fb.com> (raw)
In-Reply-To: <x49r43z837o.fsf@segfault.boston.devel.redhat.com>

On 05/12/2014 08:46 AM, Jeff Moyer wrote:
> Jens Axboe <axboe@fb.com> 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.



  reply	other threads:[~2014-05-12 15:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-09 21:39 [PATCH] Avoid always dirtying mapping->flags on O_DIRECT Jens Axboe
2014-05-09 21:39 ` Jens Axboe
2014-05-12 14:46 ` Jeff Moyer
2014-05-12 14:46   ` Jeff Moyer
2014-05-12 15:08   ` Jens Axboe [this message]
2014-05-12 15:08     ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5370E3E0.4050109@fb.com \
    --to=axboe@fb.com \
    --cc=akpm@linux-foundation.org \
    --cc=jmoyer@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.