linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kirill Tkhai <ktkhai@virtuozzo.com>
To: miklos@szeredi.hu, ktkhai@virtuozzo.com,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] fuse: Replace page without copying in fuse_writepage_in_flight()
Date: Mon, 26 Nov 2018 12:46:20 +0300	[thread overview]
Message-ID: <154322557765.18737.14337090699283695815.stgit@localhost.localdomain> (raw)
In-Reply-To: <154322517208.18737.3297786654135648324.stgit@localhost.localdomain>

It looks like we can optimize old_req page replacement
and avoid copying by simple updating the request's page.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 fs/fuse/file.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index c6650c68b31a..83b54b082c86 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1778,7 +1778,7 @@ static bool fuse_writepage_in_flight(struct fuse_req *new_req,
 	if (old_req->num_pages == 1 && old_req != first_req) {
 		struct backing_dev_info *bdi = inode_to_bdi(page->mapping->host);
 
-		copy_highpage(old_req->pages[0], page);
+		swap(old_req->pages[0], page);
 		spin_unlock(&fc->lock);
 
 		dec_wb_stat(&bdi->wb, WB_WRITEBACK);


  reply	other threads:[~2018-11-26  9:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-26  9:46 [PATCH 1/2] fuse: Fix race in fuse_writepage_in_flight() Kirill Tkhai
2018-11-26  9:46 ` Kirill Tkhai [this message]
2019-01-15 15:39   ` [PATCH 2/2] fuse: Replace page without copying " Miklos Szeredi
2019-01-15 16:14     ` Kirill Tkhai
2019-01-15 16:36       ` Miklos Szeredi
2019-01-15 16:38         ` Kirill Tkhai
2019-01-10 10:48 ` [PATCH 1/2] fuse: Fix race " Kirill Tkhai
2019-01-10 11:00   ` Miklos Szeredi
2019-01-10 11:03     ` Kirill Tkhai
2019-01-15 15:37       ` Miklos Szeredi
2019-01-15 15:55         ` Kirill Tkhai
2019-01-15 16:03           ` Miklos Szeredi
2019-01-15 16:05             ` Kirill Tkhai

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=154322557765.18737.14337090699283695815.stgit@localhost.localdomain \
    --to=ktkhai@virtuozzo.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /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).