lkml.org 
[lkml]   [2006]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: msync() behaviour broken for MS_ASYNC, revert patch?
Linus Torvalds wrote:
>
> On Sat, 11 Feb 2006, Nick Piggin wrote:
>
>> When MS_ASYNC is specified, msync() shall return immediately once all
>> the write operations are initiated or queued for servicing;
>>
>>It is talking about write operations, not dirtying. Actually the only
>>difference with MS_SYNC is that it waits for said write operations (of the
>>type queued up by MS_ASYNC) to complete.
>
>
> Right. And it's what we do. We queue them by moving the pages to the dirty
> lists (yeah, it's just a tag on the page index thing, whatever).
>
> And yes, you argue that we should move the queue closer to the actual
> disk, but I have used at least one app that really hated the "start IO
> now" approach. I can't talk about that app in any detail, but I can say
> that it was an in-memory checkpoint thing with the checkpoints easily
> being in the hundred-meg range.
>

Hey fix your damn broken proprietary app (nah just kidding)

> And moving a hundred megs to the IO layer is insane. It also makes the
> system pretty unusable.
>
> So we may have different expectations, because we've seen different
> patterns. Me, I've seen the "events are huge, and you stagger them", so
> that the previous event has time to flow out to disk while you generate
> the next one. There, MS_ASYNC starting IO is _wrong_, because the scale of
> the event is just huge, so trying to push it through the IO subsystem asap
> just makes everything suck.
>
> In contrast, you seem to be coming at it from a standpoint of "only one
> event ever outstanding at any particular time, and it's either small or
> it's the only thing the whole system is doing". In which case pushing it
> out to IO buffers is probably the right thing to do.
>

The way I see it, it stems from simply a different expectation of
MS_ASYNC semantics, rather than exactly what the app is doing.

If there are no data integrity requirements, then the writing should
be left up to the VM. If there are, then there will be a MS_SYNC,
which *will* move those hundred megs to the IO layer so there is no
reason for MS_ASYNC *not* to get it started earlier (and it will
be more efficient if it does).

The semantics your app wants, in my interpretation, are provided
by MS_INVALIDATE. Which kind of says "bring mmap data into coherence
with system cache", which would presumably transfer dirty bits if
modified (though as an implementation detail, we are never actually
incoherent as far as the data goes, only dirty bits).

At this point the best I can do is agree to disagree if you are
still not convinced and I'll leave it to Linux to keep debating it.
We reached something of an agreement on the fadvise thing at least.

Thanks,
Nick

--
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-02-10 21:05    [W:0.110 / U:1.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site