[lkml]   [1999]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: locking user memory and kiobuf

On Mon, 08 Nov 1999 11:27:26 -0500, Jeff Garzik
<> said:

> This is a question I still have unanswered: Does map_user_kiobuf indeed
> map the VM into a _contiguous_ region of physical memory?

No. It creates a list of pointers to the various pages in the user's
address range: it does not physically move any data. Think of the
kiobuf as just a container object for the pages concerned.

> Note struct kiobuf includes an array of pages which causes some of my
> confusion. Is it legal/possible to do:

> /* maps in four pages for read/write access */
> err = map_user_kiobuf (WRITE, iobuf, (ulong) vmaddr, PAGE_SIZE * 4);

> /* manipulate data in chunks greater than PAGE_SIZE */
> phys = page_address(iobuf->maplist[0]);
> memcpy (foo, phys, PAGE_SIZE * 4);

No, never. A kiobuf is a container for individual pages. If they
happen to be contiguous then you may be able to do some optimisations on
those pages, but there is no guarantee that they will be.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

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