If a page is marked Copy-on-Write, and I try to write to it inside of a transaction, the transaction aborts. If I know the address at which it aborted, there is a trivial fix:
int v = addr; __sync_bool_compare_and_swap(addr, v, v); // Force CoW.
And then retry the transaction. Again, this only works if I know the cacheline on which the transaction was aborted. Is there a way to find this? Is it in a performance counter or something?