|Summary:||page based watchpoints|
|Product:||frysk||Reporter:||Andrew Cagney <cagney>|
|Bug Depends on:||1496|
Description Andrew Cagney 2005-10-29 04:31:35 UTC
Comment 1 Wu Zhou 2006-03-15 14:47:07 UTC
Andrew, What is page based watchpoints mainly used for? And how to implement that in the kernel? Go through some check statement at every page access attempts? When the number of this kind of watchpoints goes high, the performance might be impacted. Nevertheless, there won't be too much this kinds of watchpoints I believe.
Comment 2 Andrew Cagney 2006-05-05 18:22:44 UTC
Whu, The underlying problem is that a CPU's hardware watchpoint mechanism is a very very limited resource. Typically only 1-4 elements can be watched and that limits things to just a few small variables. Page based watchpoints, on the other hand, do not have that limitation - arbitrary memory areas can be monitored for accesses by disabling memory accesses on a page boundary. Against that is the need to juggle things when a page access does occure - the access may not be to the protected variable; and that, as you note, adds additional overhead. However: at least the restriction of only 1-4 watchpoints is removed; and it is more efficient than single-stepping all instructions looking for a faulting access. The kernel requirement would be a mechanism for disabling|enabling access to specific memory pages; possibly on a per thread basis.