linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Steve French" <smfrench@gmail.com>
To: "Jeff Layton" <jlayton@redhat.com>
Cc: "Nick Piggin" <npiggin@suse.de>,
	"Dave Kleikamp" <shaggy@linux.vnet.ibm.com>,
	pbadari@us.ibm.com, linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	"linux-cifs-client@lists.samba.org"
	<linux-cifs-client@lists.samba.org>
Subject: Re: fsx-linux failing with latest cifs-2.6 git tree
Date: Fri, 21 Nov 2008 20:02:14 -0600	[thread overview]
Message-ID: <524f69650811211802x74c0cadaided4c09f6c9e790e@mail.gmail.com> (raw)
In-Reply-To: <20081121205151.1e3a09fe@tleilax.poochiereds.net>

On Fri, Nov 21, 2008 at 7:51 PM, Jeff Layton <jlayton@redhat.com> wrote:
> On Sat, 22 Nov 2008 00:53:46 +0100
> Nick Piggin <npiggin@suse.de> wrote:
>
>> On Fri, Nov 21, 2008 at 05:50:17PM -0500, Jeff Layton wrote:
>> > On Fri, 21 Nov 2008 14:38:18 -0600
>> > "Steve French" <smfrench@gmail.com> wrote:
>> >
>> > > Fix attached.
>> > >
>> > > Shaggy/Jeff/Nick etc. do you want to review/ack it since it is late in the rc?
>> > >
>> >
>> > Talking with Steve on IRC, we thought it might be better to optimize
>> > away the read when possible. I think this patch should do it. We skip
>> > the read if the write starts past the current end of the file, or if
>> > the offset into the page of the beginning of the write is 0 and we're
>> > writing past the current end of the file. In those situations we just
>> > zero out the rest of the page.
>> >
>> > Combined patch inlined below. I also took the liberty of adding a page
>> > pointer to make the code look a little cleaner.
>> >
>> > Thoughts?
>>
>> You just have to be very careful when marking a page uptodate. This
>> is why I removed that earlier hunk.
>>
>> 1) the actual write may not cover as much space as we were told here.
>
> Under what circumstances would that occur? The places where write_begin
> and write_end get called look like they use the same lengths...
>
>> 2) the page no wlooks like this I think?
>>
>> 0                       offset+len          PAGE_CACHE_SIZE
>> |---- uninitialized data ---|---- zeroes ---|
>>
>> Then if you SetPageUptodate, if you are using the generic_mapping_read,
>> it can come and read the page even without locking it. If you are
>> not using the generic pagecache operations at all, then you could do
>> something like this if you are careful, but it still seems a bit
>> risky.
>>
>> Or am I wrong about the data being uninitialized?
>
> Bear with me here -- page flag handling makes me dizzy...
>
> The latest patch that I sent only skips the read if:
>
> 1) the page lies beyond the current end of the file
>
> 2) if the page sits on top of the end of the file and the write would
> overwrite all of the data that we would read in.
>
> The first part should be OK I think. A pagecache read should not be
> able to go beyond EOF, should it? The second one is a problem. Ideally
> we'd like to be able to get away w/o doing a read in that case, but I
> guess we'd have to delay setting the page uptodate until after the
> write data has been copied to it. cifs_write_end seems to expect
> that the page is uptodate when it gets it though.
If cifs_write_end gets a page that is not uptodate (e.g. if we don't
have readaccess to the file) then it could be really slowww ...
because write end will have to send each write to the server
individually (even if the app is only 1 byte at a time) ... I don't
mind threads racing with each other doing reads/writes as long as they
get valid data ... but wish we could mark them up to date when we
finish copying the write data into them so it wouldn't be so slow

But ... we also need to be checking to make sure we can cache reads
(at least) since otherwise we could have an i_size that is up to 1
second old


Thanks,

Steve

  reply	other threads:[~2008-11-22  2:02 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 [this message]
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
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=524f69650811211802x74c0cadaided4c09f6c9e790e@mail.gmail.com \
    --to=smfrench@gmail.com \
    --cc=jlayton@redhat.com \
    --cc=linux-cifs-client@lists.samba.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=npiggin@suse.de \
    --cc=pbadari@us.ibm.com \
    --cc=shaggy@linux.vnet.ibm.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).