summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@gmail.com>2026-10-05 08:31:06 +0900
committerViacheslav Dubeyko <slava@dubeyko.com>2026-10-05 10:12:54 -0700
commitd4dfe010220320801fc97ae7a6befa3aaf4cb2d1 (patch)
tree7997e6450f1af4afee567bc4bc299fe785c085a3 /tools/perf/scripts/python/stackcollapse.py
parent7131aaa74bcc7c9da1f1d1c8724da75c775557a0 (diff)
downloadlinux-d4dfe010220320801fc97ae7a6befa3aaf4cb2d1.tar.gz
linux-d4dfe010220320801fc97ae7a6befa3aaf4cb2d1.zip
nilfs2: simplify nilfs_mdt_writeback()
The writepages() callback for metadata files, nilfs_mdt_writeback(), calls nilfs_mdt_write_folio() for each dirty folio via writeback_iter(), where read-only superblock checks, folio dirty state clearing on error, and triggering of the log writer via nilfs_construct_segment() are performed. This helper function is used nowhere else. Executing these operations per folio is inefficient: - Checking if the filesystem has fallen back to read-only mode is repeated redundantly. - Calling nilfs_construct_segment() inside the per-folio loop causes redundant log writer invocations for a single sync request, where only the first invocation performs actual log writing. Unfold nilfs_mdt_write_folio() into nilfs_mdt_writeback() and consolidate these operations at the function level. The read-only check is moved to the top of nilfs_mdt_writeback(), replacing per-folio nilfs_clear_folio_dirty() calls with a single nilfs_clear_dirty_pages() call to discard dirty pages across the mapping at once. Additionally, nilfs_construct_segment() is invoked once when 'sync_mode' is WB_SYNC_ALL and the mapping is tagged dirty. With these operations consolidated outside the loop, the remaining per-folio actions (calling folio_redirty_for_writepage() on already dirty folios and unlocking them) serve no purpose, so the folio iteration itself is removed. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com> Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions