Skip to contentSkip to conversation

vmscan.c: shrink_cache() doubt

DISCUSSION [email protected] 2 participants 2 messages Dec 29, 2001

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 12 lines · [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;
Quoted 3 lines

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.

-