linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: "Jarzmik, Robert" <robert.jarzmik@intel.com>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Subject: Re: fuse, readpage and readahead
Date: Tue, 5 Feb 2013 15:11:44 +0100	[thread overview]
Message-ID: <CAJfpegvsPdZWaOHe7J3+wBTuvyNnGy_ZN8hfaRfYFkiJ-t4fDA@mail.gmail.com> (raw)
In-Reply-To: <65F5F98566038744B1B43C8FD3B7549F1863F72B@IRSMSX104.ger.corp.intel.com>

On Wed, Nov 28, 2012 at 5:55 PM, Jarzmik, Robert
<robert.jarzmik@intel.com> wrote:
> Hi Miklos,
>
> I would like to understand the "synchronous" aspect of fuse readahead.
> The usecase I have is :
>  - /sdcard is the FUSE mounted FS relying on /data, which is an ext4
>    Filesystem on /dev/block/mmcblk0p1
>  - one process is reading an mp3 file from a FUSE filesystem backed by
>    a local ext4 system
>    aplay /sdcard/Music/ElvisIsBack.mp3
>  - another process is : dd if=/dev/zero of=/data/hog1
>
> In my test, I came across the following scenario recently :
>
> filemap_fault()
> ...
>   do_generic_file_read()
>     page_cache_async_readahead()
>       ondemand_readahead()
>         __do_page_cache_readahead()
>           read_pages()
>             fuse_readpages()
>               fuse_request_send() => takes around 500ms
>
> Here, fuse_request_send() will block as long as no reponse comes back
> from the backing fuse (which is a local ext4 system). Correct me if
> I'm wrong, but the synchronous fuse_request_send() is chosen on file
> basis.
>
> The effect is that in filemap_fault() path, the process is blocked
> for 500ms in my scenario, waiting for the readahead to complete,
> while the first pagecache was succesfully found (I have an Ftrace
> which tells me so). Therefore, I have a small audio glitch.
>
> My question is : is this the expected behaviour, ie. that read-ahead
> blocks the filemap fault path ? If this was already discussed before,
> could you please give me a link to the discussion ?

Readahead is asynchronous by default.  Synchronous mode may be forced
with "-osync_read".  See
linux/fs/fuse/file.c:fuse_send_readpages().

Thanks,
Miklos
>

  reply	other threads:[~2013-02-05 14:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-28 16:55 fuse, readpage and readahead Jarzmik, Robert
2013-02-05 14:11 ` Miklos Szeredi [this message]
2013-02-27 14:54   ` Jarzmik, Robert

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=CAJfpegvsPdZWaOHe7J3+wBTuvyNnGy_ZN8hfaRfYFkiJ-t4fDA@mail.gmail.com \
    --to=miklos@szeredi.hu \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=robert.jarzmik@intel.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).