Re: Copy_to_user() and locks.

From: Stephen C. Tweedie (sct@redhat.com)
Date: Wed Feb 09 2000 - 13:27:50 EST


Hi,

On Tue, 8 Feb 2000 15:46:34 -0500 (EST), "Richard B. Johnson"
<root@chaos.analogic.com> said:

> You must not copy_to_user() under a lock. This is because the
> user's pages may not be in memory and the kernel needs to page-
> fault.

> Unfortunately, this often means that you have to copy twice, double
> buffer. However, a typical PC nowdays can copy over 800 megabytes per
> second.

Correct. However, what you _can_ do is to allocate kernel memory and
access that from your driver, and to map that same memory into user
space so that it is visible from a user process without copying.

--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/



This archive was generated by hypermail 2b29 : Tue Feb 15 2000 - 21:00:15 EST