Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zram incompatibility #60

Closed
onlyjob opened this issue Jun 10, 2015 · 7 comments
Closed

zram incompatibility #60

onlyjob opened this issue Jun 10, 2015 · 7 comments

Comments

@onlyjob
Copy link
Contributor

onlyjob commented Jun 10, 2015

I'm getting the following errors in syslog when I'm trying to use zram0 block device as dm-writeboost cache:

kernel: [18820.076152] device-mapper: writeboost: read_superblock_header() I/O error(-5), bits(18446744073709551615), dev(252:1), sector(0), rw(0)
kernel: [18820.076157] device-mapper: writeboost: read_superblock_header failed
kernel: [18820.076158] device-mapper: writeboost: audit_cache_device failed
kernel: [18820.076287] device-mapper: table: 253:0: writeboost: resume_cache failed
kernel: [18820.076289] device-mapper: ioctl: error adding target to table

/dev/zram0 device is initialised as follows:

modprobe -v zram
echo 1024M > /sys/block/zram0/disksize

Is it possible to use dm-writeboost with RAM disk?

@onlyjob
Copy link
Contributor Author

onlyjob commented Jun 10, 2015

dm-writeboost can use /dev/loop0 on tmpfs as caching device.
Here is how 256M RAM disk can be initialised:

/bin/dd if=/dev/zero of=/tmp/ramloop0 bs=1048576 count=256
/sbin/losetup -v /dev/loop0 /tmp/ramloop0

@akiradeveloper
Copy link
Owner

Nice testing.

dm-writeboost can use /dev/loop0 on tmpfs as caching device.

Yes. I have tested with tmpfs before to emulate super-fast SSD. With the benchmark we could know how efficient the code paths of writeboost is.

I'm getting the following errors in syslog when I'm trying to use zram0 block device as dm-writeboost cache:

So, I am bit surprised to here this. From the user's point view, tmpfs and zram isn't different is my understanding; they are both just a block device.

This log says that read to super block (sector 0) failed and initialization of writeboost caching failed consequently. I am wondering if you can simply read/write the zram device by dd.

kernel: [18820.076152] device-mapper: writeboost: read_superblock_header() I/O error(-5), bits(18446744073709551615), dev(252:1), sector(0), rw(0)
kernel: [18820.076157] device-mapper: writeboost: read_superblock_header failed
kernel: [18820.076158] device-mapper: writeboost: audit_cache_device failed
kernel: [18820.076287] device-mapper: table: 253:0: writeboost: resume_cache failed
kernel: [18820.076289] device-mapper: ioctl: error adding target to table

@onlyjob
Copy link
Contributor Author

onlyjob commented Jun 10, 2015

I was surprised so much that I've opened this bug... I have no problem making swap on /dev/zram0 which actually works pretty much as normal block device except when I'm trying to use it with dm-writeboost...

@akiradeveloper
Copy link
Owner

I found similar issue but with dm-cache.

http://www.redhat.com/archives/dm-devel/2013-December/msg00114.html

I suppose this problem is relevant to device-mapper itself. Some code in device-mapper isn't suitable for using zram as underlying device for example.

@onlyjob
Copy link
Contributor Author

onlyjob commented Jun 10, 2015

Thank you for explanation. I forgot to answer your question -- yes I can read/write the zram device by dd or ddrescue.

@akiradeveloper
Copy link
Owner

I will post question to the dm-devel.

@onlyjob
Copy link
Contributor Author

onlyjob commented Jan 13, 2016

dm-writeboost works perfectly with brd (/dev/ramN) RAM disks hence I suppose it doesn't matter if zram disks can not be used.

@onlyjob onlyjob closed this as completed Jan 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants