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


Groups > linux.kernel > #1174145 > unrolled thread

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

Started bySergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
First post2015-06-30 01:50 +0200
Last post2015-06-30 02:50 +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: [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

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

FromSergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Date2015-06-30 01:50 +0200
SubjectRe: [RFC][PATCHv3 2/7] zsmalloc: partial page ordering within a fullness_list
Message-ID<pGQYh-1o8-5@gated-at.bofh.it>
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?

	-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;
>  }
--
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/

[toc] | [next] | [standalone]


#1174163

FromMinchan Kim <minchan@kernel.org>
Date2015-06-30 02:50 +0200
Message-ID<pGRUl-2Gw-3@gated-at.bofh.it>
In reply to#1174145
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/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web