linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Ted Tso <tytso@mit.edu>
Cc: <linux-ext4@vger.kernel.org>, Jan Kara <jack@suse.cz>
Subject: [PATCH 2/3] ext4: Don't allocate io_end for writeback from ext4_writepage()
Date: Tue, 11 Apr 2017 15:54:17 +0200	[thread overview]
Message-ID: <20170411135418.9638-3-jack@suse.cz> (raw)
In-Reply-To: <20170411135418.9638-1-jack@suse.cz>

ext4_writepage() writes out only mapped buffers with allocated
underlying blocks. Thus there's no need for io_end structure
and we can avoid allocating it.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/ext4/inode.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 4247d8d25687..baa87e7d1426 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2107,16 +2107,8 @@ static int ext4_writepage(struct page *page,
 		return __ext4_journalled_writepage(page, len);
 
 	ext4_io_submit_init(&io_submit, wbc);
-	io_submit.io_end = ext4_init_io_end(inode, GFP_NOFS);
-	if (!io_submit.io_end) {
-		redirty_page_for_writepage(wbc, page);
-		unlock_page(page);
-		return -ENOMEM;
-	}
 	ret = ext4_bio_write_page(&io_submit, page, len, wbc, keep_towrite);
 	ext4_io_submit(&io_submit);
-	/* Drop io_end reference we got from init */
-	ext4_put_io_end_defer(io_submit.io_end);
 	return ret;
 }
 
-- 
2.12.0

  parent reply	other threads:[~2017-04-11 13:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-11 13:54 [PATCH 0/3] ext4: Avoid transaction stalls during writeback Jan Kara
2017-04-11 13:54 ` [PATCH 1/3] ext4: Allow IO submission without io_end Jan Kara
2017-04-30 22:01   ` Theodore Ts'o
2017-04-30 22:30     ` [PATCH -v2] ext4: avoid unnecessary transaction stalls during writeback Theodore Ts'o
2017-05-02 12:10       ` Jan Kara
2017-05-02 14:18         ` Theodore Ts'o
2017-04-11 13:54 ` Jan Kara [this message]
2017-04-11 13:54 ` [PATCH 3/3] ext4: Avoid " Jan Kara
2017-04-11 15:00   ` Amir Goldstein
2017-04-11 16:16     ` Jan Kara
2017-04-30  0:47   ` Theodore Ts'o

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=20170411135418.9638-3-jack@suse.cz \
    --to=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).