From: chenqiwu <qiwuchen55@gmail.com>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: akpm@linux-foundation.org, pankaj.gupta.linux@gmail.com,
alexander.duyck@gmail.com, willy@infradead.org, bhe@redhat.com,
linux-mm@kvack.org, chenqiwu <chenqiwu@xiaomi.com>
Subject: Re: [PATCH v2] mm/page_alloc: simplify page_is_buddy() for better code readability
Date: Tue, 10 Mar 2020 17:09:47 +0800 [thread overview]
Message-ID: <20200310090947.GA14219@cqw-OptiPlex-7050> (raw)
In-Reply-To: <30f98262-2686-c717-8b0c-fd90c204b35d@suse.cz>
On Tue, Mar 10, 2020 at 09:28:46AM +0100, Vlastimil Babka wrote:
> On 3/10/20 3:34 AM, qiwuchen55@gmail.com wrote:
> > From: chenqiwu <chenqiwu@xiaomi.com>
> >
> > Simplify page_is_buddy() to reduce the redundant code for better code
> > readability.
> >
> > Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
>
> I would personally keep testing the page type first, and even switch it so that
> PageBuddy is tested before page_is_guard (but it only matters on debugging kernels).
>
> I can only speculate which will have better performance (if any), but it's more
> logical to test the type first. Both orders should be safe though as we have the
> zone lock.
Yes, I have ignored the iegality of the page must be checked first.
Thanks for your review!
prev parent reply other threads:[~2020-03-10 9:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-10 2:34 [PATCH v2] mm/page_alloc: simplify page_is_buddy() for better code readability qiwuchen55
2020-03-10 8:28 ` Vlastimil Babka
2020-03-10 9:09 ` chenqiwu [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=20200310090947.GA14219@cqw-OptiPlex-7050 \
--to=qiwuchen55@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=alexander.duyck@gmail.com \
--cc=bhe@redhat.com \
--cc=chenqiwu@xiaomi.com \
--cc=linux-mm@kvack.org \
--cc=pankaj.gupta.linux@gmail.com \
--cc=vbabka@suse.cz \
--cc=willy@infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).