qihoo360 / kmemcache Goto Github PK
View Code? Open in Web Editor NEWlinux kernel memcache server
License: BSD 3-Clause "New" or "Revised" License
linux kernel memcache server
License: BSD 3-Clause "New" or "Revised" License
[root@localhost kmemcache]# ./test/testapp
1..41
ok 1 - strtol
ok 2 - strtoll
ok 3 - strtoul
ok 4 - strtoull
insmod: can't read './kmod/kmemcache': No such file or directory
testapp: util.c:53: insert_kmod: Assertion stat == 0' failed. testapp: testapp.c:286: start_server: Assertion
stat == 0' failed.
Aborted
准备测试一下插入1K万数据的性能,不知怎么搞的,请求服务端都没有回应了,好像被阻塞了。
INFO: task kmcworker2:6286 blocked for more than 120 seconds.
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
kmcworker2 D 0000000000000000 0 6286 2 0x00000000
ffff8800acec3b50 0000000000000046 ffff8800acec3ab0 ffffffff814ec71b
ffff8800acec3ae0 ffffffff81419fde ffff8801fdd05c00 0000000000000026
ffff88001f9e45f8 ffff8800acec3fd8 000000000000fb88 ffff88001f9e45f8
Call Trace:
[<ffffffff814ec71b>] ? _spin_unlock_bh+0x1b/0x20
[<ffffffff81419fde>] ? release_sock+0xce/0xe0
[<ffffffff814eaac5>] schedule_timeout+0x215/0x2e0
[<ffffffff81416b03>] ? sock_sendmsg+0x123/0x150
[<ffffffff814ea743>] wait_for_common+0x123/0x180
[<ffffffff8105fa40>] ? default_wake_function+0x0/0x20
[<ffffffff814ea85d>] wait_for_completion+0x1d/0x20
[<ffffffff8108bc53>] __cancel_work_timer+0x1b3/0x1e0
[<ffffffff8108b5a0>] ? wq_barrier_func+0x0/0x20
[<ffffffff8108bcb0>] cancel_work_sync+0x10/0x20
[<ffffffffa056bf6d>] update_event+0xad/0xe0 [kmemcache]
[<ffffffffa0573043>] mc_worker_machine+0xc3/0xea0 [kmemcache]
[<ffffffffa056adf0>] ? mc_conn_work+0x0/0x40 [kmemcache]
[<ffffffffa056ae10>] mc_conn_work+0x20/0x40 [kmemcache]
[<ffffffff8108b120>] worker_thread+0x170/0x2a0
[<ffffffff81090990>] ? autoremove_wake_function+0x0/0x40
[<ffffffff8108afb0>] ? worker_thread+0x0/0x2a0
[<ffffffff81090626>] kthread+0x96/0xa0
[<ffffffff8100c0ca>] child_rip+0xa/0x20
[<ffffffff81090590>] ? kthread+0x0/0xa0
[<ffffffff8100c0c0>] ? child_rip+0x0/0x20
INFO: task kmcworker3:6287 blocked for more than 120 seconds.
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
kmcworker3 D 0000000000000001 0 6287 2 0x00000000
ffff88001f973b50 0000000000000046 ffff88001f973ab0 ffffffff814ec71b
ffff88001f973ae0 ffffffff81419fde ffff8801b911d800 0000000000000026
ffff88001f9e5ab8 ffff88001f973fd8 000000000000fb88 ffff88001f9e5ab8
Call Trace:
[<ffffffff814ec71b>] ? _spin_unlock_bh+0x1b/0x20
[<ffffffff81419fde>] ? release_sock+0xce/0xe0
[<ffffffff814eaac5>] schedule_timeout+0x215/0x2e0
[<ffffffff81416b03>] ? sock_sendmsg+0x123/0x150
[<ffffffff814ea743>] wait_for_common+0x123/0x180
[<ffffffff8105fa40>] ? default_wake_function+0x0/0x20
[<ffffffff814ea85d>] wait_for_completion+0x1d/0x20
[<ffffffff8108bc53>] __cancel_work_timer+0x1b3/0x1e0
[<ffffffff8108b5a0>] ? wq_barrier_func+0x0/0x20
[<ffffffff8108bcb0>] cancel_work_sync+0x10/0x20
[<ffffffffa056bf6d>] update_event+0xad/0xe0 [kmemcache]
[<ffffffffa0573043>] mc_worker_machine+0xc3/0xea0 [kmemcache]
[<ffffffffa056adf0>] ? mc_conn_work+0x0/0x40 [kmemcache]
[<ffffffffa056ae10>] mc_conn_work+0x20/0x40 [kmemcache]
[<ffffffff8108b120>] worker_thread+0x170/0x2a0
[<ffffffff81090990>] ? autoremove_wake_function+0x0/0x40
[<ffffffff8108afb0>] ? worker_thread+0x0/0x2a0
[<ffffffff81090626>] kthread+0x96/0xa0
[<ffffffff8100c0ca>] child_rip+0xa/0x20
[<ffffffff81090590>] ? kthread+0x0/0xa0
[<ffffffff8100c0c0>] ? child_rip+0x0/0x20
make出现一些警告,忽略之,正常install,
insmod kmemcache.ko,报错,查看dmesg,报
kmemcache: Unknown symbol simple_strtoll
下面是完整的make信息
make -C user PWD=/home/clang/kmemcache/user all
make[1]: Entering directory `/home/clang/kmemcache/user'
gcc -g -O2 -Wall -I/home/clang/kmemcache/user/../include -c -o umemcached.o umemcached.c
umemcached.c: In function ‘main’:
umemcached.c:469: warning: unused variable ‘pw’
gcc -g -O2 -Wall -I/home/clang/kmemcache/user/../include -c -o settings.o settings.c
gcc -g -O2 -Wall -I/home/clang/kmemcache/user/../include -c -o cache_bh.o cache_bh.c
gcc -g -O2 -Wall -I/home/clang/kmemcache/user/../include -c -o daemon.o daemon.c
gcc -o umemcached umemcached.o settings.o cache_bh.o daemon.o
make[1]: Leaving directory `/home/clang/kmemcache/user'
make -C kmod KERNELDIR=/lib/modules/2.6.32-279.19.1.el6.x86_64/build PWD=/home/clang/kmemcache/kmod all
make[1]: Entering directory `/home/clang/kmemcache/kmod'
make -C /lib/modules/2.6.32-279.19.1.el6.x86_64/build M=/home/clang/kmemcache/kmod modules
make[2]: Entering directory `/usr/src/kernels/2.6.32-358.6.1.el6.x86_64'
CC [M] /home/clang/kmemcache/kmod/kmodhelper.o
CC [M] /home/clang/kmemcache/kmod/mc_strops.o
CC [M] /home/clang/kmemcache/kmod/mc_buffer.o
CC [M] /home/clang/kmemcache/kmod/mc_hash.o
CC [M] /home/clang/kmemcache/kmod/mc_slabs.o
CC [M] /home/clang/kmemcache/kmod/mc_items.o
CC [M] /home/clang/kmemcache/kmod/mc_hashtable.o
CC [M] /home/clang/kmemcache/kmod/mc_stats.o
CC [M] /home/clang/kmemcache/kmod/mc_main.o
CC [M] /home/clang/kmemcache/kmod/mc_worker.o
CC [M] /home/clang/kmemcache/kmod/mc_messenger.o
CC [M] /home/clang/kmemcache/kmod/mc_dispatcher.o
/home/clang/kmemcache/kmod/mc_dispatcher.c: In function ‘server_socket_unix’:
/home/clang/kmemcache/kmod/mc_dispatcher.c:587: warning: value computed is not used
/home/clang/kmemcache/kmod/mc_dispatcher.c:590: warning: value computed is not used
CC [M] /home/clang/kmemcache/kmod/mc_proto_bin.o
CC [M] /home/clang/kmemcache/kmod/mc_proto_txt.o
CC [M] /home/clang/kmemcache/kmod/mc_proto.o
CC [M] /home/clang/kmemcache/kmod/mc_connector.o
CC [M] /home/clang/kmemcache/kmod/mc_uparam.o
LD [M] /home/clang/kmemcache/kmod/kmemcache.o
Building modules, stage 2.
MODPOST 2 modules
WARNING: "simple_strtoll" [/home/clang/kmemcache/kmod/kmemcache.ko] undefined!
CC /home/clang/kmemcache/kmod/kmemcache.mod.o
LD [M] /home/clang/kmemcache/kmod/kmemcache.ko.unsigned
NO SIGN [M] /home/clang/kmemcache/kmod/kmemcache.ko
CC /home/clang/kmemcache/kmod/kmodhelper.mod.o
LD [M] /home/clang/kmemcache/kmod/kmodhelper.ko.unsigned
NO SIGN [M] /home/clang/kmemcache/kmod/kmodhelper.ko
make[2]: Leaving directory `/usr/src/kernels/2.6.32-358.6.1.el6.x86_64'
make[1]: Leaving directory `/home/clang/kmemcache/kmod'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.