linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org, linux-afs@lists.infradead.org,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] mm: Define VM_(MAX|MIN)_READAHEAD via sizes.h constants
Date: Fri, 21 Dec 2018 16:06:42 +0200	[thread overview]
Message-ID: <8c5224ce-ba67-2afc-3864-051b8220a87a@suse.com> (raw)
In-Reply-To: <20181221132423.GA10600@bombadil.infradead.org>



On 21.12.18 г. 15:24 ч., Matthew Wilcox wrote:
> On Fri, Dec 21, 2018 at 02:53:14PM +0200, Nikolay Borisov wrote:
>> All users of the aformentioned macros convert them to kbytes by
>> multplying. Instead, directly define the macros via the aptly named
>> SZ_16K/SZ_128K ones. Also remove the now redundant comments explaining
>> that VM_* are defined in kbytes it's obvious. No functional changes.
> 
> Actually, all users of these constants convert them to pages!
> 
>> +	q->backing_dev_info->ra_pages = VM_MAX_READAHEAD / PAGE_SIZE;
>> +		sb->s_bdi->ra_pages = VM_MAX_READAHEAD / PAGE_SIZE;
>> +	sb->s_bdi->ra_pages	= VM_MAX_READAHEAD / PAGE_SIZE;
>> +	sb->s_bdi->ra_pages = VM_MAX_READAHEAD / PAGE_SIZE;
>> +	sb->s_bdi->ra_pages = VM_MAX_READAHEAD / PAGE_SIZE;
> 
>> -#define VM_MAX_READAHEAD	128	/* kbytes */
>> -#define VM_MIN_READAHEAD	16	/* kbytes (includes current page) */
>> +#define VM_MAX_READAHEAD	SZ_128K
>> +#define VM_MIN_READAHEAD	SZ_16K	/* includes current page */
> 
> So perhaps:
> 
> #define VM_MAX_READAHEAD	(SZ_128K / PAGE_SIZE)
> 
> VM_MIN_READAHEAD isn't used, so just delete it?

I thought about that but didn't know if people will complain that some
times in the future we might need it.

> 

      reply	other threads:[~2018-12-21 14:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-21 12:53 Nikolay Borisov
2018-12-21 13:24 ` Matthew Wilcox
2018-12-21 14:06   ` Nikolay Borisov [this message]

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=8c5224ce-ba67-2afc-3864-051b8220a87a@suse.com \
    --to=nborisov@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.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