Re: [PATCH net V4 2/2] igb: offer a PTP Hardware Clock instead of the timecompare method
From: chetan loke <hidden>
Date: 2012-03-27 21:55:20
On Tue, Mar 27, 2012 at 4:58 PM, Keller, Jacob E [off-list ref] wrote:
I think we could see contention regardless because the spinlock doesn't guarantee the ordering of who gets it next. I am not sure. But I will try and set something like this up. However, I do think that many get-set calls is pretty high for even a 'highly' loaded system. Though the buggy app for sure is possible. Here is what I am thinking as a test case. Linuxptp running normally with a higher sync rate than once per second, plus a 'buggy' app which will try to infinitely thread the gettime calls. I hope to have something like this working soon.
Agreed, we don't know who would grab the lock next. But with just one app/process we may not be able to induce the contention because process scheduling would come into play. A single process would only get that much time slice. With multiple processes, you will be able to schedule them on multiple CPUs and hence contend with the driver's completion path because that is what a real-exploit would do. make sure numactl is installed on your system. Within a shell script, launch multiple instances of the process as follows: #!/bin/bash num_cpus=`cat /proc/cpuinfo |grep -i processor |wc -l` for ((i=0; i<$num_cpus; i++)) do echo "Launching instance:$(($i+1))" numa_cmd="numactl --physcpubind=$i /path/to/buggy-app &" echo "executing numa-cmd:$numa_cmd" eval $numa_cmd done
- Jake
Chetan