linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.cz>
To: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Joonsoo Kim <js1304@gmail.com>, Minchan Kim <minchan@kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Mel Gorman <mgorman@suse.de>, Rik van Riel <riel@redhat.com>
Subject: Re: [PATCH 1/4] mm, page_alloc: add likely macro to help compiler optimization
Date: Fri, 2 Aug 2013 18:27:22 +0200	[thread overview]
Message-ID: <20130802162722.GA29220@dhcp22.suse.cz> (raw)
In-Reply-To: <1375409279-16919-1-git-send-email-iamjoonsoo.kim@lge.com>

On Fri 02-08-13 11:07:56, Joonsoo Kim wrote:
> We rarely allocate a page with ALLOC_NO_WATERMARKS and it is used
> in slow path. For making fast path more faster, add likely macro to
> help compiler optimization.

The code is different in mmotm tree (see mm: page_alloc: rearrange
watermark checking in get_page_from_freelist)

Besides that, make sure you provide numbers which prove your claims
about performance optimizations.

> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
> 
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index b100255..86ad44b 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -1901,7 +1901,7 @@ zonelist_scan:
>  			goto this_zone_full;
>  
>  		BUILD_BUG_ON(ALLOC_NO_WATERMARKS < NR_WMARK);
> -		if (!(alloc_flags & ALLOC_NO_WATERMARKS)) {
> +		if (likely(!(alloc_flags & ALLOC_NO_WATERMARKS))) {
>  			unsigned long mark;
>  			int ret;
>  
> -- 
> 1.7.9.5
> 
> --
> 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>

-- 
Michal Hocko
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:[~2013-08-02 16:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-02  2:07 Joonsoo Kim
2013-08-02  2:07 ` [PATCH 2/4] mm, migrate: allocation new page lazyily in unmap_and_move() Joonsoo Kim
2013-08-02 19:41   ` Johannes Weiner
2013-08-05  7:41     ` Joonsoo Kim
2013-08-02  2:07 ` [PATCH 3/4] mm: move pgtable related functions to right place Joonsoo Kim
2013-08-02  2:07 ` [PATCH 4/4] swap: clean-up #ifdef in page_mapping() Joonsoo Kim
2013-08-02 19:43   ` Johannes Weiner
2013-08-02 16:27 ` Michal Hocko [this message]
2013-08-02 20:47   ` [PATCH 1/4] mm, page_alloc: add likely macro to help compiler optimization Johannes Weiner
2013-08-02 21:36     ` Michal Hocko
2013-08-05  8:10       ` Joonsoo Kim
2013-08-05  8:50         ` Joonsoo Kim
2013-08-05  8:59           ` Michal Hocko
2013-08-05 20:52           ` Johannes Weiner
2013-08-02 19:26 ` Johannes Weiner

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=20130802162722.GA29220@dhcp22.suse.cz \
    --to=mhocko@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=js1304@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=minchan@kernel.org \
    --cc=riel@redhat.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