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:   Thu, 1 Nov 2018 18:41:33 -0600
From:   William Kucharski <william.kucharski@...cle.com>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     miles.chen@...iatek.com, Michal Hocko <mhocko@...e.com>,
        Joe Perches <joe@...ches.com>,
        Matthew Wilcox <willy@...radead.org>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org, wsd_upstream@...iatek.com,
        Michal Hocko <mhocko@...nel.org>
Subject: Re: [PATCH v4] mm/page_owner: clamp read count to PAGE_SIZE



> On Nov 1, 2018, at 3:47 PM, Andrew Morton <akpm@...ux-foundation.org> wrote:
> 
> -	count = count > PAGE_SIZE ? PAGE_SIZE : count;
> +	count = min_t(size_t, count, PAGE_SIZE);
> 	kbuf = kmalloc(count, GFP_KERNEL);
> 	if (!kbuf)
> 		return -ENOMEM;

Is the use of min_t vs. the C conditional mostly to be more self-documenting?

The compiler-generated assembly between the two versions seems mostly a wash.

    William Kucharski

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ