I was assuming that polling would work OK. I expect it would.
Actually, I overdesigned the API, I suspect. What we _could_ do is to
provide a way of allowing userspace to say "pretend process A touched page
B": adopt its mm and go touch the page. We in fact already have that:
PTRACE_PEEKTEXT.
So I suspect this could all be done by polling maps2 and using PEEKTEXT.
The tricky part would be working out when to poll, and when to reestablish.
A neater implementation than PEEKTEXT would be to make the maps2 files
writeable(!) so as a party trick you could tar 'em up and then, when you
want to reestablish firefox's previous working set, do a untar in
/proc/$(pidof firefox)/
-