Thread (65 messages) 65 messages, 8 authors, 2021-10-13

Re: [PATCH v2 1/2] mm, thp: check page mapping when truncating page cache

From: Song Liu <song@kernel.org>
Date: 2021-09-28 17:00:06
Also in: lkml

On Tue, Sep 28, 2021 at 5:07 AM Matthew Wilcox [off-list ref] wrote:
On Mon, Sep 27, 2021 at 03:24:47PM -0700, Song Liu wrote:
quoted
OTOH, does it make sense to block writes within khugepaged, like:
@@ -1652,6 +1653,11 @@ static void collapse_file(struct mm_struct *mm,
        /* Only allocate from the target node */
        gfp = alloc_hugepage_khugepaged_gfpmask() | __GFP_THISNODE;

+       if (deny_write_access(file)) {
+               result = SCAN_BUSY_WRITE;
+               return;
+       }
The problem is that it denies, rather than blocking.  That means that the
writer gets ETXTBSY instead of waiting until khugepaged is done.
Yes, I was thinking about the same problem last night and this morning.
Unfortunately, I haven't got a good solution yet. Do you have some
suggestions on this?

Thanks,
Song
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help