All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Minchan Kim <minchan@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Greg KH <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v2 4/4] zram: introduce zram memory tracking
Date: Tue, 27 Mar 2018 17:10:15 +0900	[thread overview]
Message-ID: <20180327081015.GA3307@jagdpanzerIV> (raw)
In-Reply-To: <20180327065033.181819-5-minchan@kernel.org>

On (03/27/18 15:50), Minchan Kim wrote:
[..]
>
> +	char flags[__NR_ZRAM_PAGEFLAGS - ZRAM_FLAG_SHIFT];
>

Technically, you don't need this buffer...

> +		snprintf(flags, sizeof(flags), "%c%c%c",
> +			zram_test_flag(zram, index, ZRAM_SAME) ? 's' : '.',
> +			zram_test_flag(zram, index, ZRAM_WB) ? 'w' : '.',
> +			zram_test_flag(zram, index, ZRAM_HUGE) ? 'h' : '.');
> +
> +		last_access = get_seconds() - zram->table[index].ac_time;
> +		copied = snprintf(kbuf + written, count, "%12lu %6s %12lu\n",
> +						index, flags, last_access);

... if you'll do flags decoding in place. But if you prefer it this way
then OK.

	-ss

      parent reply	other threads:[~2018-03-27  8:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-27  6:50 [PATCH v2 0/4] zram memory tracking Minchan Kim
2018-03-27  6:50 ` [PATCH v2 1/4] zram: correct flag name of ZRAM_ACCESS Minchan Kim
2018-03-27  6:50 ` [PATCH v2 2/4] zram: mark incompressible page as ZRAM_HUGE Minchan Kim
2018-03-27  6:50 ` [PATCH v2 3/4] zram: record accessed second Minchan Kim
2018-03-27  6:50 ` [PATCH v2 4/4] zram: introduce zram memory tracking Minchan Kim
2018-03-27  7:12   ` Greg KH
2018-03-27  7:23     ` Minchan Kim
2018-03-27  8:10   ` Sergey Senozhatsky [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=20180327081015.GA3307@jagdpanzerIV \
    --to=sergey.senozhatsky.work@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.