linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Hillf Danton <hillf.zj@alibaba-inc.com>,
	'Andrew Morton' <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	'Linus Torvalds' <torvalds@linux-foundation.org>
Subject: Re: [PATCH] mm: don't cap request size based on read-ahead setting
Date: Wed, 16 Nov 2016 08:12:09 -0700	[thread overview]
Message-ID: <7b150e70-66ef-f42f-a0b9-2ddb7b739076@kernel.dk> (raw)
In-Reply-To: <000701d23fd9$805dcdd0$81196970$@alibaba-inc.com>

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.

-- 
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>

  reply	other threads:[~2016-11-16 15:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-16  4:30 [PATCH] mm: don't cap request size based on read-ahead setting Jens Axboe
2016-11-16  7:17 ` Hillf Danton
2016-11-16 15:12   ` Jens Axboe [this message]
2016-11-16 18:38     ` Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2016-11-18 19:41 Jens Axboe
2016-11-21  4:44 ` Hillf Danton
2016-11-21 13:12   ` 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=7b150e70-66ef-f42f-a0b9-2ddb7b739076@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=akpm@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).