The patch titled Subject: mm/filemap.c: rewrite mapping_needs_writeback in less fancy manner has been added to the -mm tree. Its filename is mm-filemap-rewrite-mapping_needs_writeback-in-less-fancy-manner.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-filemap-rewrite-mapping_needs_writeback-in-less-fancy-manner.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-filemap-rewrite-mapping_needs_writeback-in-less-fancy-manner.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Konstantin Khlebnikov <khlebnikov@xxxxxxxxxxxxxx> Subject: mm/filemap.c: rewrite mapping_needs_writeback in less fancy manner This actually checks that writeback is needed or in progress. Link: http://lkml.kernel.org/r/156378817069.1087.1302816672037672488.stgit@buzz Signed-off-by: Konstantin Khlebnikov <khlebnikov@xxxxxxxxxxxxxx> Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Cc: Tejun Heo <tj@xxxxxxxxxx> Cc: Jens Axboe <axboe@xxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/filemap.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/mm/filemap.c~mm-filemap-rewrite-mapping_needs_writeback-in-less-fancy-manner +++ a/mm/filemap.c @@ -617,10 +617,13 @@ int filemap_fdatawait_keep_errors(struct } EXPORT_SYMBOL(filemap_fdatawait_keep_errors); +/* Returns true if writeback might be needed or already in progress. */ static bool mapping_needs_writeback(struct address_space *mapping) { - return (!dax_mapping(mapping) && mapping->nrpages) || - (dax_mapping(mapping) && mapping->nrexceptional); + if (dax_mapping(mapping)) + return mapping->nrexceptional; + + return mapping->nrpages; } int filemap_write_and_wait(struct address_space *mapping) _ Patches currently in -mm which might be from khlebnikov@xxxxxxxxxxxxxx are mm-filemap-rewrite-mapping_needs_writeback-in-less-fancy-manner.patch mm-filemap-dont-initiate-writeback-if-mapping-has-no-dirty-pages.patch