|
From: Rafael F. <raf...@gm...> - 2012-04-18 04:15:02
|
Hi, I just had the idea to extend an existing tool (or write a new tool) which helps identifying false sharing. I imagine it keeping track of memory allocations and tracking where false sharing occurs. It should output a nice callstack for a pair of threads that do a write/write and write/read on the same cache line. Furthermore, it would be helpful to know the frequency of the writes and reads for the cache lines experiencing false sharing. A configuration option would be the cache line size. I am willing to spend some time working on this but I need to get familiar with the valgrind source code first. Has this idea been proposed before? Is it feasible using the current valgrind architecture? Should this be new tool or part of memcheck or helgrind? Cheers, Rafael -- Rafael E. Fernández B.S. Computer Science University of Illinois at Urbana-Champaign |
|
From: Julian S. <js...@ac...> - 2012-04-18 07:52:43
|
Callgrind can maybe do something like this? I am not sure. JosefW might know more. At least in principle it is feasible to build a tool like this (I believe, anyway). Cachegrind and Callgrind contain code to autodetect cache parameters, so you don't necessarily need to specify line size on the command line. J On Wednesday, April 18, 2012, Rafael Fernandez wrote: > Hi, > > I just had the idea to extend an existing tool (or write a new tool) which > helps identifying false sharing. I imagine it keeping track of memory > allocations and tracking where false sharing occurs. It should output a > nice callstack for a pair of threads that do a write/write and write/read > on the same cache line. Furthermore, it would be helpful to know the > frequency of the writes and reads for the cache lines experiencing false > sharing. A configuration option would be the cache line size. I am willing > to spend some time working on this but I need to get familiar with the > valgrind source code first. Has this idea been proposed before? Is it > feasible using the current valgrind architecture? Should this be new tool > or part of memcheck or helgrind? > > Cheers, > Rafael |