[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <FD1082D9-916E-47A4-95D3-59F308AD6D55@oracle.com>
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