2001-12-29 08:24:04

by alad

[permalink] [raw]
Subject: vmscan.c: shrink_cache() doubt



In shrink_cache(), we have

if (!page->buffers && (page_count(page) != 1 || !page->mapping))
goto page_mapped;
.
.
.
page_mapped:
if (--max_mapped >=0)
continue;


Assume page->buffers == NULL and page->count == 1, then why jump to page_mapped
if page->mapping == NULL ??

-- Amol




2001-12-29 08:44:48

by Andrew Morton

[permalink] [raw]
Subject: Re: vmscan.c: shrink_cache() doubt

[email protected] wrote:
>
> In shrink_cache(), we have
>
> if (!page->buffers && (page_count(page) != 1 || !page->mapping))
> goto page_mapped;
> .
> .
> .
> page_mapped:
> if (--max_mapped >=0)
> continue;
>
> Assume page->buffers == NULL and page->count == 1, then why jump to page_mapped
> if page->mapping == NULL ??
>

These are anonymous pages - memory returned by malloc() rather
than by mmap().

Replace max_mapped with max_unfreeable and replace page_mapped
with page_unfreeable and it may make some sense.

-