From: "Aubrey Li" <aubreylee@gmail.com>
To: "David Howells" <dhowells@redhat.com>
Cc: "Robin Getz" <rgetz@blackfin.uclinux.org>,
uaca@alumni.uv.es, bryan.wu@analog.com,
"Alan Cox" <alan@lxorguk.ukuu.org.uk>,
waltje@uwalt.nl.mugnet.org, netdev@vger.kernel.org,
"Andrew Morton" <akpm@osdl.org>,
"Linux Kernel" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU
Date: Fri, 20 Apr 2007 16:39:52 +0800 [thread overview]
Message-ID: <6d6a94c50704200139vb9b24f6y77a6d23544c8f7b9@mail.gmail.com> (raw)
In-Reply-To: <1016.1177055893@redhat.com>
On 4/20/07, David Howells <dhowells@redhat.com> wrote:
> Aubrey Li <aubreylee@gmail.com> wrote:
>
> > The patch works properly on my side. But
> > 1) I'm not sure why you re-wrote alloc/free_pg_vec function, doesn't
> > the current implement work for NOMMU? I know you want to allocate the
> > entire data buffer as one contiguous lump, but is it really necessary?
>
> Yes. It's not possible to map the whole buffer otherwise. Think about it!
> mmap() returns _one_ reference address. In MMU-mode, the non-contiguous
> physical buffers can be made to appear virtually contiguous by fudging the
> page tables and using the MMU. This is not possible in NOMMU-mode. The app
> will expect the buffer to be one contiguous lump in its address space, and
> will not be able to locate the other segments of the buffer.
Great explanation, thanks, :-)
>
> Actually, what I said is not quite true. It is possible to map the whole
> buffer otherwise: I could lift the restriction that requires that you map the
> whole buffer or not at all, and then userspace could stitch the whole lot
> together itself. This would then require userspace to be bimodal.
>
> > 2) So the mapped pages doesn't count into NR_FILE_MAPPED, is it a problem?
>
> Not really, no - there are no pagetables.
>
> Furthermore, issuing the PACKET_RX_RING sockopt does the entire allocation.
> Any subsequent mmaps on it have little effect.
>
> We could do that accounting though if you think it'd be better. I don't
> suppose it hurts.
>
as checked in packet_set_ring, buffer size must be a multiple of PAGE_SIZE,
--------------------packet_set_ring------------------------
if (unlikely(req->tp_block_size & (PAGE_SIZE - 1)))
So why not use __get_free_pages rather than kmalloc, so that we have
pagetables to count?
-Aubrey
next prev parent reply other threads:[~2007-04-20 8:39 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-09 3:01 Aubrey Li
2007-04-09 9:50 ` Wu, Bryan
2007-04-09 15:46 ` Robin Getz
2007-04-09 16:55 ` David Miller
2007-04-09 18:43 ` David Miller
2007-04-09 20:08 ` Robin Getz
2007-04-10 2:00 ` Wu, Bryan
2007-04-10 12:55 ` David Howells
2007-04-10 23:52 ` Robin Getz
2007-04-17 10:36 ` Aubrey Li
2007-04-17 18:30 ` Robin Getz
2007-04-17 19:02 ` David Howells
2007-04-18 15:33 ` David Howells
2007-04-19 0:59 ` Aubrey Li
2007-04-19 9:42 ` David Howells
2007-04-20 4:46 ` Aubrey Li
2007-04-20 7:58 ` David Howells
2007-04-20 8:39 ` Aubrey Li [this message]
2007-04-20 8:58 ` David Howells
2007-04-20 9:17 ` Eric Dumazet
2007-04-20 10:43 ` David Howells
2007-04-20 13:14 ` Aubrey Li
-- strict thread matches above, loose matches on Subject: below --
2006-04-11 4:22 Aubrey
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=6d6a94c50704200139vb9b24f6y77a6d23544c8f7b9@mail.gmail.com \
--to=aubreylee@gmail.com \
--cc=akpm@osdl.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=bryan.wu@analog.com \
--cc=dhowells@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rgetz@blackfin.uclinux.org \
--cc=uaca@alumni.uv.es \
--cc=waltje@uwalt.nl.mugnet.org \
/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
all inboxes | Powered by JetHome®