a neat trick i found for reusing physical memory

23 points by signal-11


aengelke

I'm wondering about use cases for lazily duplicating large non-zero-initialized memory areas (preferably some where this complexity is worth the performance gains).

For multi-threaded programs where performance is important, CoW pages should carefully be not read before being written, otherwise there will be expensive TLB shootdowns due to the change of the physical address. CoW can be nice for small things but unfortunately doesn't scale well.