Re: nfs question - ftruncate vs pwrite
- From: Kenny Simpson <theonetruekenny@xxxxxxxxx>
- Date: Wed, 7 Dec 2005 13:50:40 -0800 (PST)
--- Peter Staubach <staubach@xxxxxxxxxx> wrote:
> You might use tcpdump or etherreal to see what the different traffic looks
> like. I suspect that ftruncate() leads a SETATTR operation while pwrite()
> leads to a WRITE operation.
Ethereal results interpreted with wild speculation:
The pwrite case:
This does a bunch of reads, but the server always returns a short read responding with EOF. It
seems that a pwrite does cause a getattr call, but that's it.
Once memory is exhausted, the pages are written out.
The ftruncate case:
This does a setattr, then does a read - this time the server responds with a large amount of
0's.
Since this is using the buffer cache (not opened with O_DIRECT), and since we know we are
extending the file... is it strictly necessary to read in pages of 0's from the server?
-Kenny
__________________________________________
Yahoo! DSL ? Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: nfs question - ftruncate vs pwrite
- From: Trond Myklebust
- Re: nfs question - ftruncate vs pwrite
- References:
- Re: nfs question - ftruncate vs pwrite
- From: Peter Staubach
- Re: nfs question - ftruncate vs pwrite
- Prev by Date: Re: Linux in a binary world... a doomsday scenario
- Next by Date: Re: 2.4.32 Oops in scsi_dispatch_cmd
- Previous by thread: Re: nfs question - ftruncate vs pwrite
- Next by thread: Re: nfs question - ftruncate vs pwrite
- Index(es):
Relevant Pages
|