All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Catherine Ho <catherine.hecx@gmail.com>
Cc: virtio-fs@redhat.com,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH v2] virtiofsd/passthrough_ll: don't remove O_DIRECT when cache=none
Date: Thu, 30 Apr 2020 09:35:43 +0100	[thread overview]
Message-ID: <20200430083543.GB160930@stefanha-x1.localdomain> (raw)
In-Reply-To: <1586594144-24605-1-git-send-email-catherine.hecx@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1452 bytes --]

On Sat, Apr 11, 2020 at 04:35:44AM -0400, Catherine Ho wrote:
> @@ -1702,10 +1703,11 @@ static void update_open_flags(int writeback, struct fuse_file_info *fi)
>  
>      /*
>       * O_DIRECT in guest should not necessarily mean bypassing page
> -     * cache on host as well. If somebody needs that behavior, it
> -     * probably should be a configuration knob in daemon.
> +     * cache on host as well. If cache=none, keep the flag unchanged
>       */
> -    fi->flags &= ~O_DIRECT;
> +    if (cache_mode != CACHE_NONE) {
> +        fi->flags &= ~O_DIRECT;
> +    }
>  }
>  

Thanks for the patch!  I have CCed the virtio-fs mailing list so more
people see it.

Please add a new command-line option to control O_DIRECT behavior.

There are two cases:

1. O_DIRECT bypasses the guest page cache but not the host page cache.
   This makes sense when the DAX feature is enabled.

2. O_DIRECT bypasses both the guest and host page cache.  This make
   sense for non-DAX and for I/O performance benchmarking.

Today only #1 is supported.

Your patch makes the behavior dependent on the cache mode option, but
the cache mode doesn't necessarily determine how O_DIRECT should be
handled.  For example, in the DAX case the guest page cache is bypassed
and cache=none can be used, but we do want to use the host page cache.

You can add a new option so that O_DIRECT handling is configurable for
all cases.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Catherine Ho <catherine.hecx@gmail.com>
Cc: virtio-fs@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Virtio-fs] [PATCH v2] virtiofsd/passthrough_ll: don't remove O_DIRECT when cache=none
Date: Thu, 30 Apr 2020 09:35:43 +0100	[thread overview]
Message-ID: <20200430083543.GB160930@stefanha-x1.localdomain> (raw)
In-Reply-To: <1586594144-24605-1-git-send-email-catherine.hecx@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1452 bytes --]

On Sat, Apr 11, 2020 at 04:35:44AM -0400, Catherine Ho wrote:
> @@ -1702,10 +1703,11 @@ static void update_open_flags(int writeback, struct fuse_file_info *fi)
>  
>      /*
>       * O_DIRECT in guest should not necessarily mean bypassing page
> -     * cache on host as well. If somebody needs that behavior, it
> -     * probably should be a configuration knob in daemon.
> +     * cache on host as well. If cache=none, keep the flag unchanged
>       */
> -    fi->flags &= ~O_DIRECT;
> +    if (cache_mode != CACHE_NONE) {
> +        fi->flags &= ~O_DIRECT;
> +    }
>  }
>  

Thanks for the patch!  I have CCed the virtio-fs mailing list so more
people see it.

Please add a new command-line option to control O_DIRECT behavior.

There are two cases:

1. O_DIRECT bypasses the guest page cache but not the host page cache.
   This makes sense when the DAX feature is enabled.

2. O_DIRECT bypasses both the guest and host page cache.  This make
   sense for non-DAX and for I/O performance benchmarking.

Today only #1 is supported.

Your patch makes the behavior dependent on the cache mode option, but
the cache mode doesn't necessarily determine how O_DIRECT should be
handled.  For example, in the DAX case the guest page cache is bypassed
and cache=none can be used, but we do want to use the host page cache.

You can add a new option so that O_DIRECT handling is configurable for
all cases.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2020-04-30  8:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-11  6:19 [PATCH] virtiofsd/passthrough_ll: don't remove O_DIRECT when cache=none Catherine Ho
2020-04-11  8:35 ` [PATCH v2] " Catherine Ho
2020-04-21  1:55   ` Catherine Ho
2020-04-30  8:35   ` Stefan Hajnoczi [this message]
2020-04-30  8:35     ` [Virtio-fs] " Stefan Hajnoczi

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=20200430083543.GB160930@stefanha-x1.localdomain \
    --to=stefanha@redhat.com \
    --cc=catherine.hecx@gmail.com \
    --cc=dgilbert@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=virtio-fs@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.