Re: Short question about the mmap method

From: Steffen Persvold (
Date: Fri Jan 04 2002 - 20:07:48 EST

Tommy Reynolds wrote:
> Uttered "Steffen Persvold" <>, spoke thus:
> > Hi lkml readers,
> >
> > I have a question regarding drivers implementing the mmap and nopage methods.
> > In some references I've read that pages in kernel allocated memory (either
> > allocated with kmalloc, vmalloc or__get_free_pages) should be set to reserved
> > (mem_map_reserve or set_bit(PG_reserved, page->flags) before they can be
> > mmap'ed to guarantee that they can't be swapped out. Is this true ?
> [kv]malloc memory is _never_ subject to paging and can be mmap'ed with a
> vengeance without resorting to mucking about with marking pages or the like.
> You're working too hard ;-)

OK, thanks. But I found out that if you want to use remap_page_range on kmalloc'ed memory you need
to set the reserve bit first. Without it, it just doesn't work. When using the nopage method no
reserving is necessary.

What about my question regarding locking the mm spinlock table before traversing the page table (for
vmalloc'ed memory). Any ideas there ?


  Steffen Persvold   | Scalable Linux Systems |   Try out the world's best  |  | performing MPI implementation:
Tel: (+47) 2262 8950 |   Olaf Helsets vei 6   |      - ScaMPI 1.12.2 -         
Fax: (+47) 2262 8951 |   N0621 Oslo, NORWAY   | >300MBytes/s and <4uS latency
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Jan 07 2002 - 21:00:27 EST