[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20181106135121.dd015f188709c4ccb2bff52c@linux-foundation.org>
Date: Tue, 6 Nov 2018 13:51:21 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: William Kucharski <william.kucharski@...cle.com>
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 Thu, 1 Nov 2018 18:41:33 -0600 William Kucharski <william.kucharski@...cle.com> wrote:
>
>
> > 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?
Yup. It saves the reader from having to parse the code to figure out
"this is a min operation".
Powered by blists - more mailing lists