lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 21 Dec 2018 05:24:23 -0800
From:   Matthew Wilcox <willy@...radead.org>
To:     Nikolay Borisov <nborisov@...e.com>
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 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?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ