驱动测试错误集锦

1,加载驱动报错

“insmod:error inserting './dcache.ko': -1 Cannot allocate memory

是因为你原来可能已经存在一个这样的驱动了,需要卸载掉。

2,卸载过程

* Remove a cache:

  Assuming your cache is named "fo o", run commands:

  umount /dev/mapper/foo
  dmsetup remove foo
  rmmod dcache
  lsmod
  insmod dcache

3,error: invalid storage class for function

就是因为少了一个“}”

4创建一个dcache硬件设备

fdisk -l
fdisk /dev/vdb
n,e,ent,ent,ent,w
blockdev --getsize /dev/vdc
echo 0 62914560 cache /dev/sdc /dev/sdb 0 8 65536 256 1 | dmsetup create dcache

报错

root@demo-2:~# echo 0 62914560 dcache /dev/vdc /dev/vdb 0 8 65536 256 1 | dmsetup create dcache

Message from syslogd@demo-2 at Dec  3 07:47:05 ...
 kernel:[951389.165407] Kernel panic - not syncing: VERIFY: assertion (spin_is_locked(&dmc->lock)) failed at /root/cc-threadpool/test3/dcache.c (227)

Message from syslogd@demo-2 at Dec  3 07:47:05 ...
 kernel:[951389.165408]

5,挂载

echo 0 62914560 dcache /dev/vdc /dev/vdb | dmsetup create dcache
cd /dev/mapper/


6,卸载驱动

root@demo-2:~# sudo  umount /dev/mapper/dcache 
sudo: unable to resolve host demo-2
umount: /mnt/dmcache: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
root@demo-2:~#  fuser -m /mnt/dmcache/
/mnt/dmcache:        10375c
root@demo-2:~# ps aux|grep 10375c
root     11539  0.0  0.0   7832   880 pts/1    R+   07:08   0:00 grep 10375c
root@demo-2:~# kill -9 10375
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值