linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@aol.com>
To: wangyan <wangyan122@huawei.com>
Cc: linux-fsdevel@vger.kernel.org,
	"virtio-fs@redhat.com" <virtio-fs@redhat.com>,
	piaojun <piaojun@huawei.com>
Subject: Re: [QUESTION] A performance problem for buffer write compared with 9p
Date: Thu, 15 Aug 2019 08:56:05 +0800	[thread overview]
Message-ID: <20190815005559.GA14118@hsiangkao-HP-ZHAN-66-Pro-G1> (raw)
In-Reply-To: <5abd7616-5351-761c-0c14-21d511251006@huawei.com>

On Thu, Aug 15, 2019 at 08:30:43AM +0800, wangyan wrote:

[]

> 
> I found that the judgement statement 'if (!TestSetPageDirty(page))' always
> true in function '__set_page_dirty_nobuffers', it will waste much time
> to mark inode dirty, no one page is dirty when write it the second time.
> The buffer write stack:
>     fuse_file_write_iter
>       ->fuse_cache_write_iter
>         ->generic_file_write_iter
>           ->__generic_file_write_iter
>             ->generic_perform_write
>               ->fuse_write_end
>                 ->set_page_dirty
>                   ->__set_page_dirty_nobuffers
> 
> The reason for 'if (!TestSetPageDirty(page))' always true may be the pdflush
> process will clean the page's dirty flags in clear_page_dirty_for_io(),
> and call fuse_writepages_send() to flush all pages to the disk of the host.
> So when the page is written the second time, it always not dirty.
> The pdflush stack for fuse:
>     pdflush
>       ->...
>         ->do_writepages
>           ->fuse_writepages
>             ->write_cache_pages         // will clear all page's dirty flags
>               ->clear_page_dirty_for_io // clear page's dirty flags
>             ->fuse_writepages_send      // write all pages to the host, but
> don't wait the result
> Why not wait for getting the result of writing back pages to the host
> before cleaning all page's dirty flags?
> 

As my understanding, I personally think there's nothing wrong with
the above process from your words above.

Thanks,
Gao Xiang

> As for 9p, pdflush will call clear_page_dirty_for_io() to clean the page's
> dirty flags. Then call p9_client_write() to write the page to the host,
> waiting for the result, and then flush the next page. In this case, buffer
> write of 9p will hit the dirty page many times before it is being write
> back to the host by pdflush process.
> The pdflush stack for 9p:
>     pdflush
>       ->...
>         ->do_writepages
>           ->generic_writepages
>             ->write_cache_pages
>               ->clear_page_dirty_for_io // clear page's dirty flags
>               ->__writepage
>                 ->v9fs_vfs_writepage
>                   ->v9fs_vfs_writepage_locked
>                     ->p9_client_write   // it will get the writing back
> page's result
> 
> 
> According to the test result, is the handling method of 9p for page writing
> back more reasonable than virtiofs?
> 
> Thanks,
> Yan Wang
> 

  reply	other threads:[~2019-08-15  0:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-15  0:30 [QUESTION] A performance problem for buffer write compared with 9p wangyan
2019-08-15  0:56 ` Gao Xiang [this message]
2019-08-20  9:16 ` [Virtio-fs] " Stefan Hajnoczi
2019-08-21  7:51   ` Miklos Szeredi
2019-08-21 16:05     ` Stefan Hajnoczi
2019-08-22  0:59       ` wangyan
2019-08-22 11:43         ` Miklos Szeredi
2019-08-22 12:48           ` wangyan
2019-08-22 13:07             ` Miklos Szeredi
2019-08-22 13:17               ` wangyan
2019-08-22 13:29                 ` Miklos Szeredi
2019-08-22 14:02                   ` Miklos Szeredi
     [not found]                     ` <fd7a2791-d95c-3bd9-e387-b8778a9eca83@huawei.com>
2019-08-26 12:39                       ` Miklos Szeredi
2019-08-28  0:57                         ` wangyan

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=20190815005559.GA14118@hsiangkao-HP-ZHAN-66-Pro-G1 \
    --to=hsiangkao@aol.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=piaojun@huawei.com \
    --cc=virtio-fs@redhat.com \
    --cc=wangyan122@huawei.com \
    /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).