Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755067AbcCOG1S (ORCPT ); Tue, 15 Mar 2016 02:27:18 -0400 Received: from mail-pf0-f172.google.com ([209.85.192.172]:35637 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754741AbcCOG1C (ORCPT ); Tue, 15 Mar 2016 02:27:02 -0400 Date: Tue, 15 Mar 2016 15:28:24 +0900 From: Sergey Senozhatsky To: Minchan Kim 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: <20160315062824.GE1464@swordfish> References: <1457681423-26664-1-git-send-email-minchan@kernel.org> <1457681423-26664-10-git-send-email-minchan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1457681423-26664-10-git-send-email-minchan@kernel.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1192 Lines: 33 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? -ss