linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Vivek Goyal <vgoyal@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Miklos Szeredi <miklos@szeredi.hu>, Qian Cai <cai@lca.pw>,
	Hugh Dickins <hughd@google.com>,
	Matthew Wilcox <willy@infradead.org>,
	"Kirill A . Shutemov" <kirill@shutemov.name>,
	Linux-MM <linux-mm@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Amir Goldstein <amir73il@gmail.com>
Subject: Re: Possible deadlock in fuse write path (Was: Re: [PATCH 0/4] Some more lock_page work..)
Date: Sat, 17 Oct 2020 10:03:29 +1100	[thread overview]
Message-ID: <20201016230329.GC7322@dread.disaster.area> (raw)
In-Reply-To: <20201016181908.GA282856@redhat.com>

On Fri, Oct 16, 2020 at 02:19:08PM -0400, Vivek Goyal wrote:
> On Thu, Oct 15, 2020 at 02:21:58PM -0700, Linus Torvalds wrote:
> 
> [..]
> > 
> > I don't know why fuse does multiple pages to begin with. Why can't it
> > do whatever it does just one page at a time?
> 
> Sending multiple pages in single WRITE command does seem to help a lot
> with performance. I modified code to write only one page at a time
> and ran a fio job with sequential writes(and random writes),
> block size 64K and compared the performance on virtiofs.
> 
> NAME                    WORKLOAD                Bandwidth       IOPS
> one-page-write          seqwrite-psync          58.3mb          933
> multi-page-write        seqwrite-psync          265.7mb         4251
> 
> one-page-write          randwrite-psync         53.5mb          856
> multi-page-write        randwrite-psync         315.5mb         5047
> 
> So with multi page writes performance seems much better for this
> particular workload.

Huh. This is essentially the problem the iomap buffered write path
was designed to solve.  Filesystems like gfs2 got similar major
improvements in large buffered write throughput when switching to
use iomap for buffered IO....

Essentially, it works by having iomap_apply() first ask the
filesystem to map the IO range, then iterates the page cache across
the io range performing the desired operation (iomap_write_actor()
in the case of a buffered write), then it tells the filesystem how
much of the original range it completed copying into the cache.

Hence the filesystem only does one mapping/completion operation per
contiguous IO range instead of once per dirtied page, and the inner
loop just locks a page at a time as it works over the range.  Pages
are marked uptodate+dirty as the user data is copied into them, not
when the entire IO is completely written.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com


      parent reply	other threads:[~2020-10-16 23:03 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-13 19:59 [PATCH 0/4] Some more lock_page work Linus Torvalds
2020-10-13 20:03 ` Linus Torvalds
2020-10-14 13:05   ` Kirill A. Shutemov
2020-10-14 16:53     ` Linus Torvalds
2020-10-14 18:15       ` Matthew Wilcox
2020-10-15 10:41         ` Kirill A. Shutemov
2020-10-15  9:43       ` Kirill A. Shutemov
2020-10-15 16:44         ` Linus Torvalds
2020-10-14  5:50 ` Hugh Dickins
     [not found] ` <4794a3fa3742a5e84fb0f934944204b55730829b.camel@lca.pw>
2020-10-15  2:44   ` Linus Torvalds
2020-10-15 15:16     ` Possible deadlock in fuse write path (Was: Re: [PATCH 0/4] Some more lock_page work..) Vivek Goyal
2020-10-15 19:55       ` Vivek Goyal
2020-10-15 21:21         ` Linus Torvalds
2020-10-16 10:02           ` Miklos Szeredi
2020-10-16 12:27             ` Matthew Wilcox
2020-10-20 20:42             ` Vivek Goyal
2020-10-21  7:40               ` Miklos Szeredi
2020-10-21 20:12                 ` Vivek Goyal
2020-10-28 20:29                   ` Miklos Szeredi
2021-02-09 10:01                     ` Miklos Szeredi
2021-02-09 19:09                       ` Vivek Goyal
2020-10-16 18:19           ` Vivek Goyal
2020-10-16 18:24             ` Linus Torvalds
2020-10-16 18:24               ` Linus Torvalds
2020-10-16 23:03             ` Dave Chinner [this message]

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=20201016230329.GC7322@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=akpm@linux-foundation.org \
    --cc=amir73il@gmail.com \
    --cc=cai@lca.pw \
    --cc=hughd@google.com \
    --cc=kirill@shutemov.name \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=miklos@szeredi.hu \
    --cc=torvalds@linux-foundation.org \
    --cc=vgoyal@redhat.com \
    --cc=willy@infradead.org \
    --subject='Re: Possible deadlock in fuse write path (Was: Re: [PATCH 0/4] Some more lock_page work..)' \
    /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

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