linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: qiwuchen55@gmail.com, akpm@linux-foundation.org,
	pankaj.gupta.linux@gmail.com, alexander.duyck@gmail.com,
	willy@infradead.org, bhe@redhat.com
Cc: 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 09:28:46 +0100	[thread overview]
Message-ID: <30f98262-2686-c717-8b0c-fd90c204b35d@suse.cz> (raw)
In-Reply-To: <1583807664-10343-1-git-send-email-qiwuchen55@gmail.com>

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.


  reply	other threads:[~2020-03-10  8:28 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 [this message]
2020-03-10  9:09   ` chenqiwu

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=30f98262-2686-c717-8b0c-fd90c204b35d@suse.cz \
    --to=vbabka@suse.cz \
    --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=qiwuchen55@gmail.com \
    --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).