[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Yth7kPbqiJcIy5Rs@xz-m1.local>
Date: Wed, 20 Jul 2022 18:02:56 -0400
From: Peter Xu <peterx@...hat.com>
To: linux-mm@...ck.org, linux-kernel@...r.kernel.org
Cc: David Hildenbrand <david@...hat.com>,
Nadav Amit <nadav.amit@...il.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] mm/mprotect: Fix soft-dirty check in
can_change_pte_writable()
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
Powered by blists - more mailing lists