Util-Linux package development
 help / color / mirror / Atom feed
From: Oliver Freyermuth <o.freyermuth@googlemail.com>
To: util-linux@vger.kernel.org
Subject: [Regression] util-linux-2.27: zramctl lists same info for all devices (DATA COMPR TOTAL)
Date: Mon, 7 Sep 2015 20:29:37 +0200	[thread overview]
Message-ID: <55EDD791.30606@googlemail.com> (raw)

Dear util-linux developers, 

after updating to util-linux 2.7, zramctl output is broken if one just lists all devices: 

# zramctl 
NAME       ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 lz4             2G   4K   64B    4K       4 [SWAP]
/dev/zram1 lz4            12G   4K   64B    4K       4 /var/tmp/portage
/dev/zram2 lz4            12G   4K   64B    4K       4 /var/tmp/olifre

Compare this to:
# zramctl /dev/zram0
NAME       ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 lz4             2G   4K   64B    4K       4 [SWAP]

# zramctl /dev/zram1
NAME       ALGORITHM DISKSIZE  DATA  COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram1 lz4            12G  4,6M 202,5K  476K       4 /var/tmp/portage

i.e. it seems that in "listing" mode (no device given) it always shows the same information in DATA, COMPR and TOTAL columns for all devices. 
This is with kernel 4.2, /sys/block/zram1/mm_stat etc. behave correctly. 

I guess it is related to commit 5388c862607ec4f25f3e7ad23ab858b696bde1a1 . 
It parses mmstat and fills in z->mm_stat and z->mm_stat_probed only the first time get_mm_stat is called. Since the codes reuses the very same zram-struct "z" afterwards and z->mm_stat is never freed (and z->mm_stat_probed is never reset), only the first device is every queried. 

This was working fine with util-linux 2.6 which did not use this function yet. 

Cheers, 
Oliver

PS: I am not subscribed to util-linux, so please include me in replies. 

             reply	other threads:[~2015-09-07 18:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-07 18:29 Oliver Freyermuth [this message]
2015-09-24 10:49 ` [Regression] util-linux-2.27: zramctl lists same info for all devices (DATA COMPR TOTAL) Karel Zak

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=55EDD791.30606@googlemail.com \
    --to=o.freyermuth@googlemail.com \
    --cc=util-linux@vger.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