Skip to contentSkip to conversation

madvise on file pages

DISCUSSION Muthian S 3 participants 3 messages Jul 31, 2003 – Aug 1, 2003

lore
Share & tools
lore

Muthian S

author
#0 lore raw

Hi,

Could someone inform as to what is the behavior when madvise DONTNEED is called on pages that are mmap'd from local files mapped with MAP_SHARED, i.e. they share the same page that the file cache does. In such cases, can madvise be made to release specific pages in the file cache by mmap-ing the relevant file segment ?

thanks,
Muthian.

_________________________________________________________________
Play detective. Identify genuine Windows. http://server1.msn.co.in/sp03/coa/index.asp Win cool prizes.

#1 lore raw
Quoted 6 lines · Muthian S

Hi,

Could someone inform as to what is the behavior when madvise DONTNEED is called on pages that are mmap'd from local files mapped with MAP_SHARED, i.e. they share the same page that the file cache does.

The pages are unmapped from the calling process's pagetables. We don't actually free the physical pages.

Quoted 3 lines

In such cases, can
madvise be made to release specific pages in the file cache by mmap-ing the relevant file segment ?

No.

2.6 kernels implement the fadvise() syscall (accessible by glibc's posix_fadvise() function) which will do this.

#2 lore raw
Quoted 11 lines · Andrew Morton
Quoted 6 lines · Muthian S

Hi,

Could someone inform as to what is the behavior when madvise DONTNEED is called on pages that are mmap'd from local files mapped with MAP_SHARED, i.e. they share the same page that the file cache does.

The pages are unmapped from the calling process's pagetables. We don't actually free the physical pages.

Quoted 8 lines
Quoted 3 lines

In such cases, can
madvise be made to release specific pages in the file cache by mmap-ing the relevant file segment ?

No.

2.6 kernels implement the fadvise() syscall (accessible by glibc's posix_fadvise() function) which will do this.

Perhaps we could send the page to the least-used end of the page lists?

Signature · 6 lines
winden/network

1. Dado un programa, siempre tiene al menos un fallo.
2. Dadas varias lineas de codigo, siempre se pueden acortar a menos lineas.
3. Por induccion, todos los programas se pueden
   reducir a una linea que no funciona.