]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: skip set_page_dirty if eb pages are already dirty
authorLiu Bo <bo.liu@linux.alibaba.com>
Thu, 13 Sep 2018 17:44:42 +0000 (01:44 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 15 Oct 2018 15:23:31 +0000 (17:23 +0200)
commit834e3a82b846aa8afb12852131c0a203abfa862e
tree3fadcf36a6e3770833520651cfd2141520144e57
parent589d1e70ebf311ded9e2b5e4e544d28ef80cec20
Btrfs: skip set_page_dirty if eb pages are already dirty

As long as @eb is marked with EXTENT_BUFFER_DIRTY, all of its pages
are dirty, so no need to set pages dirty again.

Ftrace showed that the loop took 10us on my dev box, so removing this
can save us at least 10us if eb is already dirty and otherwise avoid a
potentially expensive calls to set_page_dirty.

Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c
fs/btrfs/extent_io.h