From: Jens Axboe <axboe@kernel.dk>
To: Hillf Danton <hillf.zj@alibaba-inc.com>,
'Andrew Morton' <akpm@linux-foundation.org>,
'Johannes Weiner' <hannes@cmpxchg.org>,
linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
'Linus Torvalds' <torvalds@linux-foundation.org>
Subject: Re: [PATCH v4] mm: don't cap request size based on read-ahead setting
Date: Fri, 18 Nov 2016 08:09:55 -0700 [thread overview]
Message-ID: <6010891c-e4a2-e19b-9042-128670fd8fff@kernel.dk> (raw)
In-Reply-To: <007401d24160$cc2442c0$646cc840$@alibaba-inc.com>
On 11/17/2016 10:58 PM, Hillf Danton wrote:
> On Friday, November 18, 2016 5:23 AM Jens Axboe wrote:
>>
>> We ran into a funky issue, where someone doing 256K buffered reads saw
>> 128K requests at the device level. Turns out it is read-ahead capping
>> the request size, since we use 128K as the default setting. This doesn't
>> make a lot of sense - if someone is issuing 256K reads, they should see
>> 256K reads, regardless of the read-ahead setting, if the underlying
>> device can support a 256K read in a single command.
>>
>> To make matters more confusing, there's an odd interaction with the
>> fadvise hint setting. If we tell the kernel we're doing sequential IO on
>> this file descriptor, we can get twice the read-ahead size. But if we
>> tell the kernel that we are doing random IO, hence disabling read-ahead,
>> we do get nice 256K requests at the lower level. This is because
>> ondemand and forced read-ahead behave differently, with the latter doing
>> the right thing.
>
> As far as I read, forced RA is innocent but it is corrected below.
> And with RA disabled, we should drop care of ondemand.
>
> I'm scratching.
The changelog should have been updated. Forced read-ahead is also
affected, the patch is correct. We want to use the min of 'nr_to_read'
and the proper read-ahead request size, the latter being the max of
ra->ra_pages and bdi->io_pages.
--
Jens Axboe
WARNING: multiple messages have this Message-ID (diff)
From: Jens Axboe <axboe@kernel.dk>
To: Hillf Danton <hillf.zj@alibaba-inc.com>,
'Andrew Morton' <akpm@linux-foundation.org>,
'Johannes Weiner' <hannes@cmpxchg.org>,
linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
'Linus Torvalds' <torvalds@linux-foundation.org>
Subject: Re: [PATCH v4] mm: don't cap request size based on read-ahead setting
Date: Fri, 18 Nov 2016 08:09:55 -0700 [thread overview]
Message-ID: <6010891c-e4a2-e19b-9042-128670fd8fff@kernel.dk> (raw)
In-Reply-To: <007401d24160$cc2442c0$646cc840$@alibaba-inc.com>
On 11/17/2016 10:58 PM, Hillf Danton wrote:
> On Friday, November 18, 2016 5:23 AM Jens Axboe wrote:
>>
>> We ran into a funky issue, where someone doing 256K buffered reads saw
>> 128K requests at the device level. Turns out it is read-ahead capping
>> the request size, since we use 128K as the default setting. This doesn't
>> make a lot of sense - if someone is issuing 256K reads, they should see
>> 256K reads, regardless of the read-ahead setting, if the underlying
>> device can support a 256K read in a single command.
>>
>> To make matters more confusing, there's an odd interaction with the
>> fadvise hint setting. If we tell the kernel we're doing sequential IO on
>> this file descriptor, we can get twice the read-ahead size. But if we
>> tell the kernel that we are doing random IO, hence disabling read-ahead,
>> we do get nice 256K requests at the lower level. This is because
>> ondemand and forced read-ahead behave differently, with the latter doing
>> the right thing.
>
> As far as I read, forced RA is innocent but it is corrected below.
> And with RA disabled, we should drop care of ondemand.
>
> I'm scratching.
The changelog should have been updated. Forced read-ahead is also
affected, the patch is correct. We want to use the min of 'nr_to_read'
and the proper read-ahead request size, the latter being the max of
ra->ra_pages and bdi->io_pages.
--
Jens Axboe
--
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>
next prev parent reply other threads:[~2016-11-18 15:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-17 21:23 [PATCH v4] mm: don't cap request size based on read-ahead setting Jens Axboe
2016-11-17 21:23 ` Jens Axboe
2016-11-18 5:58 ` Hillf Danton
2016-11-18 5:58 ` Hillf Danton
2016-11-18 15:09 ` Jens Axboe [this message]
2016-11-18 15:09 ` Jens Axboe
2016-11-18 18:02 ` Johannes Weiner
2016-11-18 18:02 ` Johannes Weiner
2016-11-18 19:34 ` Jens Axboe
2016-11-18 19:34 ` 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=6010891c-e4a2-e19b-9042-128670fd8fff@kernel.dk \
--to=axboe@kernel.dk \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=hillf.zj@alibaba-inc.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=torvalds@linux-foundation.org \
/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.