Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1463361

Re: [PATCH 1/5] mm/debug_pagealloc: clean-up guard page handling code

From Joonsoo Kim <iamjoonsoo.kim@lge.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/5] mm/debug_pagealloc: clean-up guard page handling code
Date 2016-08-16 05:00 +0200
Message-ID <s6CLE-5JI-15@gated-at.bofh.it> (permalink)
References <s4GgH-79-61@gated-at.bofh.it> <s4HcK-NR-39@gated-at.bofh.it> <s4IVc-204-15@gated-at.bofh.it> <s4UMG-24i-27@gated-at.bofh.it> <s5jL4-1y8-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Aug 12, 2016 at 09:25:37PM +0900, Sergey Senozhatsky wrote:
> 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.

Hello, Sergey and Vlastimil.

I fixed all you commented and sent v2.

Thanks.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] Reduce memory waste by page extension user js1304@gmail.com - 2016-08-11 00:20 +0200
  [PATCH 2/5] mm/debug_pagealloc: don't allocate page_ext if we don't use guard page js1304@gmail.com - 2016-08-11 00:50 +0200
    Re: [PATCH 2/5] mm/debug_pagealloc: don't allocate page_ext if we  don't use guard page Vlastimil Babka <vbabka@suse.cz> - 2016-08-11 12:00 +0200
  Re: [PATCH 1/5] mm/debug_pagealloc: clean-up guard page handling code Vlastimil Babka <vbabka@suse.cz> - 2016-08-11 11:40 +0200
  Re: [PATCH 1/5] mm/debug_pagealloc: clean-up guard page handling code Vlastimil Babka <vbabka@suse.cz> - 2016-08-11 11:50 +0200
    Re: [PATCH 1/5] mm/debug_pagealloc: clean-up guard page handling code Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-08-12 14:30 +0200
      Re: [PATCH 1/5] mm/debug_pagealloc: clean-up guard page handling code Joonsoo Kim <iamjoonsoo.kim@lge.com> - 2016-08-16 05:00 +0200
  Re: [PATCH 3/5] mm/page_owner: move page_owner specific function to  page_owner.c Vlastimil Babka <vbabka@suse.cz> - 2016-08-11 14:40 +0200
  Re: [PATCH 4/5] mm/page_ext: support extra space allocation by  page_ext user Vlastimil Babka <vbabka@suse.cz> - 2016-08-11 15:00 +0200
  Re: [PATCH 5/5] mm/page_owner: don't define fields on struct page_ext  by hard-coding Vlastimil Babka <vbabka@suse.cz> - 2016-08-11 15:10 +0200

csiph-web