Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-20 Thread Aubrey Li
On 4/20/07, David Howells <[EMAIL PROTECTED]> wrote: Aubrey Li <[EMAIL PROTECTED]> wrote: > 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

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-20 Thread David Howells
Eric Dumazet <[EMAIL PROTECTED]> wrote: > Is it really possible to allocate an order-10 page, then release part of it > (say an order-8 subpage) ? Yes. David - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-20 Thread Eric Dumazet
On Fri, 20 Apr 2007 09:58:52 +0100 David Howells <[EMAIL PROTECTED]> wrote: > > Because kmalloc() may be able to get us a smaller chunk of memory. Actually, > calling __get_free_pages() might be a better, and then release the excess > pages. Interesting, that rings a bell here. I wonder why we

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-20 Thread David Howells
Aubrey Li <[EMAIL PROTECTED]> wrote: > 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, Because

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-20 Thread Aubrey Li
On 4/20/07, David Howells <[EMAIL PROTECTED]> wrote: Aubrey Li <[EMAIL PROTECTED]> 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

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-20 Thread David Howells
Aubrey Li <[EMAIL PROTECTED]> 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?

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-20 Thread David Howells
Aubrey Li [EMAIL PROTECTED] 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.

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-20 Thread Aubrey Li
On 4/20/07, David Howells [EMAIL PROTECTED] wrote: Aubrey Li [EMAIL PROTECTED] 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

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-20 Thread David Howells
Aubrey Li [EMAIL PROTECTED] wrote: 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, Because

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-20 Thread Eric Dumazet
On Fri, 20 Apr 2007 09:58:52 +0100 David Howells [EMAIL PROTECTED] wrote: Because kmalloc() may be able to get us a smaller chunk of memory. Actually, calling __get_free_pages() might be a better, and then release the excess pages. Interesting, that rings a bell here. I wonder why we dont

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-20 Thread David Howells
Eric Dumazet [EMAIL PROTECTED] wrote: Is it really possible to allocate an order-10 page, then release part of it (say an order-8 subpage) ? Yes. David - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-20 Thread Aubrey Li
On 4/20/07, David Howells [EMAIL PROTECTED] wrote: Aubrey Li [EMAIL PROTECTED] wrote: 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

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-19 Thread Aubrey Li
On 4/18/07, David Howells <[EMAIL PROTECTED]> wrote: Aubrey Li <[EMAIL PROTECTED]> wrote: > Here, in the attachment I wrote a small test app. Please correct if > there is anything wrong, and feel free to improve it. Okay... I have that working... probably. I don't know what output it's

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-19 Thread David Howells
Aubrey Li <[EMAIL PROTECTED]> wrote: > Yes, it's reasonable for me, as long as your > host IP is 192.168.2.128 > and > target IP is 192.168.2.141 That is correct, yes:-) I expect it's an NFS packet as my board is using an NFS root at the moment. David - To unsubscribe from this

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-19 Thread David Howells
Aubrey Li [EMAIL PROTECTED] wrote: Yes, it's reasonable for me, as long as your host IP is 192.168.2.128 and target IP is 192.168.2.141 That is correct, yes:-) I expect it's an NFS packet as my board is using an NFS root at the moment. David - To unsubscribe from this list:

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-19 Thread Aubrey Li
On 4/18/07, David Howells [EMAIL PROTECTED] wrote: Aubrey Li [EMAIL PROTECTED] wrote: Here, in the attachment I wrote a small test app. Please correct if there is anything wrong, and feel free to improve it. Okay... I have that working... probably. I don't know what output it's supposed to

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-18 Thread Aubrey Li
On 4/18/07, David Howells <[EMAIL PROTECTED]> wrote: Aubrey Li <[EMAIL PROTECTED]> wrote: > Here, in the attachment I wrote a small test app. Please correct if > there is anything wrong, and feel free to improve it. Okay... I have that working... probably. I don't know what output it's

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-18 Thread David Howells
Aubrey Li <[EMAIL PROTECTED]> wrote: > Here, in the attachment I wrote a small test app. Please correct if > there is anything wrong, and feel free to improve it. Okay... I have that working... probably. I don't know what output it's supposed to produce, but I see this: #

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-18 Thread David Howells
Aubrey Li [EMAIL PROTECTED] wrote: Here, in the attachment I wrote a small test app. Please correct if there is anything wrong, and feel free to improve it. Okay... I have that working... probably. I don't know what output it's supposed to produce, but I see this: #

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-18 Thread Aubrey Li
On 4/18/07, David Howells [EMAIL PROTECTED] wrote: Aubrey Li [EMAIL PROTECTED] wrote: Here, in the attachment I wrote a small test app. Please correct if there is anything wrong, and feel free to improve it. Okay... I have that working... probably. I don't know what output it's supposed to

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-17 Thread David Howells
Robin Getz <[EMAIL PROTECTED]> wrote: > David - Does this give you what you need? Possibly. I'll have a look at it tomorrow. David - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-17 Thread Robin Getz
On Tue 17 Apr 2007 06:36, Aubrey Li pondered: > Here, in the attachment I wrote a small test app. Please correct if > there is anything wrong, and feel free to improve it. Thanks. David - Does this give you what you need? - To unsubscribe from this list: send the line "unsubscribe linux-kernel"

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-17 Thread Aubrey Li
On 4/11/07, Robin Getz <[EMAIL PROTECTED]> wrote: On Tue 10 Apr 2007 08:55, David Howells pondered: > Looking at alloc_pg_vec() in af_packet.c, I will place my bets on the > latter case. I don't know that this is a problem; it depends on how things > work, and that I don't know offhand. If

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-17 Thread Aubrey Li
On 4/11/07, Robin Getz [EMAIL PROTECTED] wrote: On Tue 10 Apr 2007 08:55, David Howells pondered: Looking at alloc_pg_vec() in af_packet.c, I will place my bets on the latter case. I don't know that this is a problem; it depends on how things work, and that I don't know offhand. If someone

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-17 Thread Robin Getz
On Tue 17 Apr 2007 06:36, Aubrey Li pondered: Here, in the attachment I wrote a small test app. Please correct if there is anything wrong, and feel free to improve it. Thanks. David - Does this give you what you need? - To unsubscribe from this list: send the line unsubscribe linux-kernel in

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-17 Thread David Howells
Robin Getz [EMAIL PROTECTED] wrote: David - Does this give you what you need? Possibly. I'll have a look at it tomorrow. David - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-10 Thread Robin Getz
On Tue 10 Apr 2007 08:55, David Howells pondered: > Looking at alloc_pg_vec() in af_packet.c, I will place my bets on the > latter case. I don't know that this is a problem; it depends on how things > work, and that I don't know offhand. If someone can give me a simple test > program, I would be

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-10 Thread David Howells
Robin Getz <[EMAIL PROTECTED]> wrote: > David - I know you have been reworking the noMMU vma handling - is there a > solution to vm_insert_page? The reason vm_insert_page() is being called, I imagine, is because packet_mmap() has to insert mappings to an already existing buffer. All it does is

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-10 Thread David Howells
Robin Getz [EMAIL PROTECTED] wrote: David - I know you have been reworking the noMMU vma handling - is there a solution to vm_insert_page? The reason vm_insert_page() is being called, I imagine, is because packet_mmap() has to insert mappings to an already existing buffer. All it does is

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-10 Thread Robin Getz
On Tue 10 Apr 2007 08:55, David Howells pondered: Looking at alloc_pg_vec() in af_packet.c, I will place my bets on the latter case. I don't know that this is a problem; it depends on how things work, and that I don't know offhand. If someone can give me a simple test program, I would be

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-09 Thread Wu, Bryan
On Mon, 2007-04-09 at 16:08 -0400, Robin Getz wrote: > On Mon 9 Apr 2007 14:43, David Miller pondered: > > From: David Miller <[EMAIL PROTECTED]> > > Date: Mon, 09 Apr 2007 09:55:23 -0700 (PDT) > > > > > > I will apply this patch. > > > > Actually I won't, the other comments in this thread make a

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-09 Thread Robin Getz
On Mon 9 Apr 2007 14:43, David Miller pondered: > From: David Miller <[EMAIL PROTECTED]> > Date: Mon, 09 Apr 2007 09:55:23 -0700 (PDT) > > > > I will apply this patch. > > Actually I won't, the other comments in this thread make a lot > of sense, we should try to make it build and work just as we

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-09 Thread David Miller
From: David Miller <[EMAIL PROTECTED]> Date: Mon, 09 Apr 2007 09:55:23 -0700 (PDT) > From: "Wu, Bryan" <[EMAIL PROTECTED]> > Date: Mon, 09 Apr 2007 17:50:22 +0800 > > > On Mon, 2007-04-09 at 11:01 +0800, Aubrey Li wrote: > > > The option CONFIG_PACKET_MMAP should depend on MMU. > > > > > >

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-09 Thread David Miller
From: "Wu, Bryan" <[EMAIL PROTECTED]> Date: Mon, 09 Apr 2007 17:50:22 +0800 > On Mon, 2007-04-09 at 11:01 +0800, Aubrey Li wrote: > > The option CONFIG_PACKET_MMAP should depend on MMU. > > > > Signed-off-by: Aubrey.Li <[EMAIL PROTECTED]> > > --- > > net/packet/Kconfig |2 +- > > 1 files

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-09 Thread Robin Getz
On Mon 9 Apr 2007 05:50, Wu, Bryan pondered: > On Mon, 2007-04-09 at 11:01 +0800, Aubrey Li wrote: > > The option CONFIG_PACKET_MMAP should depend on MMU. > > > > Signed-off-by: Aubrey.Li <[EMAIL PROTECTED]> > > --- > > net/packet/Kconfig |2 +- > > 1 files changed, 1 insertions(+), 1

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-09 Thread Wu, Bryan
On Mon, 2007-04-09 at 11:01 +0800, Aubrey Li wrote: > The option CONFIG_PACKET_MMAP should depend on MMU. > > Signed-off-by: Aubrey.Li <[EMAIL PROTECTED]> > --- > net/packet/Kconfig |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/net/packet/Kconfig

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-09 Thread Wu, Bryan
On Mon, 2007-04-09 at 11:01 +0800, Aubrey Li wrote: The option CONFIG_PACKET_MMAP should depend on MMU. Signed-off-by: Aubrey.Li [EMAIL PROTECTED] --- net/packet/Kconfig |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/packet/Kconfig b/net/packet/Kconfig

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-09 Thread Robin Getz
On Mon 9 Apr 2007 05:50, Wu, Bryan pondered: On Mon, 2007-04-09 at 11:01 +0800, Aubrey Li wrote: The option CONFIG_PACKET_MMAP should depend on MMU. Signed-off-by: Aubrey.Li [EMAIL PROTECTED] --- net/packet/Kconfig |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-09 Thread David Miller
From: Wu, Bryan [EMAIL PROTECTED] Date: Mon, 09 Apr 2007 17:50:22 +0800 On Mon, 2007-04-09 at 11:01 +0800, Aubrey Li wrote: The option CONFIG_PACKET_MMAP should depend on MMU. Signed-off-by: Aubrey.Li [EMAIL PROTECTED] --- net/packet/Kconfig |2 +- 1 files changed, 1

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-09 Thread David Miller
From: David Miller [EMAIL PROTECTED] Date: Mon, 09 Apr 2007 09:55:23 -0700 (PDT) From: Wu, Bryan [EMAIL PROTECTED] Date: Mon, 09 Apr 2007 17:50:22 +0800 On Mon, 2007-04-09 at 11:01 +0800, Aubrey Li wrote: The option CONFIG_PACKET_MMAP should depend on MMU. Signed-off-by: Aubrey.Li

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-09 Thread Robin Getz
On Mon 9 Apr 2007 14:43, David Miller pondered: From: David Miller [EMAIL PROTECTED] Date: Mon, 09 Apr 2007 09:55:23 -0700 (PDT) I will apply this patch. Actually I won't, the other comments in this thread make a lot of sense, we should try to make it build and work just as we do for

Re: [PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-09 Thread Wu, Bryan
On Mon, 2007-04-09 at 16:08 -0400, Robin Getz wrote: On Mon 9 Apr 2007 14:43, David Miller pondered: From: David Miller [EMAIL PROTECTED] Date: Mon, 09 Apr 2007 09:55:23 -0700 (PDT) I will apply this patch. Actually I won't, the other comments in this thread make a lot of sense,

[PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-08 Thread Aubrey Li
The option CONFIG_PACKET_MMAP should depend on MMU. Signed-off-by: Aubrey.Li <[EMAIL PROTECTED]> --- net/packet/Kconfig |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/packet/Kconfig b/net/packet/Kconfig index 34ff93f..959c272 100644 --- a/net/packet/Kconfig +++

[PATCH] CONFIG_PACKET_MMAP should depend on MMU

2007-04-08 Thread Aubrey Li
The option CONFIG_PACKET_MMAP should depend on MMU. Signed-off-by: Aubrey.Li [EMAIL PROTECTED] --- net/packet/Kconfig |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/packet/Kconfig b/net/packet/Kconfig index 34ff93f..959c272 100644 --- a/net/packet/Kconfig +++