LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Ricardo Correia <rcorreia@wizy.org>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: How to flush the disk write cache from userspace
Date: Thu, 18 Jan 2007 01:15:54 +0000	[thread overview]
Message-ID: <200701180115.54772.rcorreia@wizy.org> (raw)
In-Reply-To: <20070116003854.GE4067@kernel.dk>

On Tuesday 16 January 2007 00:38, you wrote:
> As always with these things, the devil is in the details. It requires
> the device to support a ->prepare_flush() queue hook, and not all
> devices do that. It will work for IDE/SATA/SCSI, though. In some devices
> you don't want/need to do a real disk flush, it depends on the write
> cache settings, battery backing, etc.

Is there any chance that someone could implement this (I don't have the 
skills, unfortunately)? Maybe add a new ioctl() to block devices, so that it 
doesn't break any existing code?

I believe it's a very useful (and relatively simple) feature that increases 
data integrity and reliability for applications that need this functionality.

I think it must be considered that most people have disk write caches enabled 
and are using IDE, SATA or SCSI disks.

I also think there's no point in disabling disks' write caches, since it slows 
writes and decreases disks' lifetime, and because there's a better solution.

Personally, I'm not really interested in specific filesystem behaviour, since 
my application uses block devices directly (it's a filesystem itself). 
Although I think all filesystems should guarantee data integrity in the face 
of fsync() or metadata modifications, even if it costs a little performance.

Thank you.

  reply	other threads:[~2007-01-18  2:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-14  4:05 Ricardo Correia
2007-01-16  0:38 ` Jens Axboe
2007-01-18  1:15   ` Ricardo Correia [this message]
     [not found] <fa.y+HJNAxqDqX5AHUxcmThAo20Ivo@ifi.uio.no>
     [not found] ` <fa.xbdrjhFpvWMJeTroG2DpPE4wd+M@ifi.uio.no>
     [not found]   ` <fa.lqQRZqIqMX2chyIAM888fc1jCuY@ifi.uio.no>
2007-01-19  0:35     ` Robert Hancock
2007-01-21  3:50       ` Jens Axboe

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=200701180115.54772.rcorreia@wizy.org \
    --to=rcorreia@wizy.org \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: How to flush the disk write cache from userspace' \
    /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

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).