]> git.baikalelectronics.ru Git - kernel.git/commit
mm: Account dirty folios properly during splits
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 29 Jun 2022 00:15:29 +0000 (20:15 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 29 Jun 2022 12:49:43 +0000 (08:49 -0400)
commit9e349ef4080b9716ab398a60e7749506aeef1cc6
tree2fffeceec685ebba8d5fbd83d5d89b3b605e189b
parent2ee6cc074b06df644cd5e7cfc9c8f9588655d95d
mm: Account dirty folios properly during splits

If the last folio in a file is split as a result of truncation,
we simply clear the dirty bits for the pages we're discarding.
That causes NR_FILE_DIRTY (among other counters) to be thrown off
and eventually Linux will hang in balance_dirty_pages_ratelimited()

Reported-by: Dave Chinner <dchinner@redhat.com>
Tested-by: Dave Chinner <dchinner@redhat.com>
Tested-by: Darrick J. Wong <djwong@kernel.org>
Fixes: 65476e358aca ("mm/filemap: Allow large folios to be added to the page cache")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
mm/huge_memory.c