All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: chengkaitao <pilgrimtao@gmail.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	smcdef@gmail.com, Joonsoo Kim <iamjoonsoo.kim@lge.com>
Subject: Re: [PATCH] mm: delete duplicate order checking, when stealing whole pageblock
Date: Fri, 11 Jun 2021 17:00:45 -0700	[thread overview]
Message-ID: <20210611170045.b79a238fa3fc4bc9e4cd1140@linux-foundation.org> (raw)
In-Reply-To: <20210611063834.11871-1-chengkaitao@didiglobal.com>

On Fri, 11 Jun 2021 14:38:34 +0800 chengkaitao <pilgrimtao@gmail.com> wrote:

> From: chengkaitao <pilgrimtao@gmail.com>
> 
> 1. Already has (order >= pageblock_order / 2) here, we don't neet
> (order >= pageblock_order)
> 2. set function can_steal_fallback to inline
> 
> ...
>
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -2619,18 +2619,8 @@ static void change_pageblock_range(struct page *pageblock_page,
>   * is worse than movable allocations stealing from unmovable and reclaimable
>   * pageblocks.
>   */
> -static bool can_steal_fallback(unsigned int order, int start_mt)
> +static inline bool can_steal_fallback(unsigned int order, int start_mt)
>  {
> -	/*
> -	 * Leaving this order check is intended, although there is
> -	 * relaxed order check in next check. The reason is that
> -	 * we can actually steal whole pageblock if this condition met,
> -	 * but, below check doesn't guarantee it and that is just heuristic
> -	 * so could be changed anytime.
> -	 */
> -	if (order >= pageblock_order)
> -		return true;
> -
>  	if (order >= pageblock_order / 2 ||
>  		start_mt == MIGRATE_RECLAIMABLE ||
>  		start_mt == MIGRATE_UNMOVABLE ||

Well, that redundant check was put there deliberately, as the comment
explains.

The reasoning is perhaps a little dubious, but it seems that the
compiler has optimized away the redundant check anyway (your patch
doesn't alter code size).


      reply	other threads:[~2021-06-12  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-11  6:38 [PATCH] mm: delete duplicate order checking, when stealing whole pageblock chengkaitao
2021-06-12  0:00 ` 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=20210611170045.b79a238fa3fc4bc9e4cd1140@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pilgrimtao@gmail.com \
    --cc=smcdef@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.