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


Groups > linux.kernel > #1174163

Re: [RFC][PATCHv3 2/7] zsmalloc: partial page ordering within a fullness_list

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Minchan Kim <minchan@kernel.org>
Newsgroups linux.kernel
Subject Re: [RFC][PATCHv3 2/7] zsmalloc: partial page ordering within a fullness_list
Date Tue, 30 Jun 2015 02:50:01 +0200
Message-ID <pGRUl-2Gw-3@gated-at.bofh.it> (permalink)
References <pCGut-7o6-7@gated-at.bofh.it> <pCGut-7o6-11@gated-at.bofh.it> <pGBcS-3QX-7@gated-at.bofh.it> <pGQYh-1o8-5@gated-at.bofh.it>
X-Original-To Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=BWUp9SPKe0bLqaPdWNsmH7z9PAp0zVPUFz7YP7/sY7U=; b=o29GzpbOj7Kpvbhv2XItsmq3VnRZnLynpQVzvWXHu8s1OEMlrDDCAlc+Ts4lWj5ONh hasjcEaELxvTqIXv8DrMu1Oo6RdkWHFS1RsUwgwaGH1piysF1io8jZ/DSvBM5OdQQS0d 30F7hnSSom3YZxxkeG+000oGektcVdIfpYQGpybOSw8lvq/jsZu0BMk5256UNn8kOPbS P9rH5OiG4PFNNMdzMoYj3G8r/e62kt8FtEGQZuzJ5g3qKwnVhjP4bensgLfEpgIBOhe2 nD9vjkpROU2rJPt8T3xu7XE+x+wQroYQD2GxGeBKJSSZqvFDAp5wQAElztH/gxbmX/jV 0yqw==
X-Received by 10.68.194.66 with SMTP id hu2mr36677077pbc.99.1435624977163; Mon, 29 Jun 2015 17:42:57 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.23 (2014-03-12)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 90
Organization linux.* mail to news gateway
X-Original-Cc Sergey Senozhatsky <sergey.senozhatsky@gmail.com>, Andrew Morton <akpm@linux-foundation.org>, linux-mm@kvack.org, linux-kernel@vger.kernel.org
X-Original-Date Tue, 30 Jun 2015 09:42:46 +0900
X-Original-Message-ID <20150630004246.GA13493@blaptop>
X-Original-References <1434628004-11144-1-git-send-email-sergey.senozhatsky@gmail.com> <1434628004-11144-3-git-send-email-sergey.senozhatsky@gmail.com> <20150629065218.GC13179@bbox> <20150629234124.GB7301@swordfish>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref aioe.org linux.kernel:1174163

Show key headers only | View raw


On Tue, Jun 30, 2015 at 08:41:24AM +0900, Sergey Senozhatsky wrote:
> Hello,
> 
> Sorry for long reply.
> 
> On (06/29/15 15:52), Minchan Kim wrote:
> [..]
> > >  	head = &class->fullness_list[fullness];
> > > -	if (*head)
> > > -		list_add_tail(&page->lru, &(*head)->lru);
> > > +	if (*head) {
> > > +		/*
> > > +		 * We want to see more ZS_FULL pages and less almost
> > > +		 * empty/full. Put pages with higher ->inuse first.
> > > +		 */
> > > +		if (page->inuse < (*head)->inuse)
> > > +			list_add_tail(&page->lru, &(*head)->lru);
> > > +		else
> > > +			list_add(&page->lru, &(*head)->lru);
> > > +	}
> > 
> > >  
> > >  	*head = page;
> > 
> > Why do you want to always put @page in the head?
> > How about this?
> 
> 
> Yeah, right. Looks OK to me. How do we want to handle it? Do you want
> to submit it with Suggested-by: ss (I'm fine) or you want me to submit
> it later today with Suggested-by: Minchan Kim?

Hi Sergey,

Thanks for considering the credit.
However, it was just review so no need my sign. :)

I really appreciate your good works.
Thanks.


> 
> 	-ss
> 
> > diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
> > index e8cb31c..1c5fde9 100644
> > --- a/mm/zsmalloc.c
> > +++ b/mm/zsmalloc.c
> > @@ -658,21 +658,25 @@ static void insert_zspage(struct page *page, struct size_class *class,
> >         if (fullness >= _ZS_NR_FULLNESS_GROUPS)
> >                 return;
> > 
> > +       zs_stat_inc(class, fullness == ZS_ALMOST_EMPTY ?
> > +                       CLASS_ALMOST_EMPTY : CLASS_ALMOST_FULL, 1);
> > +
> >         head = &class->fullness_list[fullness];
> > -       if (*head) {
> > -               /*
> > -                * We want to see more ZS_FULL pages and less almost
> > -                * empty/full. Put pages with higher ->inuse first.
> > -                */
> > -               if (page->inuse < (*head)->inuse)
> > -                       list_add_tail(&page->lru, &(*head)->lru);
> > -               else
> > -                       list_add(&page->lru, &(*head)->lru);
> > +       if (!*head) {
> > +               *head = page;
> > +               return;
> >         }
> > 
> > -       *head = page;
> > -       zs_stat_inc(class, fullness == ZS_ALMOST_EMPTY ?
> > -                       CLASS_ALMOST_EMPTY : CLASS_ALMOST_FULL, 1);
> > +       /*
> > +        * We want to see more ZS_FULL pages and less almost
> > +        * empty/full. Put pages with higher ->inuse first.
> > +        */
> > +       list_add_tail(&page->lru, &(*head)->lru);
> > +       if (page->inuse >= (*head)->inuse)
> > +               *head = page;
> >  }

-- 
Kind regards,
Minchan Kim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

Re: [RFC][PATCHv3 2/7] zsmalloc: partial page ordering within a  fullness_list Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-06-30 01:50 +0200
  Re: [RFC][PATCHv3 2/7] zsmalloc: partial page ordering within a  fullness_list Minchan Kim <minchan@kernel.org> - 2015-06-30 02:50 +0200

csiph-web