On Wednesday 03 December 2014 19:51:58 Botao Sun wrote:
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:
- 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:
Just a few side nodes about the procedure for you (and anyone else reading this) to consider, as you are being somewhat inefficient here, although you are not doing anything wrong:
$ git clone https://kernel.googlesource.com/pub/scm/linux/kernel/git/arm/arm-soc.git
My recommendation is to never clone kernel trees multiple times, to save time and network bandwidth. Just use a single kernel tree as a work area, and use multiple remotes (see "man git remote").
The above could have been
$ cd linux $ git remote add arm-soc https://kernel.googlesource.com/pub/scm/linux/kernel/git/arm/arm-soc.git $ git fetch arm-soc $ git checkout -b arm-soc arm-soc/for-next
The last step actually checks out the branch you want. The master branch of this particular tree is not meaningful at all, we don't use it.
$ cp arch/arm/configs/omap2plus_defconfig ./ Add above 3 switchers $ mv omap2plus_defconfig .config
I normally use a separate build directory for housekeeping purposes, so just add "O=obj-arm-soc" to ever "make" invocation and create an "obj-arm-soc" directory in which you will find the output.
You can use 'alias armsocmake="make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- O=obj-arm-soc"' to create an armsocmake shortcut for this, and you can have one such command per output directory, e.g. for testing both omap2plus_defconfig and multi_v7_defconfig simultaneously.
Instead of copying the defconfig file, just run 'armsocmake omap2plus_defconfig'.
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig Once the graphic window shows, select exit then answer "Yes" to save.
I sometimes find it hard to find the right options in menuconfig, and then I edit the obj-arm-soc/.config file with my favorite text editor to remove the current defaults, and run 'armsocmake oldconfig' to pick the new options.
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- LOADADDR=0x80008000 uImage
I would recommend against using uImage, in particular because of the awkward LOADADDR handling. If your u-boot is new enough, you can boot the zImage file directly.
$ 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.
The defconfig file is really only meant as the input to 'make omap2plus_defconfig', and it only contains the options that are not defaults. Running 'armsocmake savedefconfig'
- Flash SD card with Linaro ubuntu build 697:
http://snapshots.linaro.org/ubuntu/pre-built/panda/697
Replace uImage and omap4-panda.dtb to the ones I compiled locally.
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
Ok, so I suppose this means that you have found a serious bug, and now it's time to fix that. Anything else is of lower priority at this point.
What I think the message indicates is that you have hit a stall in the rcutorture writer process for the RTWS_STUTTER test.
[ 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:~#
Your module installation seems wrong, did you run 'make modules_install' on the target drive?
So here are my questions:
- 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.
I think part of your problem is that you have the rcutorture test built-in. The design of this test is based around the idea that it gets run when you load the module, however when you build it into the kernel, it will get run automatically at boot time.
- 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?
Set it to 'm'.
Arnd