On Wed, Jul 20, 2022 at 05:53:19PM -0400, Peter Xu wrote: > void clear_refs_write(void) > { > int fd = open("/proc/self/clear_refs", O_RDWR); > > assert(fd >= 0); > write(fd, "4", 2); > close(fd); > } > Oops, git dropped some of the lines starting with "#".. Let me retry, sorry. > bool dirty = pagemap_read_vaddr(fd, page) & PM_SOFT_DIRTY; \ > if (dirty != expect) { \ > printf("ERROR: %s, soft-dirty=%d (expect: %d)\n", str, dirty, expect); \ > exit(-1); \ > } \ > } while (0) -- Peter Xu