Re: [patch] VM accounting change

From: Andrew Morton
Date: Thu Nov 11 2004 - 18:17:20 EST


Terence Ripperda <tripperda@xxxxxxxxxx> wrote:
>
> I've been told that recent changes in vm accounting in mmap have
> caused some problems with our driver during mmap.
>
> the problem seems to stem from us oring vma->vm_flags w/ (VM_LOCKED
> | VM_IO). we do this for agp and pci pages that are mapped to push
> buffers. VM_LOCKED since we don't want the pages to move and VM_IO so
> they are not dumped during a core dump.

VM_LOCKED|VM_IO doesn't seem to be a sane combination. VM_LOCKED means
"don't page it out" and VM_IO means "an IO region". The kernel never even
attempts to page out IO regions because they don't have reverse mappings.
Heck, they don't even have pageframes.

How about you drop the VM_LOCKED?

> diff -ru linux-2.6.10-rc1-bk8/mm/mmap.c linux-2.6.10-rc1-bk8-2/mm/mmap.c
> --- linux-2.6.10-rc1-bk8/mm/mmap.c 2004-11-06 15:04:28.000000000 +0100
> +++ linux-2.6.10-rc1-bk8-2/mm/mmap.c 2004-11-06 15:39:47.000000000 +0100
> @@ -1011,7 +1011,8 @@
> __vm_stat_account(mm, vm_flags, file, len >> PAGE_SHIFT);
> if (vm_flags & VM_LOCKED) {
> mm->locked_vm += len >> PAGE_SHIFT;
> - make_pages_present(addr, addr + len);
> + if (!(vm_flags & VM_IO))
> + make_pages_present(addr, addr + len);

Spose we could do that on the basis of "don't break existing drivers which
are doing peculiar things".

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