linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mel Gorman <mgorman@techsingularity.net>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Michal Hocko <mhocko@kernel.org>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Johannes Weiner <hannes@cmpxchg.org>
Subject: Re: [PATCH 1/2] mm, page_alloc: don't convert pfn to idx when merging
Date: Fri, 9 Dec 2016 17:26:58 +0000	[thread overview]
Message-ID: <20161209172658.uebsgt5ju6gtz2bu@techsingularity.net> (raw)
In-Reply-To: <20161209093754.3515-1-vbabka@suse.cz>

On Fri, Dec 09, 2016 at 10:37:53AM +0100, Vlastimil Babka wrote:
> In __free_one_page() we do the buddy merging arithmetics on "page/buddy index",
> which is just the lower MAX_ORDER bits of pfn. The operations we do that affect
> the higher bits are bitwise AND and subtraction (in that order), where the
> final result will be the same with the higher bits left unmasked, as long as
> these bits are equal for both buddies - which must be true by the definition of
> a buddy.

Ok, other than the kbuild warning, both patchs look ok. I expect the
benefit is marginal but every little bit helps.

> 
> We can therefore use pfn's directly instead of "index" and skip the zeroing of
> >MAX_ORDER bits. This can help a bit by itself, although compiler might be
> smart enough already. It also helps the next patch to avoid page_to_pfn() for
> memory hole checks.
> 

I expect this benefit only applies to a few archiectures and won't be
visible on x86 but it still makes sense so for both patches;

Acked-by: Mel Gorman <mgorman@techsingularity.net>

As a slight aside, I recently spotted that one of the largest overhead
in the bulk free path was in the page_is_buddy() checks so pretty much
anything that helps that is welcome.

-- 
Mel Gorman
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2016-12-09 17:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-09  9:37 Vlastimil Babka
2016-12-09  9:37 ` [PATCH 2/2] mm, page_alloc: avoid page_to_pfn() when merging buddies Vlastimil Babka
2016-12-09 12:14 ` [PATCH 1/2] mm, page_alloc: don't convert pfn to idx when merging kbuild test robot
2016-12-09 12:33   ` Vlastimil Babka
2016-12-09 17:26 ` Mel Gorman [this message]
2016-12-09 18:32   ` Vlastimil Babka
2016-12-09 19:40     ` Mel Gorman

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=20161209172658.uebsgt5ju6gtz2bu@techsingularity.net \
    --to=mgorman@techsingularity.net \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=vbabka@suse.cz \
    /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