From: Andrew Morton <akpm@linux-foundation.org>
To: William Kucharski <william.kucharski@oracle.com>
Cc: miles.chen@mediatek.com, Michal Hocko <mhocko@suse.com>,
Joe Perches <joe@perches.com>,
Matthew Wilcox <willy@infradead.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, wsd_upstream@mediatek.com,
Michal Hocko <mhocko@kernel.org>
Subject: Re: [PATCH v4] mm/page_owner: clamp read count to PAGE_SIZE
Date: Tue, 6 Nov 2018 13:51:21 -0800 [thread overview]
Message-ID: <20181106135121.dd015f188709c4ccb2bff52c@linux-foundation.org> (raw)
In-Reply-To: <FD1082D9-916E-47A4-95D3-59F308AD6D55@oracle.com>
On Thu, 1 Nov 2018 18:41:33 -0600 William Kucharski <william.kucharski@oracle.com> wrote:
>
>
> > On Nov 1, 2018, at 3:47 PM, Andrew Morton <akpm@linux-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".
prev parent reply other threads:[~2018-11-06 21:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-01 17:00 miles.chen
2018-11-01 17:09 ` Michal Hocko
2018-11-01 21:47 ` Andrew Morton
2018-11-01 23:30 ` Joe Perches
2018-11-02 0:03 ` Matthew Wilcox
2018-11-02 0:41 ` William Kucharski
2018-11-06 21:51 ` Andrew Morton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181106135121.dd015f188709c4ccb2bff52c@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=joe@perches.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=mhocko@suse.com \
--cc=miles.chen@mediatek.com \
--cc=william.kucharski@oracle.com \
--cc=willy@infradead.org \
--cc=wsd_upstream@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox