On Thu, Sep 13, 2018 at 01:29:59PM +0200, David Sterba wrote: > On Wed, Sep 12, 2018 at 12:27:46PM -0700, Liu Bo wrote: > > On Wed, Sep 12, 2018 at 09:37:20AM +0300, Nikolay Borisov wrote: > > > > > > > > > On 12.09.2018 01:06, Liu Bo wrote: > > > > As long as @eb is marked with EXTENT_BUFFER_DIRTY, all of its pages > > > > are dirty, so no need to set pages dirty again. > > > > > > > > Signed-off-by: Liu Bo <bo....@linux.alibaba.com> > > > > > > Does make it any performance difference, numbers? > > > > > > > To be honest, the performance difference would be trivial in a normal > > big test round. But I just looked into the difference from my ftrace, > > removing the loop can reduce the time spent by 10us in my box. > > 10us was for the case where the pages were dirty already and the for > cycle was then skipped? > > set_page_dirty is not lightweight, calls down to various functions and > holds locks. I can't tell if this is still fast enough on your machine > so that it really takes 10us. >
Sorry for not making it clear, on my box 10us was spent in the 'for' loop, which iterates 4 pages and 4 calls for set_page_dirty(). thanks, -liubo > The conditional dirtying is definetelly worth though, > > Reviewed-by: David Sterba <dste...@suse.com>