I've implemented a basic Linux kernel module with /proc.
It can add elements to the linked list with echo add number > /proc/list
and remove elements from the list with echo remove number > /proc/list
. I've added spin_lock
and spin_unlock
around all critical sections (adding and removing elements elements from the list).
How can I check that the spinlocks are working correctly? I've tried making 2 scripts, one for adding elements and the other one for removing, and then executing them simultaneously with ./script1.sh & ./script2.sh
. But the result is the same with and without spinlocks.