Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: large, disposable files?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: large, disposable files?



On Mar 14, 2007, at 2:16 AM, Quinn wrote:
At 21:27 -0700 13/3/07, Michael Smith wrote:
It's largely superseded by the (more standard) madvise(2).

Which, last time I checked, was largely ignored by the kernel.

In the currently released version of the OS, vm_map_behavior_set(), the underlying Mach API that implements it, defaults VM_BEHAVIOR_WILLNEED and VM_BEHAVIOR_DONTNEED, but it respects (by putting it in the object) VM_BEHAVIOR_DEFAULT, VM_BEHAVIOR_RANDOM, VM_BEHAVIOR_SEQUENTIAL, and VM_BEHAVIOR_RSEQNTL.


Both vm_fault_is_sequential() and vm_fault_deactivate_behind() respect these flags. In particular, pages will be preemptively deactived for sequential reads of long enough runs, so mmap()'ing the data and setting MADV_SEQUENTIAL will likely get the behaviour he wants, as llong as his access is actually sequential.

As far as "the pause button", there's a (normally privileged) call "malock() which could be used to lock the code path for the pause button into code (assuming you knew your front-end application well enough to know what pages were contained in that code path). If you did that, the reaction tme of the pause button would be more or less immediate.

Alternately, setting the task priority to RT (it _is_ an AV application, after all) would give the paging in of the pause path priority, and, again, you'd get a more or less immediate response.

-

As far as tuning the system, it's very hard to provide the knobs; despite the surface similarities, Tru64 and MacOS X are very different internally, and, for example, "ubc" MacOS X is about as really similar under the covers as "ubc" in NetBSD as it is to "ubc" in Tru64.

Not only that, the traditional UNIX model for tuning ("turn off all limits, run it until it crashes with a particular workload, tune down the limits where it jumped the shark") doesn't tend to work very well for the customer.

-- Terry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >large, disposable files? (From: Andrew Gallatin <email@hidden>)
 >Re: large, disposable files? (From: Andrew Gallatin <email@hidden>)
 >Re: large, disposable files? (From: "Shawn Erickson" <email@hidden>)
 >Re: large, disposable files? (From: Andrew Gallatin <email@hidden>)
 >Re: large, disposable files? (From: Michael Smith <email@hidden>)
 >Re: large, disposable files? (From: Andrew Gallatin <email@hidden>)
 >Re: large, disposable files? (From: Andrew Gallatin <email@hidden>)
 >Re: large, disposable files? (From: "Michael Crawford" <email@hidden>)
 >Re: large, disposable files? (From: Michael Smith <email@hidden>)
 >Re: large, disposable files? (From: Quinn <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.