aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python/sched-migration.py
diff options
context:
space:
mode:
authorJinliang Zheng <[email protected]>2025-07-11 08:12:07 +0000
committerChristian Brauner <[email protected]>2025-07-11 09:42:44 +0000
commit177bb4cba97aae951b910d8ca248480715d09009 (patch)
treea176f43b58c601fb08a1795a86ee97e6d9814d5b /tools/perf/scripts/python/sched-migration.py
parentisofs: Verify inode mode when loading from disk (diff)
downloadkernel-177bb4cba97aae951b910d8ca248480715d09009.tar.gz
kernel-177bb4cba97aae951b910d8ca248480715d09009.zip
iomap: avoid unnecessary ifs_set_range_uptodate() with locks
In the buffer write path, iomap_set_range_uptodate() is called every time iomap_end_write() is called. But if folio_test_uptodate() holds, we know that all blocks in this folio are already in the uptodate state, so there is no need to go deep into the critical section of state_lock to execute bitmap_set(). This is because the folios always creep towards ifs_is_fully_uptodate() state and once they've gotten there folio_mark_uptodate() is called, which means the folio is uptodate. Then once a folio is uptodate, there is no route back to !uptodate without going through the removal of the folio from the page cache. Therefore, it's fine to use folio_test_uptodate() to short-circuit unnecessary code paths. Although state_lock may not have significant lock contention due to folio lock, this patch at least reduces the number of instructions, especially the expensive lock-prefixed instructions. Signed-off-by: Jinliang Zheng <[email protected]> Link: https://lore.kernel.org/[email protected] Reviewed-by: Darrick J. Wong <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/sched-migration.py')
0 files changed, 0 insertions, 0 deletions