Skip to contentSkip to conversation

Xen blktap driver for Ceph RBD : Anybody wants to test ? :p

Xen-devel Nathan O'Sullivan 2 participants 4 messages Jun 21, 2013 – Jul 2, 2013

lore
Share & tools
lore
#0 lore raw

I've been testing this on Ubuntu 12.04.02 64-bit with kernel 3.2.0-48 and ceph 0.61.4

With rbd cache disabled, it works well enough in initial testing.

However when rbd cache is enabled with:
[client]
rbd_cache = true

the tapdisk process crashes if I do this in the domU:
dd if=/dev/xvda bs=1M > /dev/null

I grabbed the tapdisk stacktrace with gdb:

Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7f1677186700 (LWP 6507)] 0x00007f167d21857c in free () from /lib/x86_64-linux-gnu/libc.so.6 (gdb) bt

#0  0x00007f167d21857c in free () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f167daab84b in ceph::buffer::raw_posix_aligned::~raw_posix_aligned() () from /usr/lib/librados.so.2
#2  0x00007f167daa6f6e in ceph::buffer::ptr::release() () from /usr/lib/librados.so.2
#3  0x00007f167d5711c7 in std::_List_base<ceph::buffer::ptr, std::allocator<ceph::buffer::ptr> >::_M_clear() () from /usr/lib/librbd.so.1
#4  0x00007f167d5a8ffe in ObjectCacher::trim(long, long) () from /usr/lib/librbd.so.1
#5  0x00007f167d5b7e60 in ObjectCacher::_readx(ObjectCacher::OSDRead*, ObjectCacher::ObjectSet*, Context*, bool) () from /usr/lib/librbd.so.1
#6  0x00007f167d5bd620 in ObjectCacher::C_RetryRead::finish(int) () from /usr/lib/librbd.so.1
#7  0x00007f167d57281a in Context::complete(int) () from /usr/lib/librbd.so.1
#8  0x00007f167d5b8f65 in finish_contexts(CephContext*, std::list<Context*, std::allocator<Context*> >&, int) () from /usr/lib/librbd.so.1
#9  0x00007f167d5ae705 in ObjectCacher::bh_read_finish(long, sobject_t, long, unsigned long, ceph::buffer::list&, int, bool) ()

from /usr/lib/librbd.so.1
#10 0x00007f167d5bc32f in ObjectCacher::C_ReadFinish::finish(int) () from /usr/lib/librbd.so.1 #11 0x00007f167d57281a in Context::complete(int) () from /usr/lib/librbd.so.1 #12 0x00007f167d5a31f5 in librbd::C_Request::finish(int) () from /usr/lib/librbd.so.1 #13 0x00007f167d5a1c14 in librbd::context_cb(void*, void*) () from /usr/lib/librbd.so.1 #14 0x00007f167d90f56d in librados::C_AioComplete::finish(int) () from /usr/lib/librados.so.2 #15 0x00007f167d97bb00 in Finisher::finisher_thread_entry() () from /usr/lib/librados.so.2 #16 0x00007f167c812e9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0 #17 0x00007f167d288ccd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#18 0x0000000000000000 in ?? ()

Regards
Nathan

#1 lore raw

Hi,

Quoted 2 lines

I've been testing this on Ubuntu 12.04.02 64-bit with kernel 3.2.0-48 and ceph 0.61.4

Thanks for testing :)

Quoted 6 lines

However when rbd cache is enabled with:
[client]
rbd_cache = true

the tapdisk process crashes if I do this in the domU:
dd if=/dev/xvda bs=1M > /dev/null

Interesting. I'm currently away for I'll try to setup a test and see if I can reproduce the issue locally.

I never really tried with the cache enabled.

Cheers,

Sylvain

#2 lore raw

Hi again,

Quoted 6 lines
Quoted 6 lines

However when rbd cache is enabled with:
[client]
rbd_cache = true

the tapdisk process crashes if I do this in the domU:
dd if=/dev/xvda bs=1M > /dev/null

I tested this locally and couldn't reproduce the issue.

Doing reads doesn't do anything bad AFAICT.
Doing writes OTOH seems to leak memory (or at least use much more memory than the configured cache size).

I also rechecked the code and I don't see anything wrong with it. AFAICT with or without cache shouldn't change anything so the issue might be in librbd itself.

Cheers,

Sylvain

#3 lore raw

I've installed debug symbols, perhaps that will give a better idea what is going on?

#0  __GI___libc_free (mem=0x7f5160650000) at malloc.c:2970
#1  0x00007f515f3ac84b in ~raw_posix_aligned (this=0x7f513c418f20, __in_chrg=<optimised out>) at common/buffer.cc:152
#2  ceph::buffer::raw_posix_aligned::~raw_posix_aligned (this=<optimised out>, __in_chrg=<optimised out>) at common/buffer.cc:155
#3  0x00007f515f3a7f6e in ceph::buffer::ptr::release (this=0x7f513801d600) at common/buffer.cc:328
#4  0x00007f515ee721c7 in ~ptr (this=0x7f513801d600, __in_chrg=<optimised out>) at ./include/buffer.h:159
#5  destroy (__p=0x7f513801d600, this=<optimised out>) at /usr/include/c++/4.6/ext/new_allocator.h:118
#6  std::_List_base<ceph::buffer::ptr, std::allocator<ceph::buffer::ptr> >::_M_clear (this=0x15e3908) at /usr/include/c++/4.6/bits/list.tcc:78
#7  0x00007f515eea9ffe in ~_List_base (this=0x15e3908, __in_chrg=<optimised out>) at /usr/include/c++/4.6/bits/stl_list.h:372
#8  ~list (this=0x15e3908, __in_chrg=<optimised out>) at /usr/include/c++/4.6/bits/stl_list.h:429
#9  ~list (this=0x15e3908, __in_chrg=<optimised out>) at ./include/buffer.h:304

#10 ~BufferHead (this=0x15e38c0, __in_chrg=<optimised out>) at osdc/ObjectCacher.h:84
#11 ObjectCacher::trim (this=0x1594a00, max_bytes=33554432, max_ob=42) at osdc/ObjectCacher.cc:949
#12 0x00007f515eeb8e60 in ObjectCacher::_readx (this=<optimised out>, rd=0x15f1f70, oset=0x1595110, onfinish=0x1591280, external_call=false) at osdc/ObjectCacher.cc:1240 #13 0x00007f515eebe620 in ObjectCacher::C_RetryRead::finish (this=0x15c3c30, r=<optimised out>) at osdc/ObjectCacher.h:554
#14 0x00007f515ee7381a in Context::complete (this=0x15c3c30, r=<optimised out>) at ./include/Context.h:41
#15 0x00007f515eeb9f65 in finish_contexts (cct=0x155cc30, finished=..., result=0) at ./include/Context.h:78
#16 0x00007f515eeaf705 in ObjectCacher::bh_read_finish (this=<optimised out>, poolid=<optimised out>, oid=..., start=983040, length=131072, bl=..., r=0, trust_enoent=true)
at osdc/ObjectCacher.cc:773
#17 0x00007f515eebd32f in ObjectCacher::C_ReadFinish::finish (this=0x15ced30, r=0) at osdc/ObjectCacher.h:478
#18 0x00007f515ee7381a in Context::complete (this=0x15ced30, r=<optimised out>) at ./include/Context.h:41
#19 0x00007f515eea41f5 in librbd::C_Request::finish (this=0x159dfd0, r=0) at librbd/LibrbdWriteback.cc:55
#20 0x00007f515eea2c14 in librbd::context_cb (c=<optimised out>, arg=<optimised out>) at librbd/LibrbdWriteback.cc:35
#21 0x00007f515f21056d in librados::C_AioComplete::finish (this=<optimised out>, r=<optimised out>) at ./librados/AioCompletionImpl.h:171
#22 0x00007f515f27cb00 in Finisher::finisher_thread_entry (this=0x1576d98) at common/Finisher.cc:56
#23 0x00007f515e113e9a in start_thread (arg=0x7f5158a87700) at pthread_create.c:308
#24 0x00007f515eb89ccd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#25 0x0000000000000000 in ?? ()

Quoted 21 lines · Sylvain Munaut

Hi again,

Quoted 6 lines
Quoted 6 lines

However when rbd cache is enabled with:
[client]
rbd_cache = true

the tapdisk process crashes if I do this in the domU:
dd if=/dev/xvda bs=1M > /dev/null

I tested this locally and couldn't reproduce the issue.

Doing reads doesn't do anything bad AFAICT.
Doing writes OTOH seems to leak memory (or at least use much more memory than the configured cache size).

I also rechecked the code and I don't see anything wrong with it. AFAICT with or without cache shouldn't change anything so the issue might be in librbd itself.

Cheers,

Sylvain