mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Minchan Kim <minchan@kernel.org>
To: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] zram: idle memory tracking
Date: Tue, 27 Mar 2018 11:26:35 +0900	[thread overview]
Message-ID: <20180327022635.GA74514@rodete-desktop-imager.corp.google.com> (raw)
In-Reply-To: <20180327022126.GH467@jagdpanzerIV>

On Tue, Mar 27, 2018 at 11:21:26AM +0900, Sergey Senozhatsky wrote:
> On (03/26/18 15:49), Minchan Kim wrote:
> [..]
> > +static ssize_t read_access_time(struct file *file, char __user *buf,
> > +				size_t count, loff_t *ppos)
> > +{
> [..]
> > +
> > +	for (index = *ppos; index < nr_pages; index++) {
> > +		zram_slot_lock(zram, index);
> > +		if (zram_test_flag(zram, index, ZRAM_WB))
> > +			goto next;
> 
> I think it'll be better to show ZRAM_WB pages as well. Those pages
> are swapped out pages after all, consuming swap space - a physical
> page. Freeing those should also be beneficial. So tracking "bad"
> incompressible pages is quite handful.
> 
> > +		if (zram_test_flag(zram, index, ZRAM_SAME))
> > +			goto next;
> > +		if (!zram_get_handle(zram, index))
> > +			goto next;
> > +
> > +		ret = snprintf(kbuf + written, remained, "%lu %lu\n", index,
> > +				get_seconds() - zram->table[index].ac_time);
> 
> So here you can add a flag after index and age which will tell if the page
> is in zsmalloc pool or on backing swap device.

Yeb, that's the way I'm approach during our discussion!

Thanks for the review, Sergey!

      reply	other threads:[~2018-03-27  2:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-26  6:49 [PATCH 1/2] zram: correct flag name of ZRAM_ACCESS Minchan Kim
2018-03-26  6:49 ` [PATCH 2/2] zram: idle memory tracking Minchan Kim
2018-03-26  8:15   ` Greg KH
2018-03-26  9:57     ` Minchan Kim
2018-03-27  0:49   ` Sergey Senozhatsky
2018-03-27  1:03     ` Minchan Kim
2018-03-27  1:13       ` Sergey Senozhatsky
2018-03-27  1:47         ` Sergey Senozhatsky
2018-03-27  2:05           ` Minchan Kim
2018-03-27  2:21   ` Sergey Senozhatsky
2018-03-27  2:26     ` Minchan Kim [this message]

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=20180327022635.GA74514@rodete-desktop-imager.corp.google.com \
    --to=minchan@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    /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

all inboxes | Powered by JetHome®