Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1674402

Re: zram hot_add device busy

From Minchan Kim <minchan@kernel.org>
Newsgroups linux.kernel
Subject Re: zram hot_add device busy
Date 2017-06-26 04:30 +0200
Message-ID <tWrWO-4OG-3@gated-at.bofh.it> (permalink)
References <tVQaR-6vZ-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hello,

On Sat, Jun 24, 2017 at 11:08:01AM +0100, Sami Kerola wrote:
> Hello,
> 
> While going through if there are new util-linux bugs reported I came a
> cross this https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/1645846
> 
> Simple way to reproduce the issue is:
> d=$(cat /sys/class/zram-control/hot_add) && zramctl --size 256M /dev/zram$d

To know the problem comes from any side, could you test it without zramctl
command?

IOW,
        d=$(cat /sys/class/zram-control/hot_add) && echo $((256<<20)) /dev/zram$d

If it still has a problem, please show your test code which helps
understanding of fundamental problem a lot. ;-)

> 
> I am not entirely sure, but drivers/block/zram/zram_drv.c function
> zram_add() should block until the device is usable. Looking the code
> that it might be the device_add_disk() from block/genhd.c that should
> do the blocking. But perhaps it's best if I leave such detail to
> people who know the code a bit better.

I might miss something but I believe device is usable state after zram_add done.
Just in case, please test return value after some operation.

if [ $? -ne 0  ];
then
        echo "fail to some op"
        blah blah
fi

Thanks.

> 
> One thing annoys me. I expected 'zramctl --find --size 256M' to suffer
> from same issue but it does not. I can only reproduce the issue when
> triggering hot_add separately, and as quick as possibly using the
> path. Notice that sometimes it takes second try before the hot_add and
> use triggers the issue. That is almost certainly down to speed the
> system in hand, e.g., quicker the computer less likely to trigger.
> 
> -- 
> Sami Kerola
> http://www.iki.fi/kerolasa/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

zram hot_add device busy Sami Kerola <kerolasa@iki.fi> - 2017-06-24 12:10 +0200
  Re: zram hot_add device busy Minchan Kim <minchan@kernel.org> - 2017-06-26 04:30 +0200
  Re: zram hot_add device busy Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-06-26 04:40 +0200
    Re: zram hot_add device busy Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-06-26 05:00 +0200

csiph-web