All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@mandrakesoft.com>
To: Tigran Aivazian <tigran@veritas.com>
Cc: root@chaos.analogic.com, John Levon <moz@compsoc.man.ac.uk>,
	Linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: kmalloc() allocation.
Date: Mon, 30 Oct 2000 12:08:46 -0500	[thread overview]
Message-ID: <39FDAB1E.89BA3CC1@mandrakesoft.com> (raw)
In-Reply-To: <Pine.LNX.4.21.0010301653280.2617-100000@saturn.homenet>

Tigran Aivazian wrote:
> 
> On Mon, 30 Oct 2000, Jeff Garzik wrote:
> 
> > "Richard B. Johnson" wrote:
> > > Now, I could set up a linked-list of buffers and use vmalloc()
> > > if the buffers were allocated from non-paged RAM. I don't think
> > > they are. These buffers must be present during an interrupt.
> >
> > Non-paged RAM?  I'm not sure what you mean by that.
> >
> > Both kmalloc and vmalloc allocate pages, but neither will allocate pages
> > that the system will swap out (page out).  [vk]malloc pages are always
> > around during an interrupt.

> Jeff, I was going to tell him that but in the previous sentence he was
> talking about userspace supplied buffers and those are certainly not
> pinned.

Well the problem sounds really strange then.  Why are kmalloc/vmalloc
being talked about at all, if we are dealing with userspace-supplied
buffers?

IF copy_to_user is being used here, userspace buffers in kernel space
are pointless.  Any userspace buffer supplied to read(2) must by design
be a different buffer than the 2nd arg of copy_to_user.  If copy_to_user
is being used, then there is a "copy" taking place...

Richard, if you want to read directly into userspace buffers, kiobufs
are the way to go...   If you don't want to ever swap them in and out,
you can mlock(2) them.  Or simply allocate the memory in the driver, and
mmap those buffers.  Much easier than read(2), and it eliminates any
copy step.

	Jeff



-- 
Jeff Garzik             | "Mind if I drive?"  -Sam
Building 1024           | "Not if you don't mind me clawing at the
MandrakeSoft            |  dash and shrieking like a cheerleader."
                        |                     -Max
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2000-10-30 17:10 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-30 15:57 kmalloc() allocation Richard B. Johnson
2000-10-30 16:06 ` Tigran Aivazian
2000-10-30 16:28   ` Richard B. Johnson
2000-10-30 16:38     ` Tigran Aivazian
2000-10-30 17:57       ` Richard B. Johnson
2000-10-30 16:06 ` John Levon
2000-10-30 16:27   ` Richard B. Johnson
2000-10-30 16:49     ` Jeff Garzik
2000-10-30 16:54       ` Tigran Aivazian
2000-10-30 17:08         ` Jeff Garzik [this message]
2000-10-30 18:08           ` Richard B. Johnson
2000-10-30 18:06       ` Richard B. Johnson
2000-10-30 18:10         ` Jeff Garzik
2000-10-30 16:40 ` Rik van Riel
2000-10-31  7:03   ` Mike Galbraith
2000-10-31 10:48   ` Ingo Oeser
2000-10-31 10:48     ` Ingo Oeser
2000-10-31 13:35     ` Rik van Riel
2000-10-31 13:35       ` Rik van Riel
2000-10-31 13:59       ` Richard B. Johnson
2000-10-31 13:59         ` Richard B. Johnson
2000-10-31 15:57         ` Pauline Middelink
2000-10-31 15:17       ` Ingo Oeser
2000-10-31 15:17         ` Ingo Oeser
2000-10-31 16:11         ` Rik van Riel
2000-10-31 16:11           ` Rik van Riel
2000-10-31 18:22           ` Ingo Oeser
2000-10-31 18:22             ` Ingo Oeser
2000-10-31 14:43     ` afei
2000-10-31 14:43       ` afei
2000-10-30 18:22 ` Alan Cox
2000-10-30 18:37   ` Richard B. Johnson
2000-10-31  5:28     ` H. Peter Anvin
2000-10-31  6:11       ` Brian Gerst
2000-10-31  8:44         ` Andi Kleen
2000-10-31 12:58           ` Brian Gerst
2000-10-31 14:48             ` kernel
2000-10-31 15:01               ` Alan Cox
2000-10-31 15:57                 ` kernel
2000-10-31  8:49         ` Tigran Aivazian
2000-10-31  8:54           ` Andi Kleen
2000-10-31  9:07             ` Tigran Aivazian
2000-10-31  9:25               ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=39FDAB1E.89BA3CC1@mandrakesoft.com \
    --to=jgarzik@mandrakesoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=moz@compsoc.man.ac.uk \
    --cc=root@chaos.analogic.com \
    --cc=tigran@veritas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.