From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753473AbcEPCOa (ORCPT ); Sun, 15 May 2016 22:14:30 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:35431 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753316AbcEPCO0 (ORCPT ); Sun, 15 May 2016 22:14:26 -0400 Date: Mon, 16 May 2016 11:14:20 +0900 From: Sergey Senozhatsky To: Minchan Kim Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Sergey Senozhatsky Subject: Re: [PATCH v5 07/12] zsmalloc: factor page chain functionality out Message-ID: <20160516021420.GC504@swordfish> References: <1462760433-32357-1-git-send-email-minchan@kernel.org> <1462760433-32357-8-git-send-email-minchan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1462760433-32357-8-git-send-email-minchan@kernel.org> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Signed-off-by: Minchan Kim Reviewed-by: Sergey Senozhatsky [..] > + 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; > }