* Getting 'sync' to flush disk cache?
@ 2006-08-14 18:39 Jeff Garzik
2006-08-14 19:34 ` Arjan van de Ven
0 siblings, 1 reply; 6+ messages in thread
From: Jeff Garzik @ 2006-08-14 18:39 UTC (permalink / raw)
To: Jens Axboe, Linux Kernel
Cc: Andrew Morton, SCSI Mailing List, Linux RAID Mailing List
So... has anybody given any thought to enabling fsync(2), fdatasync(2),
and sync_file_range(2) issuing a [FLUSH|SYNCHRONIZE] CACHE command?
This has bugged me for _years_, that Linux does not do this. Looking at
forums on the web, it bugs a lot of other people too.
My suggestion would be to add a FLUSH op alongside the existing READ and
WRITE[_SYNC] ops, rather than passing down WRITE_SYNC. Why? Doing so
maintains a 1-1 translation between requests and disk commands, and it
would allow MD and DM more flexibility in handling this operation.
But that's just a guess. I'm open to suggestions.
Jeff
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Getting 'sync' to flush disk cache?
2006-08-14 18:39 Jeff Garzik
@ 2006-08-14 19:34 ` Arjan van de Ven
2006-08-14 20:15 ` Jens Axboe
0 siblings, 1 reply; 6+ messages in thread
From: Arjan van de Ven @ 2006-08-14 19:34 UTC (permalink / raw)
To: Jeff Garzik
Cc: Jens Axboe, Linux Kernel, Andrew Morton, SCSI Mailing List,
Linux RAID Mailing List
On Mon, 2006-08-14 at 14:39 -0400, Jeff Garzik wrote:
> So... has anybody given any thought to enabling fsync(2), fdatasync(2),
> and sync_file_range(2) issuing a [FLUSH|SYNCHRONIZE] CACHE command?
>
> This has bugged me for _years_, that Linux does not do this. Looking at
> forums on the web, it bugs a lot of other people too.
eh afaik 2.6.17 and such do this if you have barriers enabled...
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Getting 'sync' to flush disk cache?
2006-08-14 19:34 ` Arjan van de Ven
@ 2006-08-14 20:15 ` Jens Axboe
2006-08-14 21:04 ` Jeff Garzik
0 siblings, 1 reply; 6+ messages in thread
From: Jens Axboe @ 2006-08-14 20:15 UTC (permalink / raw)
To: Arjan van de Ven
Cc: Jeff Garzik, Linux Kernel, Andrew Morton, SCSI Mailing List,
Linux RAID Mailing List
On Mon, Aug 14 2006, Arjan van de Ven wrote:
> On Mon, 2006-08-14 at 14:39 -0400, Jeff Garzik wrote:
> > So... has anybody given any thought to enabling fsync(2), fdatasync(2),
> > and sync_file_range(2) issuing a [FLUSH|SYNCHRONIZE] CACHE command?
> >
> > This has bugged me for _years_, that Linux does not do this. Looking at
> > forums on the web, it bugs a lot of other people too.
>
> eh afaik 2.6.17 and such do this if you have barriers enabled...
That is correct, but it only works on reiserfs and XFS and user space
really cannot tell whether it did the right thing or not. File system
developers really should take this more seriously...
--
Jens Axboe
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Getting 'sync' to flush disk cache?
2006-08-14 20:15 ` Jens Axboe
@ 2006-08-14 21:04 ` Jeff Garzik
0 siblings, 0 replies; 6+ messages in thread
From: Jeff Garzik @ 2006-08-14 21:04 UTC (permalink / raw)
To: Jens Axboe
Cc: Arjan van de Ven, Linux Kernel, Andrew Morton, SCSI Mailing List,
Linux RAID Mailing List
Jens Axboe wrote:
> On Mon, Aug 14 2006, Arjan van de Ven wrote:
>> On Mon, 2006-08-14 at 14:39 -0400, Jeff Garzik wrote:
>>> So... has anybody given any thought to enabling fsync(2), fdatasync(2),
>>> and sync_file_range(2) issuing a [FLUSH|SYNCHRONIZE] CACHE command?
>>>
>>> This has bugged me for _years_, that Linux does not do this. Looking at
>>> forums on the web, it bugs a lot of other people too.
>> eh afaik 2.6.17 and such do this if you have barriers enabled...
>
> That is correct, but it only works on reiserfs and XFS and user space
> really cannot tell whether it did the right thing or not. File system
> developers really should take this more seriously...
IMO the non-journalling fs's should have some sort of common fsync
helper via sync_inode(), sync_mapping_buffers(), and similar paths...
Should be able get a bunch of fs's in one big swath that way.
Jeff
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Getting 'sync' to flush disk cache?
[not found] ` <fa.PWNfC1odploxRBgLE1vdR69UF9s@ifi.uio.no>
@ 2006-08-14 23:09 ` Robert Hancock
2006-08-15 5:45 ` Jens Axboe
0 siblings, 1 reply; 6+ messages in thread
From: Robert Hancock @ 2006-08-14 23:09 UTC (permalink / raw)
To: Jens Axboe, linux-kernel; +Cc: Arjan van de Ven
Jens Axboe wrote:
> On Mon, Aug 14 2006, Arjan van de Ven wrote:
>> On Mon, 2006-08-14 at 14:39 -0400, Jeff Garzik wrote:
>>> So... has anybody given any thought to enabling fsync(2), fdatasync(2),
>>> and sync_file_range(2) issuing a [FLUSH|SYNCHRONIZE] CACHE command?
>>>
>>> This has bugged me for _years_, that Linux does not do this. Looking at
>>> forums on the web, it bugs a lot of other people too.
>> eh afaik 2.6.17 and such do this if you have barriers enabled...
>
> That is correct, but it only works on reiserfs and XFS and user space
> really cannot tell whether it did the right thing or not. File system
> developers really should take this more seriously...
>
I was under the impression that this just worked under recent kernels.
I'm disappointed to hear that it doesn't. It always annoys me that
issues like this sometimes just seem to stick around forever in the
kernel without getting the attention they should (and tend not to be
well documented either..)
--
Robert Hancock Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Getting 'sync' to flush disk cache?
2006-08-14 23:09 ` Getting 'sync' to flush disk cache? Robert Hancock
@ 2006-08-15 5:45 ` Jens Axboe
0 siblings, 0 replies; 6+ messages in thread
From: Jens Axboe @ 2006-08-15 5:45 UTC (permalink / raw)
To: Robert Hancock; +Cc: linux-kernel, Arjan van de Ven
On Mon, Aug 14 2006, Robert Hancock wrote:
> Jens Axboe wrote:
> >On Mon, Aug 14 2006, Arjan van de Ven wrote:
> >>On Mon, 2006-08-14 at 14:39 -0400, Jeff Garzik wrote:
> >>>So... has anybody given any thought to enabling fsync(2), fdatasync(2),
> >>>and sync_file_range(2) issuing a [FLUSH|SYNCHRONIZE] CACHE command?
> >>>
> >>>This has bugged me for _years_, that Linux does not do this. Looking at
> >>>forums on the web, it bugs a lot of other people too.
> >>eh afaik 2.6.17 and such do this if you have barriers enabled...
> >
> >That is correct, but it only works on reiserfs and XFS and user space
> >really cannot tell whether it did the right thing or not. File system
> >developers really should take this more seriously...
> >
>
> I was under the impression that this just worked under recent kernels.
> I'm disappointed to hear that it doesn't. It always annoys me that
> issues like this sometimes just seem to stick around forever in the
> kernel without getting the attention they should (and tend not to be
> well documented either..)
It is an embarassment that it doesn't just work. For the longest time,
it seemed nobody really cared about it enough to get it fixed. At least
now it's gathering a bit of momentum.
--
Jens Axboe
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-08-15 5:43 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <fa.W0uMWcngieRXsM23OSdM5c2wdZI@ifi.uio.no>
[not found] ` <fa.qZ/OWlxPTq6xK9TZx+9e39itX9k@ifi.uio.no>
[not found] ` <fa.PWNfC1odploxRBgLE1vdR69UF9s@ifi.uio.no>
2006-08-14 23:09 ` Getting 'sync' to flush disk cache? Robert Hancock
2006-08-15 5:45 ` Jens Axboe
2006-08-14 18:39 Jeff Garzik
2006-08-14 19:34 ` Arjan van de Ven
2006-08-14 20:15 ` Jens Axboe
2006-08-14 21:04 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox