[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: a plea for mincore()/madvise()




On Fri, 10 Mar 2000, James Manning wrote:
> 
> I'm certainly sure there's all kinds of other areas where mincore() and
> madvise() are very helpful.

I agree especially for madvice, but I haven't liked the patches that I've
seen so far.

I don't like exporting the silly user-land "advice" into the
vma->vm_flags. I like "flags" as flags, and I'd be happy to have bit
positions saying

	if (vma->vm_flags & VM_SEQUENTIAL) {
		.. pre-fetch aggressively ..
	}


and then the madvise() system call would do somehting like

	switch (advice) {
	MADV_SEQUENTIAL:
		/* This is really more of a "mprotect" thing */
		mprotect(start, end, VM_SEQUENTIAL);
		break;
	MADV_DONTNEED:
		/* While this is really a case of msync() */
		msync(start, end, MSYNC_THROWAWAY);
		break;
	...

instead of just trying to force the madvise() system call into the VM
structure, where I don't think it makes all that much sense.

MADV_DONTNEED really is NOT a vma flag at all. It really is what Linux
tends to call MS_INVALIDATE for msync() (which is probably wrong, I don't
know how anybody else does this).

		Linus

--
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.eu.org/Linux-MM/