From: "Stephen C. Tweedie" <sct@redhat.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-mm <linux-mm@kvack.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Ulrich Drepper <drepper@redhat.com>,
Linus Torvalds <torvalds@osdl.org>,
Stephen Tweedie <sct@redhat.com>
Subject: Re: msync() behaviour broken for MS_ASYNC, revert patch?
Date: 01 Apr 2004 00:20:21 +0100 [thread overview]
Message-ID: <1080775221.1991.91.camel@sisko.scot.redhat.com> (raw)
In-Reply-To: <20040331145352.23df0831.akpm@osdl.org>
Hi,
On Wed, 2004-03-31 at 23:53, Andrew Morton wrote:
> "Stephen C. Tweedie" <sct@redhat.com> wrote:
> > Unfortunately, this seems to contradict SingleUnix requirements, which
> > state:
> > When MS_ASYNC is specified, msync() shall return immediately
> > once all the write operations are initiated or queued for
> > servicing
> > although I can't find an unambiguous definition of "queued for service"
> > in the online standard. I'm reading it as requiring that the I/O has
> > reached the block device layer
> I don't think I agree with that. If "queued for service" means we've
> started the I/O, then what does "initiated" mean, and why did they specify
> "initiated" separately?
I'd interpret "initiated" as having reached hardware. "Queued for
service" is much more open to interpretation: Uli came up with "the data
must be actively put in a stage where I/O is initiated", which still
doesn't really address what sort of queueing is allowed.
> What triggered all this was a dinky little test app which Linus wrote to
> time some aspect of P4 tlb writeback latency. It sits in a loop dirtying a
> page then msyncing it with MS_ASYNC. It ran very poorly, because MS_ASYNC
> ended up waiting on the previously-submitted I/O before starting new I/O.
Sure. There are lots of ways an interface can be misused, though: you
only know if one use is valid or not once you've determined what the
_correct_ use is. I'm much more concerned about getting a correct
interpretation of the spec than of making IO fast for the sake of a
memory benchmark. :-)
> One approach to improving that would be for MS_ASYNC to say "if the page is
> already under writeout then just skip the I/O". But that's worthless,
> really - it makes the MS_ASYNC semantics too vague.
Agreed.
> Your reversion patch would mean that current applications which use
> MS_ASYNC will again suffer large latencies if the pages are under writeout.
Well, this whole issue came up precisely because somebody was seeing
exactly such a latency hit going from 2.4.9 to a later kernel. We've
not really been consistent about it in the past.
> Sure, users could switch apps to using flags=0 to avoid that, but people
> don't know to do that.
Exactly why we need documentation for that combination, whatever
happens.
> So given that SUS is ambiguous about this, I'd suggest that we be able to
> demonstrate some real-world reason why this matters. Why are you concerned
> about this?
Just for the reason you mentioned --- a real-world app (in-house, so
flags==0 is actually a valid solution for them) which was seeing
performance degradation when the "MS_ASYNC submits IO" was introduced in
the first place. But it was internally written, so I've no idea at all
whether or not the app was assuming one behaviour or the other on other
Unixen.
--Stephen
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
next prev parent reply other threads:[~2004-03-31 23:20 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
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:56 ` s390 storage key inconsistency? [was Re: msync() behaviour broken for MS_ASYNC, revert patch?] Stephen C. Tweedie
2004-04-01 16:57 ` msync() behaviour broken for MS_ASYNC, revert patch? 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 [this message]
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=1080775221.1991.91.camel@sisko.scot.redhat.com \
--to=sct@redhat.com \
--cc=akpm@osdl.org \
--cc=drepper@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=torvalds@osdl.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox