linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: remove unnecessary bio get/put
@ 2016-03-21 16:15 Jens Axboe
  2016-05-06  2:11 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Jens Axboe @ 2016-03-21 16:15 UTC (permalink / raw)
  To: tytso; +Cc: linux-ext4

Hi Ted,

ext4_io_submit() use to check for EOPNOTSUPP after bio submission,
which is why it had to get an extra reference to the bio before
submitting it. But since we no longer touch the bio after submission,
get rid of the redundant get/put of the bio. If we do get the extra
reference, we enter the slower path of having to flag this bio as now
having external references.

Signed-off-by: Jens Axboe <axboe@fb.com>

diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
index 349d7aa04fe7..a81939236707 100644
--- a/fs/ext4/page-io.c
+++ b/fs/ext4/page-io.c
@@ -351,9 +351,7 @@ void ext4_io_submit(struct ext4_io_submit *io)
 	if (bio) {
 		int io_op = io->io_wbc->sync_mode == WB_SYNC_ALL ?
 			    WRITE_SYNC : WRITE;
-		bio_get(io->io_bio);
 		submit_bio(io_op, io->io_bio);
-		bio_put(io->io_bio);
 	}
 	io->io_bio = NULL;
 }

-- 
Jens Axboe


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ext4: remove unnecessary bio get/put
  2016-03-21 16:15 [PATCH] ext4: remove unnecessary bio get/put Jens Axboe
@ 2016-05-06  2:11 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2016-05-06  2:11 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-ext4

On Mon, Mar 21, 2016 at 10:15:23AM -0600, Jens Axboe wrote:
> 
> ext4_io_submit() use to check for EOPNOTSUPP after bio submission,
> which is why it had to get an extra reference to the bio before
> submitting it. But since we no longer touch the bio after submission,
> get rid of the redundant get/put of the bio. If we do get the extra
> reference, we enter the slower path of having to flag this bio as now
> having external references.
> 
> Signed-off-by: Jens Axboe <axboe@fb.com>

Jens, thanks for pointing this out.  I've applied this to the ext4.git
tree.

					- Ted

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-06  2:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-21 16:15 [PATCH] ext4: remove unnecessary bio get/put Jens Axboe
2016-05-06  2:11 ` Theodore Ts'o

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).