fs: dlm: initial commit of locktorture
Alexander Aring
maintainerRFC 1/1 fs: dlm: initial commit of locktorture
This patch will introduce a locktorture test for DLM subsystem. The idea is to have a torture test to proof some performance indication for DLM. This torture test will allocate for each writer a DLM lock and try to acquire the lock as much as it can. In a homogeneous cluster (all nodes have equal hardware) other nodes try to acquire those locks as well. As I have some local patches to improve the DLM network handling I can notice a higher value report number of lock acquire.
How I test on a three cluster setup (1, 2, 3):
run "modprobe dlm_locktorture cluster_name=$CLUSTER_NAME"
in order of node id 1, 2, 3. The order seems to be important as I think it will declare the master of all locks on node 1. Ignore the first reported value because it was recorded on setup. With my local network improvements patch I get follow values:
50421-25950 = 24471
74888-50421 = 24467
99394-74888 = 24506
123878-99394 = 24484
without the changes:
49835-25879 = 23956
73800-49835 = 23965
97635-73800 = 23835
121527-97635 = 23892
Note that the stats will always report the total numbers of lock acquire. That's why $TOTAL_NUM - $TOTAL_NUM_PREV = $INTERVAL_NUM
I repeated this benchmark test and get always identical values, if I setup it in order as noticed above. As you can see the difference is about 500 more lock acquire with my patches during the default testing interval of 60 seconds.
May the improvement is only under load, may it will benefit on long time runs only. However this is a initial commit to provide something like that for DLM, when new features/improvements will be added it might worth to test it with dlm locktorture. Also I did not add every lock mode which is possible in DLM e.g. rw locks. I removed the is_held warning from the original implementation, this only works if we have it stored in a shared memory "thing" of all nodes. I think there are a lot of improvements, I did not implement everything yet.
--- fs/dlm/Kconfig | 16 ++ fs/dlm/Makefile | 1 + fs/dlm/dlm_locktorture.c | 548 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 565 insertions(+) create mode 100644 fs/dlm/dlm_locktorture.c
fs/dlm/Kconfig +16 -0
@@ -16,3 +16,19 @@ config DLM_DEBUG Under the debugfs mount point, the name of each lockspace will appear as a file in the "dlm" directory. The output is the list of resource and locks the local node knows about. + +config DLM_LOCKTORTURE + tristate "DLM locktorture" + depends on DLM + select TORTURE_TEST + help + This options provides a kernel module that runs torture tests on + the DLM subsystem. If loaded on a homogeneous cluster setup (e.g. + all cluster nodes have the same architecture) it will run + concurrent lock and unlock procedures. The printed stats will show + how many lock acquire was possible. + + Please never use Y for this module as it requires a working cluster + manager at loading time. + Say M if you want the DLM lock torture tests to be build as a module. + Say N if you are unsure.
fs/dlm/Makefile +1 -0
@@ -19,4 +19,5 @@ dlm-y := ast.o \ user.o \ util.o dlm-$(CONFIG_DLM_DEBUG) += debug_fs.o +obj-$(CONFIG_DLM_LOCKTORTURE) += dlm_locktorture.o
fs/dlm/dlm_locktorture.c new file +548 -0
548 lines not on this page · raw message
Signature · 1 line
2.27.0