lkml.org 
[lkml]   [2018]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm: Define VM_(MAX|MIN)_READAHEAD via sizes.h constants
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?

\
 
 \ /
  Last update: 2018-12-21 14:25    [W:0.038 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site