lkml.org 
[lkml]   [1999]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: locking user memory and kiobuf
Hi,

On Mon, 08 Nov 1999 11:27:26 -0500, Jeff Garzik
<jgarzik@mandrakesoft.com> 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.

--Stephen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

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