[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8c5224ce-ba67-2afc-3864-051b8220a87a@suse.com>
Date: Fri, 21 Dec 2018 16:06:42 +0200
From: Nikolay Borisov <nborisov@...e.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: linux-mm@...ck.org, akpm@...ux-foundation.org,
linux-kernel@...r.kernel.org, linux-afs@...ts.infradead.org,
linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH] mm: Define VM_(MAX|MIN)_READAHEAD via sizes.h constants
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.
>
Powered by blists - more mailing lists