mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: linux@horizon.com
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org, linux@horizon.com, sct@redhat.com
Subject: Re: msync() behaviour broken for MS_ASYNC, revert patch?
Date: 9 Feb 2006 06:18:46 -0500	[thread overview]
Message-ID: <20060209111846.13934.qmail@science.horizon.com> (raw)
In-Reply-To: <20060209001850.18ca135f.akpm@osdl.org>

> So you're saying that doing the I/O in that 25-100msec window allowed your
> app to do more pipelining.

Specifically, it allowed it to never block and have fast response times.

That's just the nature of two-phase commit: there's a period during
which your application doesn't know if the commit is durable or not.
But once your code supports having that time window, you can do a full
sliding window and avoid blocking on the completion of a transaction
that's not a prerequisite to the current one.

> I think for most scenarios, what we have in 2.6 is better: it gives the app
> more control over when the I/O should be started.  But not for you, because
> you have this handy 25-100ms window in which to do other stuff, which
> eliminates the need to create a new thread to do the I/O.

Er... I fail to see how "push the dirty bit from internal level 1 to
internal level 2" gives the app any control.  If the system is paging at
all, the page replacement algorithm will eventially notice a dirty page
that isn't being dirtied any more and clean it.  So the 2.6 behaviour
changes one unknown and indefinite timeout to another unknown and
indefinite timeout.  "Start (or, fo the disk is busy, queue) the I/O"
means it will be written out ASAP, basically as fast as a synchronous
write would do it, but without blocking.  That's somewhat definite.

(I say "basically" because a scheduler that gives priority to synchronous
I/O is not unreasonable.  But any delay should be due to the disk being
busy getting useful I/O done.)


I don't quite understand your point about the thread.  Yes, the work to do
is not strictly serialized, so some of it can be started before knowing
the result of the most recently committed transaction.  That's why I
want to do a split-transaction write: start writing at t1, do everything
that does not depend on the write, then wait for completion from t2..t3.
The idea is that an adequate t2-t1 will result in a very short t3-t2,
becuase the I/O latency is t3-t1.

It's the existence of msync(MS_ASYNC) that eliminates the need to create
a new thread to do the I/O, not the nature of the work.  It's the nature
of the work that provides the opportunity to take advantage of overlapped
I/O, which wants a thread or some other form of synchronous I/O.


> Something like this?   (Needs a triple-check).

Um, yes, thanks for the patch, except that I happen to think they should
be called msync(buf, len, MS_ASYNC) and msync(buf, len, MS_SYNC).
The current, not terribly useful, behaviour is adequately covered by
msync(buf, len, 0).  That can be documented as "propagate the dirty
bits from the process' virtual address space to the file system buffer,
where it will be treated just like write(2) data: it will be written out
by the usual timer or can be written out by functions such as fsync().
Without using msync(), an fsync() call is not guaranteed to notice the
change."  I don't know if there's an implicit msync(buf, len, 0) when
an address space is destroyed, but that would be good to document, too.

And, while I certainly don't mean to discourage kernel improvements,
my immediate problem is to find a solution (a "workaround", at least)
that works on 2.6.x, where x <= 15.

I thought with msync(), I had found something that was both efficient
and portable.  Wishful thinking, it seems...


Anyway, thanks for the response!

  parent reply	other threads:[~2006-02-09 11:18 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-09  7:18 linux
2006-02-09  8:18 ` Andrew Morton
2006-02-09  8:35   ` Nick Piggin
2006-02-09  8:42     ` Andrew Morton
2006-02-09 12:38       ` Nick Piggin
2006-02-09 12:39       ` Nick Piggin
2006-02-09 17:48         ` Andrew Morton
2006-02-10  3:36           ` Nick Piggin
2006-02-10  3:50             ` Andrew Morton
2006-02-10  3:57               ` Nick Piggin
2006-02-10  4:13                 ` Andrew Morton
2006-02-10  4:30                   ` Nick Piggin
2006-02-10  4:43                     ` Andrew Morton
2006-02-10  4:52                       ` Nick Piggin
2006-02-10  5:13                         ` Andrew Morton
2006-02-10  5:29                           ` Nick Piggin
2006-02-10  5:50                             ` Andrew Morton
2006-02-10  6:03                               ` Nick Piggin
2006-02-10  6:13                                 ` Andrew Morton
2006-02-10  6:31                                   ` Nick Piggin
2006-02-10  6:46                                     ` Andrew Morton
2006-02-10  6:57                                       ` Nick Piggin
2006-02-10  7:14                                         ` Andrew Morton
2006-02-10 12:41                                           ` Nick Piggin
2006-02-10 16:19                                             ` Linus Torvalds
2006-02-10 17:00                                               ` Nick Piggin
2006-02-10 17:12                                                 ` Linus Torvalds
2006-02-10 17:35                                                   ` Linus Torvalds
2006-02-10 17:59                                                   ` Nick Piggin
2006-02-10 18:55                                                     ` Linus Torvalds
2006-02-10 19:29                                                       ` Nick Piggin
2006-02-10 19:44                                                         ` Linus Torvalds
2006-02-10 19:52                                                           ` Nick Piggin
2006-02-10 20:03                                                             ` Linus Torvalds
2006-02-11  5:49                                                               ` Nick Piggin
2006-02-10 16:05                                         ` Linus Torvalds
2006-02-10 16:37                                           ` Nick Piggin
2006-02-10 17:03                                             ` Linus Torvalds
2006-02-10 17:37                                               ` Nick Piggin
2006-02-10 18:01                                                 ` Linus Torvalds
2006-02-10 18:38                                                   ` Nick Piggin
2006-02-10 19:05                                                     ` Linus Torvalds
2006-02-10 19:34                                                       ` Oliver Neukum
2006-02-10 19:59                                                         ` Linus Torvalds
2006-02-10 20:11                                                           ` Andrew Morton
2006-02-10 21:15                                                             ` Linus Torvalds
2006-02-10 21:28                                                               ` Andrew Morton
2006-02-10 20:03                                                       ` Nick Piggin
2006-02-10 21:10                                                         ` Linus Torvalds
2006-02-10 21:55                                                           ` Trond Myklebust
2006-02-10 22:46                                                             ` Linus Torvalds
2006-02-10 23:02                                                               ` Trond Myklebust
2006-02-10 23:15                                                                 ` Linus Torvalds
2006-02-11 19:07                                                                   ` Trond Myklebust
2006-02-10 17:29                                           ` linux
2006-02-10 17:42                                             ` Linus Torvalds
2006-02-10 18:57                                               ` Nick Piggin
2006-02-10  8:00                                       ` linux
2006-02-10 13:18                                         ` Nick Piggin
2006-02-10  7:15                   ` linux
2006-02-10  7:28                     ` Andrew Morton
2006-02-09 11:18   ` linux [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-03-31 22:16 Stephen C. Tweedie
2004-03-31 22:37 ` Linus Torvalds
2004-03-31 23:41   ` Stephen C. Tweedie
2004-04-01  0:08     ` Linus Torvalds
2004-04-01  0:30       ` Andrew Morton
2004-04-01 15:40       ` Stephen C. Tweedie
2004-04-01 16:02         ` Linus Torvalds
2004-04-01 16:33           ` Stephen C. Tweedie
2004-04-01 16:19         ` Jamie Lokier
2004-04-01 16:57           ` Stephen C. Tweedie
2004-04-01 18:51         ` Andrew Morton
2004-03-31 22:53 ` Andrew Morton
2004-03-31 23:20   ` Stephen C. Tweedie
2004-04-16 22:35 ` Jamie Lokier
2004-04-19 21:54   ` Stephen C. Tweedie
2004-04-21  2:10     ` Jamie Lokier
2004-04-21  9:52       ` Stephen C. Tweedie

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=20060209111846.13934.qmail@science.horizon.com \
    --to=linux@horizon.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sct@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®