linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Jeff Layton <jlayton@redhat.com>
Cc: Steve French <smfrench@gmail.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	pbadari@us.ibm.com,
	"linux-cifs-client@lists.samba.org"
	<linux-cifs-client@lists.samba.org>
Subject: Re: [linux-cifs-client] Re: fsx-linux failing with latest cifs-2.6 git tree
Date: Wed, 26 Nov 2008 16:23:32 +0100	[thread overview]
Message-ID: <20081126152332.GA23539@wotan.suse.de> (raw)
In-Reply-To: <20081126100857.63e4b45d@tleilax.poochiereds.net>

On Wed, Nov 26, 2008 at 10:08:57AM -0500, Jeff Layton wrote:
> On Wed, 26 Nov 2008 14:09:43 +0100
> Nick Piggin <npiggin@suse.de> wrote:
> 
> 
> > As to why it can happen, because copy_from_user could take a page fault
> > on the app's source address (eg. to write(2)).
> 
> Yep, I figured this out after stumbling across the LWN article.
> 
> > You _might_ be OK there, but it's not a great idea to SetPageUptodate
> > first ;) Aside from the problem of the short-copy, SetPageUptodate
> > actually has a memory barrier in it to ensure the data stored into the
> > page to bring it uptodate is actually visible before the PageUptodate
> > flag is. Again, if you are doing DMAs rather than cache coherent stores
> > to initialise the page, maybe you can get away without that barrier...
> > But it's just bad practice.
> > 
> 
> Gotcha. I think the current patch takes care of this (we're using
> PageChecked to indicate that the uninitialized parts of the page were
> written to).
> 
> The problem I suppose is that we could end up getting a short write in
> write_end. I guess this means that we need to modify the patch a bit
> further and only set PageUptodate in write_end if copied == len.
> 
> > > Given that I now understand what AOP_FLAG_UNINTERRUPTIBLE is supposed
> > > to do, this patch is probably what we need. Running tests on it now.
> > 
> > That seems pretty reasonable, although keep in mind that
> > AOP_FLAG_UNINTERRUPTIBLE is not going to be the common case (unless
> > you're running loop or nfsd or something on the filesystem).
> > 
> > It would be really nice to figure out a way to avoid the reads in
> > the interruptible case as well.
> 
> True. For now though I think we need to start with slow and safe and see
> if we can optimize it further later...

Yes definitely. Thanks for cleaning up my mess!

 
> > I can't remember the CIFS code very well, but in several of the new
> > aops conversions I did, I added something like a BUG_ON(!PageUptodate())
> > in the write_end methods to ensure I wasn't missing some key part of
> > the logic. It's entirely possible that cifs is almost ready to handle
> > a !uptodate page in write_end...
> 
> Well, CIFS is "special". Rather than just updating the pagecache, we
> can fall back to doing a sync write instead. So I don't think we want
> to BUG if the page isn't up to date. It's not ideal, but I think it's a
> situation we can deal with if necessary.

Yes, that would be better. That sync write fallback is quite clever I
think...


  reply	other threads:[~2008-11-26 15:23 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20081121105613.09a8cb8e@tleilax.poochiereds.net>
     [not found] ` <524f69650811210820s549de2bah3181cbc0c5633091@mail.gmail.com>
     [not found]   ` <20081121112249.0b408b55@tleilax.poochiereds.net>
     [not found]     ` <524f69650811210846q7502fd99m6f4d335bb6ac1b65@mail.gmail.com>
     [not found]       ` <524f69650811211109w659e5decoa34a8e0f907772a3@mail.gmail.com>
     [not found]         ` <524f69650811211113q4fffcc70of88cb85db531c358@mail.gmail.com>
     [not found]           ` <1227296476.20845.8.camel@norville.austin.ibm.com>
     [not found]             ` <524f69650811211218v78295682lcf6dce842327b097@mail.gmail.com>
2008-11-21 20:38               ` Fwd: fsx-linux failing with latest cifs-2.6 git tree Steve French
2008-11-21 20:41                 ` Dave Kleikamp
2008-11-21 21:02                   ` Steve French
2008-11-21 23:44                   ` Nick Piggin
2008-11-21 20:50                 ` Jeff Layton
2008-11-21 22:50                 ` Jeff Layton
2008-11-21 23:02                   ` Dave Kleikamp
2008-11-21 23:25                     ` Jeff Layton
2008-11-22  1:04                       ` Steve French
2008-11-22  1:50                         ` Jeff Layton
2008-11-21 23:53                   ` Nick Piggin
2008-11-22  1:51                     ` Jeff Layton
2008-11-22  2:02                       ` Steve French
2008-11-22  4:47                         ` Dave Kleikamp
2008-11-22 15:39                           ` [linux-cifs-client] " Jeff Layton
2008-11-22 20:27                             ` Dave Kleikamp
2008-11-23 11:57                               ` Jeff Layton
2008-11-24  2:32                                 ` Steve French
2008-11-24 11:19                                   ` [linux-cifs-client] " Jeff Layton
2008-11-26  4:04                                     ` Steve French
2008-11-26 11:54                                       ` Jeff Layton
2008-11-26 12:11                                       ` Jeff Layton
2008-11-26 13:09                                         ` [linux-cifs-client] " Nick Piggin
2008-11-26 15:08                                           ` Jeff Layton
2008-11-26 15:23                                             ` Nick Piggin [this message]
2008-11-26 16:37                                               ` Jeff Layton
2008-11-27  8:33                                                 ` Nick Piggin
2008-11-28 12:18                                                   ` Jeff Layton
2008-11-30 21:44                                                     ` Steve French
2008-11-30 22:17                                                       ` Jeff Layton
2008-12-01  8:44                                                         ` Nick Piggin
2008-12-01 11:28                                                           ` Jeff Layton
2008-12-01 11:32                                                             ` Nick Piggin
2008-12-01 11:55                                                               ` Jeff Layton
2008-12-01 17:43                                                                 ` Steve French
2008-11-26 19:46                                               ` Steve French
2008-11-24 20:00                                 ` Dave Kleikamp
2008-11-26 13:02                       ` Nick Piggin

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=20081126152332.GA23539@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=jlayton@redhat.com \
    --cc=linux-cifs-client@lists.samba.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=pbadari@us.ibm.com \
    --cc=smfrench@gmail.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).