All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Kleikamp <dave.kleikamp@oracle.com>
To: Hugh Dickins <hughd@google.com>
Cc: Jeff Moyer <jmoyer@redhat.com>,
	linux-mm@kvack.org, linux-fsdevel@vger.kernel.org
Subject: Re: O_DIRECT on tmpfs (again)
Date: Wed, 28 Nov 2012 15:32:58 -0600	[thread overview]
Message-ID: <50B6830A.20308@oracle.com> (raw)
In-Reply-To: <alpine.LNX.2.00.1211281248270.14968@eggly.anvils>

On 11/28/2012 03:17 PM, Hugh Dickins wrote:
> On Tue, 27 Nov 2012, Jeff Moyer wrote:
> 
>> Hi Hugh and others,
>>
>> In 2007, there were some discussions on whether to allow opens to
>> specify O_DIRECT for files backed by tmpfs.[1][2] On the surface, it
>> sounds like a completely crazy thing to do.  However, distributions like
>> Fedora are now defaulting to using a tmpfs /tmp.  I'm not aware of any
>> applications that open temp files using O_DIRECT, but I wanted to get
>> some new discussion going on whether this is a reasonable thing to
>> expect to work.
>>
>> Thoughts?
>>
>> Cheers,
>> Jeff
>>
>> [1] https://lkml.org/lkml/2007/1/4/55
>> [2] http://thread.gmane.org/gmane.linux.kernel/482031
> 
> Thanks a lot for refreshing my memory with those links.
> 
> Whilst I agree with every contradictory word I said back then ;)
> my current position is to wait to see what happens with Shaggy's "loop:
> Issue O_DIRECT aio using bio_vec" https://lkml.org/lkml/2012/11/22/847

As the patches exist today, the loop driver will only make the aio calls
if the underlying file defines a direct_IO address op since
generic_file_read/write_iter() will call a_ops->direct_IO() when
O_DIRECT is set. For tmpfs or any other filesystem that doesn't support
O_DIRECT, the loop driver will continue to call the read() or write()
method.

> 
> I've been using loop on tmpfs-file in testing for years, and will not
> allow that to go away.  I've not yet tried applying the patches and
> fixing up mm/shmem.c to suit, but will make sure that it's working
> before a release emerges with those changes in.
> 
> It would be possible to add nominal O_DIRECT support to tmpfs without
> that, and perhaps it would be possible to add that loop support without
> enabling O_DIRECT from userspace; but my inclination is to make those
> changes together.
> 
> (I'm not thinking of doing ramfs and hugetlbfs too.)
> 
> Hugh
> 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2012-11-28 21:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-27 16:03 O_DIRECT on tmpfs (again) Jeff Moyer
2012-11-27 16:03 ` Jeff Moyer
2012-11-28 21:17 ` Hugh Dickins
2012-11-28 21:17   ` Hugh Dickins
2012-11-28 21:32   ` Dave Kleikamp [this message]
2012-11-29 15:23     ` Jeff Moyer
2012-11-30  1:32       ` Hugh Dickins
2012-11-30  1:32         ` Hugh Dickins
2012-11-30 15:01         ` Richard W.M. Jones
2012-11-30 19:39         ` Jeff Moyer

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=50B6830A.20308@oracle.com \
    --to=dave.kleikamp@oracle.com \
    --cc=hughd@google.com \
    --cc=jmoyer@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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.