[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180327081015.GA3307@jagdpanzerIV>
Date: Tue, 27 Mar 2018 17:10:15 +0900
From: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To: Minchan Kim <minchan@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
LKML <linux-kernel@...r.kernel.org>,
Greg KH <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v2 4/4] zram: introduce zram memory tracking
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
Powered by blists - more mailing lists