Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755215AbcCOGkq (ORCPT ); Tue, 15 Mar 2016 02:40:46 -0400 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:46580 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750835AbcCOGkh (ORCPT ); Tue, 15 Mar 2016 02:40:37 -0400 X-Original-SENDERIP: 156.147.1.125 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 165.244.98.204 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 10.177.223.161 X-Original-MAILFROM: minchan@kernel.org Date: Tue, 15 Mar 2016 15:41:26 +0900 From: Minchan Kim To: Sergey Senozhatsky CC: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, jlayton@poochiereds.net, bfields@fieldses.org, Vlastimil Babka , Joonsoo Kim , koct9i@gmail.com, aquini@redhat.com, virtualization@lists.linux-foundation.org, Mel Gorman , Hugh Dickins , Sergey Senozhatsky , rknize@motorola.com, Rik van Riel , Gioh Kim Subject: Re: [PATCH v1 09/19] zsmalloc: keep max_object in size_class Message-ID: <20160315064126.GA2808@bbox> References: <1457681423-26664-1-git-send-email-minchan@kernel.org> <1457681423-26664-10-git-send-email-minchan@kernel.org> <20160315062824.GE1464@swordfish> MIME-Version: 1.0 In-Reply-To: <20160315062824.GE1464@swordfish> User-Agent: Mutt/1.5.21 (2010-09-15) X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB01/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/03/15 15:40:33, Serialize by Router on LGEKRMHUB01/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/03/15 15:40:33, Serialize complete at 2016/03/15 15:40:33 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1420 Lines: 37 On Tue, Mar 15, 2016 at 03:28:24PM +0900, Sergey Senozhatsky wrote: > On (03/11/16 16:30), Minchan Kim wrote: > > Every zspage in a size_class has same number of max objects so > > we could move it to a size_class. > > > > Signed-off-by: Minchan Kim > > --- > > mm/zsmalloc.c | 29 ++++++++++++++--------------- > > 1 file changed, 14 insertions(+), 15 deletions(-) > > > > diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c > > index b4fb11831acb..ca663c82c1fc 100644 > > --- a/mm/zsmalloc.c > > +++ b/mm/zsmalloc.c > > @@ -32,8 +32,6 @@ > > * page->freelist: points to the first free object in zspage. > > * Free objects are linked together using in-place > > * metadata. > > - * page->objects: maximum number of objects we can store in this > > - * zspage (class->zspage_order * PAGE_SIZE / class->size) > > * page->lru: links together first pages of various zspages. > > * Basically forming list of zspages in a fullness group. > > * page->mapping: class index and fullness group of the zspage > > @@ -211,6 +209,7 @@ struct size_class { > > * of ZS_ALIGN. > > */ > > int size; > > + int objs_per_zspage; > > unsigned int index; > > struct page ->objects "comes for free". now we don't use it, instead > every size_class grows by 4 bytes? is there any reason for this? It is union with _mapcount and it is used by checking non-lru movable page in this patchset. > > -ss