Public bug reported:
On my machine, I can trigger the bug 100% of the time if I do this:
modprobe zram; d=$(zramctl --find) && zramctl --size 256M $d
Here is the error message zramctl emits:
zramctl: /dev/zram0: failed to reset: Device or resource busy
However, the following always work (0% failure)!
modprobe zram; sleep 0.1; d=$(zramctl --find) && zramctl --size 256M $d
modprobe zram; d=$(zramctl --find) && sleep 0.1 && zramctl --size 256M $d
And the following sometimes works and sometimes doesn't:
modprobe zram; d=$(zramctl --find --size 256M)
Chances are about 25% of failure according to this:
for i in {0..99};
do
echo $i;
modprobe -r zram;
modprobe zram;
d=$(zramctl --find --size 256M);
sleep 0.05;
done 2>&1 | grep -c failed
Bizarrely, while putting a long sleep (0.1s) after the modprobe fixes
the problem, putting a short sleep in (0.01s) increases the failure
rate to 95%!
----------------------------------------------------------------------
for i in {0..99};
do
echo $i;
modprobe -r zram;
modprobe zram;
sleep 0.01 # <-- this makes things worse!
d=$(zramctl --find --size 256M);
sleep 0.05;
done 2>&1 | grep -c failed
----------------------------------------------------------------------
for i in {0..99};
do
echo $i;
modprobe -r zram;
modprobe zram;
sleep 0.10 # <-- this completely fixes the problem
d=$(zramctl --find --size 256M);
sleep 0.05;
done 2>&1 | grep -c failed
----------------------------------------------------------------------
Because of the weird window of time in which this bug occurs, I assume
it is caused by some asynchronous process briefly locking the device
shortly after 'modprobe zram'. I'm guessing zramctl's --find part is
running before the lock but the --size part happens while the device is
in use.
** Affects: util-linux (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1645846
Title:
zramctl fails if called within a certain interval after modprobe zram.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/1645846/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs