lkml.org 
[lkml]   [2019]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 2/2] fuse: Replace page without copying in fuse_writepage_in_flight()
On Mon, Nov 26, 2018 at 10:46 AM Kirill Tkhai <ktkhai@virtuozzo.com> wrote:
>
> 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);

This would mess up refcounting for all pages involved. need to swap
with the temp page in new_req. Fixed version in #for-next.

Thanks,
Miklos

\
 
 \ /
  Last update: 2019-01-15 16:40    [W:0.077 / U:18.236 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site