When I create a copy-on-write mapping (a MAP_PRIVATE) using mmap, then some pages of this mapping will be copied as soon as I write to specific addresses. At a certain point
It is not easy, but possible to determine this. In order to find out whether a page is a copy of another page (possibly another process's) then you need to do the following (recentish kernels):
You can then determine that two pages are actually the same page, in memory.
It is fairly tricky to do this, you need to be root, and whatever you do will probably have some race conditions in it, but it is possible.