From: ebiederm@xmission.com (Eric W. Biederman)
To: Bernd Harries <mlbha@gmx.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: __get_free_pages(): is the MEM really mine?
Date: 27 Sep 2001 08:38:37 -0600 [thread overview]
Message-ID: <m1adzg66mq.fsf@frodo.biederman.org> (raw)
In-Reply-To: <356.1001580994@www46.gmx.net>
In-Reply-To: <356.1001580994@www46.gmx.net>
Bernd Harries <mlbha@gmx.de> writes:
> Hi all,
> In a driver I'm writing, in the open() method, I use multiple
> __get_free_pages() to allocate a 4 MB kernel (image)buffer for DMA purposes.
> The buffer I get is contiguous (I try until it is) and is freed in
> close(). Order count is 9.
Ouch. This is where I give you the standard recommendation. If you
do this scatter gatter (so you don't need megs of continuous memory)
you should be much better off, and your driver should be more
reliable. All of the other techniques you have used like mmap should
still apply.
Also if you are exporting this data to user space, before your DMA
complets you want to zero the pages you have allocated, so you don't
have an information leak.
Eric
next prev parent reply other threads:[~2001-09-27 14:47 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-27 8:56 __get_free_pages(): is the MEM really mine? Bernd Harries
2001-09-27 9:15 ` Ingo Molnar
2001-09-27 9:20 ` Ingo Molnar
2001-09-27 14:38 ` Eric W. Biederman [this message]
2001-09-29 7:32 ` Bernd Harries
-- strict thread matches above, loose matches on Subject: below --
2001-09-27 10:06 Bernd Harries
2001-09-27 13:00 ` Ingo Molnar
2001-09-29 17:15 ` Bernd Harries
2001-09-30 7:27 ` Ingo Molnar
2001-09-30 12:59 ` Bernd Harries
2001-10-01 5:55 ` Ingo Molnar
2001-10-05 8:49 ` Bernd Harries
2001-09-27 14:19 Bernd Harries
2001-10-01 11:33 Bernd Harries
2001-10-05 12:55 ` Hugh Dickins
2001-10-05 13:32 ` Bernd Harries
2001-10-05 15:27 ` Hugh Dickins
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=m1adzg66mq.fsf@frodo.biederman.org \
--to=ebiederm@xmission.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mlbha@gmx.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox