Hi Gangs,
Recently I'm working on the rcutorture stuff but have been confused on it for a while, so I decided to shoot an email here to seek some professional advice.
The story is, a little bit long though, I want to enable the rcutorture test and want it be triggered manually, or by my test script at the time I want. So far, here is what I have done:
1. Clone arm-soc git tree and compile it on master branch, with omap2plus_defconfig as the "base" config, but added following switcher:
CONFIG_RCU_TORTURE_TEST=y
CONFIG_TORTURE_TEST=y
CONFIG_RCU_TORTURE_TEST_RUNNABLE=n
The procedure I walked through is:
$ git clone https://kernel.googlesource.com/pub/scm/linux/kernel/git/arm/arm-soc.git
$ cp arch/arm/configs/omap2plus_defconfig ./
Add above 3 switchers
$ mv omap2plus_defconfig .config
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
Once the graphic window shows, select exit then answer "Yes" to save.
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- LOADADDR=0x80008000 uImage
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- omap4-panda.dtb
All above can be done successfully. I noticed that after menuconfig, not only above 3 switchers, but many others related to them have been added to .config file, which I guess it's because the dependency.
2. Flash SD card with Linaro ubuntu build 697:
http://snapshots.linaro.org/ubuntu/pre-built/panda/697
3. Replace uImage and omap4-panda.dtb to the ones I compiled locally.
4. Boot Panda 4430.
The board can be booted up successfully, although no Ethernet support. rcutorture has shown up in boot log, but the thing confused me is the test has been triggered automatically in a period of every 60 seconds. According to this description page, looks like the switcher CONFIG_RCU_TORTURE_TEST_RUNNABLE=n doesn't take the effect:
https://www.kernel.org/doc/Documentation/RCU/torture.txt
root@linaro-developer:~# [ 180.881347] rcu-torture: rtc: c1091f98 ver: 1 tfle: 0 rta: 1 rtaf: 0 rtf: 0 rtmbe: 0 rtbke: 0 rtbre: 0 rtbf: 0 rtb: 0 nt: 0
[ 180.881347] rcu-torture: Reader Pipe: 2 0 0 0 0 0 0 0 0 0 0
[ 180.881347] rcu-torture: Reader Batch: 2 0 0 0 0 0 0 0 0 0 0
[ 180.881347] rcu-torture: Free-Block Circulation: 0 0 0 0 0 0 0 0 0 0 0
[ 180.881347] ??? Writer stall state 8 g504 c504 f0x0
[ 240.881652] rcu-torture: rtc: c1091f98 ver: 1 tfle: 0 rta: 1 rtaf: 0 rtf: 0 rtmbe: 0 rtbke: 0 rtbre: 0 rtbf: 0 rtb: 0 nt: 1 onoff: 0/0:0/0 -1,0:-1,0
[ 240.881652] rcu-torture: Reader Pipe: 2 0 0 0 0 0 0 0 0 0 0
[ 240.881652] rcu-torture: Reader Batch: 2 0 0 0 0 0 0 0 0 0 0
[ 240.881652] rcu-torture: Free-Block Circulation: 0 0 0 0 0 0 0 0 0 0 0
[ 240.881652] ??? Writer stall state 8 g510 c510 f0x0
[ 301.031066] rcu-torture: rtc: c1091f98 ver: 1 tfle: 0 rta: 1 rtaf: 0 rtf: 0 rtmbe: 0 rtbke: 0 rtbre: 0 rtbf: 0 rtb: 0 nt: 1 onoff: 0/0:0/0 -1,0:-1,0
[ 301.031066] rcu-torture: Reader Pipe: 2 0 0 0 0 0 0 0 0 0 0
[ 301.031066] rcu-torture: Reader Batch: 2 0 0 0 0 0 0 0 0 0 0
[ 301.031066] rcu-torture: Free-Block Circulation: 0 0 0 0 0 0 0 0 0 0 0
[ 301.031066] ??? Writer stall state 8 g512 c512 f0x0
[ 361.110931] rcu-torture: rtc: c1091f98 ver: 1 tfle: 0 rta: 1 rtaf: 0 rtf: 0 rtmbe: 0 rtbke: 0
However that description page itself also confused me as it says:
"It is also possible to specify CONFIG_RCU_TORTURE_TEST=y, which will result in the tests being loaded into the base kernel."
But if above is true, then following commands would fail:
# modprobe rcutorture
and this is the case happened:
root@linaro-developer:~# modprobe rcutorture
modprobe: ERROR: ../libkmod/libkmod.c:557 kmod_search_moddep() could not open moddep file '/lib/modules/3.17.0-rc3-00002-g7505cea/modules.dep.bin'
root@linaro-developer:~#
And "rmmod" also failed there:
root@linaro-developer:~# rmmod rcutorture
rmmod: ERROR: Module rcutorture is builtin.
root@linaro-developer:~#
So here are my questions:
1. In order to enable rcutorture in Kernel but disable its automatic run, what should I do? I looked at the file that description page mentioned, the output is:
root@linaro-developer:~# cat /proc/sys/kernel/rcutorture_runnable
0
root@linaro-developer:~#
I tried to give it "1" but that won't affect the automatic trigger in rcutorture. Looks like the file is useless here.
2. At the end of that description page, it looks like to use the Kernel module to control the test start & end. However if I put "y" to switcher "CONFIG_RCU_TORTURE_TEST", the test will be automatically built into Kernel. So what should I do to let it build to a module which in a way I can control it?
Thank you in advance for any helpful information.
Best Regards
Botao Sun