I have a memory page for which I used mmap to map it to flash in a userspace linux program (written in c). Currently, the memory is written to very infrequently (say once a day), so I'm fine.
If, however, someone down the road modifies the code to do frequent writes to this memory, they could cause premature flash failure. I'd like to have the code self-policing, and have it detect if it's being abused, and if so take some appropriate actions.
I'm wondering if it's possible to monitor the write access to a page in memory.