Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1523742
| From | Jens Axboe <axboe@kernel.dk> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] mm: don't cap request size based on read-ahead setting |
| Date | 2016-11-16 19:40 +0100 |
| Message-ID | <sEdhM-6ys-27@gated-at.bofh.it> (permalink) |
| References | <sE0aR-6d1-1@gated-at.bofh.it> <sE2Pn-8fL-15@gated-at.bofh.it> <sEaaf-4Bb-45@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 11/16/2016 08:12 AM, Jens Axboe wrote:
> On 11/16/2016 12:17 AM, Hillf Danton wrote:
>> On Wednesday, November 16, 2016 12:31 PM Jens Axboe wrote:
>>> @@ -369,10 +369,25 @@ ondemand_readahead(struct address_space *mapping,
>>> bool hit_readahead_marker, pgoff_t offset,
>>> unsigned long req_size)
>>> {
>>> - unsigned long max = ra->ra_pages;
>>> + unsigned long io_pages, max_pages;
>>> pgoff_t prev_offset;
>>>
>>> /*
>>> + * If bdi->io_pages is set, that indicates the (soft) max IO size
>>> + * per command for that device. If we have that available, use
>>> + * that as the max suitable read-ahead size for this IO. Instead of
>>> + * capping read-ahead at ra_pages if req_size is larger, we can go
>>> + * up to io_pages. If io_pages isn't set, fall back to using
>>> + * ra_pages as a safe max.
>>> + */
>>> + io_pages = inode_to_bdi(mapping->host)->io_pages;
>>> + if (io_pages) {
>>> + max_pages = max_t(unsigned long, ra->ra_pages, req_size);
>>> + io_pages = min(io_pages, max_pages);
>>
>> Doubt if you mean
>> max_pages = min(io_pages, max_pages);
>
> No, that is what I mean. We want the maximum of the RA setting and the
> user IO size, but the minimum of that and the device max command size.
Johannes pointed out that I'm an idiot - a last minute edit introduced
this typo, and I was too blind to spot it when you sent that email this
morning. So yes, it should of course be:
max_pages = min(io_pages, max_pages);
like the first version I posted. I'll post a v3...
--
Jens Axboe
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] mm: don't cap request size based on read-ahead setting Jens Axboe <axboe@kernel.dk> - 2016-11-16 05:40 +0100
Re: [PATCH] mm: don't cap request size based on read-ahead setting "Hillf Danton" <hillf.zj@alibaba-inc.com> - 2016-11-16 08:30 +0100
Re: [PATCH] mm: don't cap request size based on read-ahead setting Jens Axboe <axboe@kernel.dk> - 2016-11-16 16:20 +0100
Re: [PATCH] mm: don't cap request size based on read-ahead setting Jens Axboe <axboe@kernel.dk> - 2016-11-16 19:40 +0100
csiph-web