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


Groups > linux.kernel > #1401280 > unrolled thread

Re: [PATCH v5 07/12] zsmalloc: factor page chain functionality out

Started bySergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
First post2016-05-16 04:20 +0200
Last post2016-05-17 03:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v5 07/12] zsmalloc: factor page chain functionality out Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-05-16 04:20 +0200
    Re: [PATCH v5 07/12] zsmalloc: factor page chain functionality out Minchan Kim <minchan@kernel.org> - 2016-05-17 03:10 +0200

#1401280 — Re: [PATCH v5 07/12] zsmalloc: factor page chain functionality out

FromSergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Date2016-05-16 04:20 +0200
SubjectRe: [PATCH v5 07/12] zsmalloc: factor page chain functionality out
Message-ID<rzgiE-HG-299@gated-at.bofh.it>
On (05/09/16 11:20), Minchan Kim wrote:
> For page migration, we need to create page chain of zspage dynamically
> so this patch factors it out from alloc_zspage.
> 
> Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> Signed-off-by: Minchan Kim <minchan@kernel.org>

Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>

[..]
> +		page = alloc_page(flags);
> +		if (!page) {
> +			while (--i >= 0)
> +				__free_page(pages[i]);

				put_page() ?

a minor nit, put_page() here probably will be in alignment
with __free_zspage(), which does put_page().

	-ss

> +			return NULL;
> +		}
> +		pages[i] = page;
>  	}
>  
> +	create_page_chain(pages, class->pages_per_zspage);
> +	first_page = pages[0];
> +	init_zspage(class, first_page);
> +
>  	return first_page;
>  }

[toc] | [next] | [standalone]


#1401839

FromMinchan Kim <minchan@kernel.org>
Date2016-05-17 03:10 +0200
Message-ID<rzBGh-6a3-1@gated-at.bofh.it>
In reply to#1401280
On Mon, May 16, 2016 at 11:14:20AM +0900, Sergey Senozhatsky wrote:
> On (05/09/16 11:20), Minchan Kim wrote:
> > For page migration, we need to create page chain of zspage dynamically
> > so this patch factors it out from alloc_zspage.
> > 
> > Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> > Signed-off-by: Minchan Kim <minchan@kernel.org>
> 
> Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>

Thanks!

> 
> [..]
> > +		page = alloc_page(flags);
> > +		if (!page) {
> > +			while (--i >= 0)
> > +				__free_page(pages[i]);
> 
> 				put_page() ?
> 
> a minor nit, put_page() here probably will be in alignment
> with __free_zspage(), which does put_page().

Normally, we use put_page in case that someone can grab a referece of
the page so we cannot free the page. Otherwise, alloc_page and
__free_page is more straight to me code readability POV.

> 
> 	-ss
> 
> > +			return NULL;
> > +		}
> > +		pages[i] = page;
> >  	}
> >  
> > +	create_page_chain(pages, class->pages_per_zspage);
> > +	first_page = pages[0];
> > +	init_zspage(class, first_page);
> > +
> >  	return first_page;
> >  }

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web