All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	js1304@gmail.com, Andrew Morton <akpm@linux-foundation.org>,
	Minchan Kim <minchan@kernel.org>,
	Michal Hocko <mhocko@kernel.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>
Subject: Re: [PATCH 1/5] mm/debug_pagealloc: clean-up guard page handling code
Date: Fri, 12 Aug 2016 21:25:37 +0900	[thread overview]
Message-ID: <20160812122537.GA568@swordfish> (raw)
In-Reply-To: <172b4c63-b519-cf1d-ed68-1f85f2caed14@suse.cz>

On (08/11/16 11:41), Vlastimil Babka wrote:
> On 08/10/2016 10:14 AM, Sergey Senozhatsky wrote:
> > > @@ -1650,18 +1655,15 @@ static inline void expand(struct zone *zone, struct page *page,
> > >  		size >>= 1;
> > >  		VM_BUG_ON_PAGE(bad_range(zone, &page[size]), &page[size]);
> > > 
> > > -		if (IS_ENABLED(CONFIG_DEBUG_PAGEALLOC) &&
> > > -			debug_guardpage_enabled() &&
> > > -			high < debug_guardpage_minorder()) {
> > > -			/*
> > > -			 * Mark as guard pages (or page), that will allow to
> > > -			 * merge back to allocator when buddy will be freed.
> > > -			 * Corresponding page table entries will not be touched,
> > > -			 * pages will stay not present in virtual address space
> > > -			 */
> > > -			set_page_guard(zone, &page[size], high, migratetype);
> > > +		/*
> > > +		 * Mark as guard pages (or page), that will allow to
> > > +		 * merge back to allocator when buddy will be freed.
> > > +		 * Corresponding page table entries will not be touched,
> > > +		 * pages will stay not present in virtual address space
> > > +		 */
> > > +		if (set_page_guard(zone, &page[size], high, migratetype))
> > >  			continue;
> > > -		}
> > 
> > so previously IS_ENABLED(CONFIG_DEBUG_PAGEALLOC) could have optimized out
> > the entire branch -- no set_page_guard() invocation and checks, right? but
> > now we would call set_page_guard() every time?
> 
> No, there's a !CONFIG_DEBUG_PAGEALLOC version of set_page_guard() that
> returns false (static inline), so this whole if will be eliminated by the
> compiler, same as before.

ah, indeed. didn't notice it.

	-ss

--
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>

WARNING: multiple messages have this Message-ID (diff)
From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	js1304@gmail.com, Andrew Morton <akpm@linux-foundation.org>,
	Minchan Kim <minchan@kernel.org>,
	Michal Hocko <mhocko@kernel.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>
Subject: Re: [PATCH 1/5] mm/debug_pagealloc: clean-up guard page handling code
Date: Fri, 12 Aug 2016 21:25:37 +0900	[thread overview]
Message-ID: <20160812122537.GA568@swordfish> (raw)
In-Reply-To: <172b4c63-b519-cf1d-ed68-1f85f2caed14@suse.cz>

On (08/11/16 11:41), Vlastimil Babka wrote:
> On 08/10/2016 10:14 AM, Sergey Senozhatsky wrote:
> > > @@ -1650,18 +1655,15 @@ static inline void expand(struct zone *zone, struct page *page,
> > >  		size >>= 1;
> > >  		VM_BUG_ON_PAGE(bad_range(zone, &page[size]), &page[size]);
> > > 
> > > -		if (IS_ENABLED(CONFIG_DEBUG_PAGEALLOC) &&
> > > -			debug_guardpage_enabled() &&
> > > -			high < debug_guardpage_minorder()) {
> > > -			/*
> > > -			 * Mark as guard pages (or page), that will allow to
> > > -			 * merge back to allocator when buddy will be freed.
> > > -			 * Corresponding page table entries will not be touched,
> > > -			 * pages will stay not present in virtual address space
> > > -			 */
> > > -			set_page_guard(zone, &page[size], high, migratetype);
> > > +		/*
> > > +		 * Mark as guard pages (or page), that will allow to
> > > +		 * merge back to allocator when buddy will be freed.
> > > +		 * Corresponding page table entries will not be touched,
> > > +		 * pages will stay not present in virtual address space
> > > +		 */
> > > +		if (set_page_guard(zone, &page[size], high, migratetype))
> > >  			continue;
> > > -		}
> > 
> > so previously IS_ENABLED(CONFIG_DEBUG_PAGEALLOC) could have optimized out
> > the entire branch -- no set_page_guard() invocation and checks, right? but
> > now we would call set_page_guard() every time?
> 
> No, there's a !CONFIG_DEBUG_PAGEALLOC version of set_page_guard() that
> returns false (static inline), so this whole if will be eliminated by the
> compiler, same as before.

ah, indeed. didn't notice it.

	-ss

  reply	other threads:[~2016-08-12 12:26 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-10  6:16 [PATCH 0/5] Reduce memory waste by page extension user js1304
2016-08-10  6:16 ` js1304
2016-08-10  6:16 ` [PATCH 1/5] mm/debug_pagealloc: clean-up guard page handling code js1304
2016-08-10  6:16   ` js1304
2016-08-10  8:14   ` Sergey Senozhatsky
2016-08-10  8:14     ` Sergey Senozhatsky
2016-08-11  9:41     ` Vlastimil Babka
2016-08-11  9:41       ` Vlastimil Babka
2016-08-12 12:25       ` Sergey Senozhatsky [this message]
2016-08-12 12:25         ` Sergey Senozhatsky
2016-08-16  2:58         ` Joonsoo Kim
2016-08-16  2:58           ` Joonsoo Kim
2016-08-11  9:38   ` Vlastimil Babka
2016-08-11  9:38     ` Vlastimil Babka
2016-08-10  6:16 ` [PATCH 2/5] mm/debug_pagealloc: don't allocate page_ext if we don't use guard page js1304
2016-08-10  6:16   ` js1304
2016-08-10  9:44   ` Sergey Senozhatsky
2016-08-10  9:44     ` Sergey Senozhatsky
2016-08-11  9:53   ` Vlastimil Babka
2016-08-11  9:53     ` Vlastimil Babka
2016-08-10  6:16 ` [PATCH 3/5] mm/page_owner: move page_owner specific function to page_owner.c js1304
2016-08-10  6:16   ` js1304
2016-08-10  8:03   ` Sergey Senozhatsky
2016-08-10  8:03     ` Sergey Senozhatsky
2016-08-11 12:33   ` Vlastimil Babka
2016-08-11 12:33     ` Vlastimil Babka
2016-08-10  6:16 ` [PATCH 4/5] mm/page_ext: support extra space allocation by page_ext user js1304
2016-08-10  6:16   ` js1304
2016-08-11 12:53   ` Vlastimil Babka
2016-08-11 12:53     ` Vlastimil Babka
2016-08-10  6:16 ` [PATCH 5/5] mm/page_owner: don't define fields on struct page_ext by hard-coding js1304
2016-08-10  6:16   ` js1304
2016-08-11 13:01   ` Vlastimil Babka
2016-08-11 13:01     ` Vlastimil Babka

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=20160812122537.GA568@swordfish \
    --to=sergey.senozhatsky@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=js1304@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=minchan@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 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.