[PATCH] vmacct3/9 mremap MAP_NORESERVE not in flags

Hugh Dickins (hugh@veritas.com)
Mon, 29 Jul 2002 23:07:32 +0100 (BST)


There is no point in do_mremap clearing MAP_NORESERVE from its flags:
it has already validated that only the MREMAP_ flags can be set,
and it has no use for MAP_NORESERVE in the code that follows anyway.

--- vmacct2/mm/mremap.c Mon Jul 29 11:48:04 2002
+++ vmacct3/mm/mremap.c Mon Jul 29 19:23:46 2002
@@ -229,8 +229,6 @@
return -ENOMEM;
}

-extern int sysctl_overcommit_memory; /* FIXME!! */
-
/*
* Expand (or shrink) an existing mapping, potentially moving it at the
* same time (controlled by the MREMAP_MAYMOVE flag and available VM space)
@@ -315,8 +313,6 @@
> current->rlim[RLIMIT_AS].rlim_cur)
goto out;

- if (sysctl_overcommit_memory > 1)
- flags &= ~MAP_NORESERVE;
if (vma->vm_flags & VM_ACCOUNT) {
charged = (new_len - old_len) >> PAGE_SHIFT;
if (!vm_enough_memory(charged))

-
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/