lkml.org 
[lkml]   [2001]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectmadvise(MADV_WILLNEED) not for anonymous memory?
Date

Hi,

Looking at the 2.4.10.SuSE-3 kernel sources, it seems as if the madvise
system call with MADV_WILLNEED does not support anonymous memory:

mm/filemap.c:

static long madvise_willneed(struct vm_area_struct * vma,
unsigned long start, unsigned long end)
{
long error = -EBADF;
struct file * file;
unsigned long size, rlim_rss;
loff_t rsize;

/* Doesn't work if there's no mapped file. */
if (!vma->vm_file)
return error;

FWIW, MADV_DONTNEED (madvise_dontneed) will happily call zap_page_range
without testing for file backing.

Is there a (less intuitive) way to give the VM a hint that the data of a
mmap'ed region (e.g. "stuff that may have been swapped out") is going to
be needed?

I realize, BTW, that despite the naming DONTNEED and WILLNEED are not
orthogonal (DONTNEED according to the comment in filemap.c will
"destroy" data).
-
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/

\
 
 \ /
  Last update: 2005-03-22 13:05    [W:0.023 / U:2.972 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site