All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Scholz <steven.scholz@imc-berlin.de>
To: Tejun Heo <htejun@gmail.com>
Cc: linux-ide@vger.kernel.org
Subject: Re: when are buffers/caches flushed?
Date: Thu, 18 Aug 2005 13:34:01 +0200	[thread overview]
Message-ID: <43047229.7010007@imc-berlin.de> (raw)
In-Reply-To: <43046FD2.4080401@gmail.com>

Tejun Heo wrote:

> Steven Scholz wrote:
> 
>> Hi there,
>>
>> According to an (old) man page of sync(2)
>>
>>        According to  the  standard  specification  (e.g.,  SVID),
>>        sync()  schedules  the  writes,  but may return before the
>>        actual writing is done.   However,  since  version  1.3.20
>>        Linux  does actually wait.  (This still does not guarantee
>>        data integrity: modern disks have large caches.)
>>
>> How about recent kernels? Does sync() block until buffers are flushed?
>> How can I find out if the disk caches are actually flushed?
>>
>> I want to make sure that all data is flushed to my disk drive before 
>> powering down the system.
>>
>> Thanks.
>>
> 
>  All disk caches are flushed before shutdown via the following path.
> 
> kernel/sys.c::sys_reboot()
> kernel/drivers/base/power/shutdown.c::device_shutdown()
>  driver specific ->shutdown callback, for ide disks, the path is
> drivers/ide/ide-disk.c::ide_device_shutdown()
> drivers/ide/ide-disk.c::ide_cacheflush_p()
> drivers/ide/ide-disk.c::do_idedisk_flushcache()
> 
>  And, AFAIK, sync() doesn't flush disk caches.

How about umount?

--
Steven




-- 
Steven Scholz

imc Measurement & Control               imc Meßsysteme GmbH
Voltastr. 5                             Voltastr. 5
13355 Berlin                            13355 Berlin
Germany                                 Deutschland

  reply	other threads:[~2005-08-18 11:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-18 10:51 when are buffers/caches flushed? Steven Scholz
2005-08-18 11:24 ` Tejun Heo
2005-08-18 11:34   ` Steven Scholz [this message]
2005-08-18 11:59     ` Tejun Heo
2005-08-18 12:12       ` Steven Scholz
2005-08-18 12:19         ` Tejun Heo
2005-08-18 12:24       ` Bartlomiej Zolnierkiewicz
2005-08-18 12:44         ` Tejun Heo
2005-08-18 13:03           ` Bartlomiej Zolnierkiewicz

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=43047229.7010007@imc-berlin.de \
    --to=steven.scholz@imc-berlin.de \
    --cc=htejun@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.