linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Alexey Romanov <AVRomanov@sberdevices.ru>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
	Minchan Kim <minchan@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] zsmalloc: do not scan for allocated objects in empty zspage
Date: Sat, 24 Jun 2023 11:29:17 +0900	[thread overview]
Message-ID: <20230624022917.GF2934656@google.com> (raw)
In-Reply-To: <20230623104917.2n6vcxvhvlwmjm2m@cab-wsm-0029881>

On (23/06/23 10:49), Alexey Romanov wrote:
> > +static bool zspage_empty(struct zspage *zspage)
> > +{
> > +	return get_zspage_inuse(zspage) == 0;
> > +}
> > +
> >  /**
> >   * zs_lookup_class_index() - Returns index of the zsmalloc &size_class
> >   * that hold objects of the provided size.
> > @@ -1625,6 +1630,10 @@ static void migrate_zspage(struct zs_pool *pool, struct size_class *class,
> >  		obj_idx++;
> >  		record_obj(handle, free_obj);
> >  		obj_free(class->size, used_obj);
> > +
> > +		/* Stop if there are no more objects to migrate */
> > +		if (zspage_empty(get_zspage(s_page)))
> > +			break;
> >  	}
> >  
> >  	/* Remember last position in this iteration */
> > -- 
> > 2.41.0.162.gfafddb0af9-goog
> > 
> 
> I think we can add similar check in zs_reclaim_page() function.
> There we also scan zspage to find the allocated object.

LRU was moved to zswap, so zs_reclaim_page() doesn't exist any longer
(in linux-next).


  reply	other threads:[~2023-06-24  2:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-23  4:40 [PATCH 0/2] zsmalloc: small compaction improvements Sergey Senozhatsky
2023-06-23  4:40 ` [PATCH 1/2] zsmalloc: do not scan for allocated objects in empty zspage Sergey Senozhatsky
2023-06-23 10:49   ` Alexey Romanov
2023-06-24  2:29     ` Sergey Senozhatsky [this message]
2023-06-26 10:54       ` Alexey Romanov
2023-06-23  4:40 ` [PATCH 2/2] zsmalloc: move migration destination zspage inuse check Sergey Senozhatsky
2023-06-23 17:03 ` [PATCH 0/2] zsmalloc: small compaction improvements Minchan Kim
2023-06-24  5:00   ` Sergey Senozhatsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230624022917.GF2934656@google.com \
    --to=senozhatsky@chromium.org \
    --cc=AVRomanov@sberdevices.ru \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).