All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: linux@horizon.com
Cc: miklos@szeredi.hu, linux-kernel@vger.kernel.org,
	linux-mm@vger.kernel.org
Subject: Re: [patch resend v4] update ctime and mtime for mmaped write
Date: Tue, 27 Mar 2007 12:34:22 -0700	[thread overview]
Message-ID: <20070327123422.d0bbc064.akpm@linux-foundation.org> (raw)
In-Reply-To: <20070327192452.26486.qmail@science.horizon.com>

On 27 Mar 2007 15:24:52 -0400
linux@horizon.com wrote:

> > * MS_ASYNC does not start I/O (it used to, up to 2.5.67).
> 
> Yes, I noticed.  See
> http://www.ussg.iu.edu/hypermail/linux/kernel/0602.1/0450.html
> for a bug report on the subject February 2006.

Suggest you use msync(MS_ASYNC), then
sync_file_range(SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE).

The new (post 2.6.17) MAP_SHARED dirty-page semantics mean that the msync()
isn't actually needed.

> That's why this application is still running on 2.4.
> 
> As I mentioned at the time, the SUS says:
> (http://opengroup.org/onlinepubs/007908799/xsh/msync.html)
> "When MS_ASYNC is specified, msync() returns immediately once all the
> write operations are initiated or queued for servicing."
> 
> You can argue that putting it on the dirty list constitutes "queued for
> servicing", but the intent seems pretty clear to me: MS_ASYNC is supposed
> to start the I/O.  Although strict standards-ese parsing says that
> either branch of an or is acceptable, it is a common English language
> convention that the first alternative is preferred and the second
> is a fallback.
> 
> It makes sense in this case: start the write or, if that's not possible
> (the disk is already busy), queue it for service as soon as the disk
> is available.
> 
> They perhaps didn't mandate it this strictly, but that's clearly the
> intent.

We can fix your application, and we'll break someone else's.

I don't think it's solveable, really - the range of applications is so
broad, and the "standard" is so vague as to be useless.  This is why we've
been extending these things with linux-specific goodies which permit
applications to actually tell the kernel what they want to be done in a
more finely-grained fashion.

  reply	other threads:[~2007-03-27 19:34 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-27 18:42 [patch resend v4] update ctime and mtime for mmaped write linux
2007-03-27 18:55 ` Miklos Szeredi
2007-03-27 19:00   ` Miklos Szeredi
2007-03-27 19:05   ` Andrew Morton
2007-03-27 19:24   ` linux
2007-03-27 19:34     ` Andrew Morton [this message]
2007-03-27 20:09       ` linux
2007-03-27 20:09         ` linux
2007-03-27 20:31         ` Miklos Szeredi
2007-03-27 20:31           ` Miklos Szeredi
2007-03-28  1:48           ` linux
2007-03-28  1:48             ` linux
2007-03-28  7:58             ` Nick Piggin
2007-03-28  7:58               ` Nick Piggin
2007-03-28  9:50               ` linux
2007-03-28  9:50                 ` linux
2007-03-29  4:59                 ` Nick Piggin
2007-03-29  4:59                   ` Nick Piggin
2007-03-27 20:47         ` Andrew Morton
2007-03-27 20:47           ` Andrew Morton
  -- strict thread matches above, loose matches on Subject: below --
2007-03-25 21:10 Miklos Szeredi
2007-03-25 21:10 ` Miklos Szeredi, Miklos Szeredi
2007-03-26 21:00 ` Andrew Morton
2007-03-26 21:00   ` Andrew Morton
2007-03-26 21:10   ` Matt Mackall
2007-03-26 21:10     ` Matt Mackall
2007-03-26 22:25     ` Andrew Morton
2007-03-26 22:25       ` Andrew Morton
2007-03-26 21:43   ` Miklos Szeredi
2007-03-26 21:43     ` Miklos Szeredi
2007-03-26 22:31     ` Andrew Morton
2007-03-26 22:31       ` Andrew Morton
2007-03-27  6:55       ` Miklos Szeredi
2007-03-27  6:55         ` Miklos Szeredi
2007-03-27  7:22         ` Andrew Morton
2007-03-27  7:22           ` Andrew Morton
2007-03-27  7:36           ` Miklos Szeredi
2007-03-27  7:36             ` Miklos Szeredi
2007-03-27  7:49             ` Andrew Morton
2007-03-27  7:49               ` Andrew Morton
2007-03-27  8:03               ` Miklos Szeredi
2007-03-27  8:03                 ` Miklos Szeredi
2007-03-27  8:18                 ` Andrew Morton
2007-03-27  8:18                   ` Andrew Morton
2007-03-27  8:28                   ` Miklos Szeredi
2007-03-27  8:28                     ` Miklos Szeredi
2007-03-27  8:51                     ` Andrew Morton
2007-03-27  8:51                       ` Andrew Morton
2007-03-27  9:23                       ` Miklos Szeredi
2007-03-27  9:23                         ` Miklos Szeredi
2007-03-27 17:52                         ` Andrew Morton
2007-03-27 17:52                           ` Andrew Morton
2007-03-27 18:29                           ` Miklos Szeredi
2007-03-27 18:29                             ` Miklos Szeredi

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=20070327123422.d0bbc064.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@vger.kernel.org \
    --cc=linux@horizon.com \
    --cc=miklos@szeredi.hu \
    /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.