All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Y. Ts'o" <tytso@mit.edu>
To: Jan Kara <jack@suse.cz>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH] ext4: Avoid unnecessary transaction starts during writeback
Date: Thu, 28 May 2020 23:19:25 -0400	[thread overview]
Message-ID: <20200529031925.GL228632@mit.edu> (raw)
In-Reply-To: <20200525081215.29451-1-jack@suse.cz>

On Mon, May 25, 2020 at 10:12:15AM +0200, Jan Kara wrote:
> ext4_writepages() currently works in a loop like:
>   start a transaction
>   scan inode for pages to write
>   map and submit these pages
>   stop the transaction
> 
> This loop results in starting transaction once more than is needed
> because in the last iteration we start a transaction only to scan the
> inode and find there are no pages to write. This can be significant
> increase in number of transaction starts for single-extent files or
> files that have all blocks already mapped. Furthermore we already know
> from previous iteration whether there are more pages to write or not. So
> propagate the information from mpage_prepare_extent_to_map() and avoid
> unnecessary looping in case there are no more pages to write.
> 
> Signed-off-by: Jan Kara <jack@suse.cz>

Thanks, applied.  I like how it shrinks the source file.  :-)

		    	     		- Ted

      reply	other threads:[~2020-05-29  3:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-25  8:12 [PATCH] ext4: Avoid unnecessary transaction starts during writeback Jan Kara
2020-05-29  3:19 ` Theodore Y. Ts'o [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200529031925.GL228632@mit.edu \
    --to=tytso@mit.edu \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.