* [PATCH 3/12 2.4] e1000 - use vmalloc for data structures not shared with h/w
@ 2004-07-29 15:29 ganesh.venkatesan
2004-07-29 17:50 ` Christoph Hellwig
0 siblings, 1 reply; 6+ messages in thread
From: ganesh.venkatesan @ 2004-07-29 15:29 UTC (permalink / raw)
To: jgarzik; +Cc: netdev, ganesh.venkatesan
diff -up linux-2.4/drivers/net/e1000/e1000.h linux-2.4/drivers/net/e1000.new/e1000.h
--- linux-2.4/drivers/net/e1000/e1000.h 2004-07-28 08:47:08.172582760 -0700
+++ linux-2.4/drivers/net/e1000.new/e1000.h 2004-07-28 08:47:09.439390176 -0700
@@ -49,6 +49,7 @@
#include <linux/delay.h>
#include <linux/timer.h>
#include <linux/slab.h>
+#include <linux/vmalloc.h>
#include <linux/interrupt.h>
#include <linux/string.h>
#include <linux/pagemap.h>
diff -up linux-2.4/drivers/net/e1000/e1000_main.c linux-2.4/drivers/net/e1000.new/e1000_main.c
--- linux-2.4/drivers/net/e1000/e1000_main.c 2004-07-28 08:47:08.177582000 -0700
+++ linux-2.4/drivers/net/e1000.new/e1000_main.c 2004-07-28 08:47:09.559371936 -0700
@@ -786,7 +786,7 @@ e1000_setup_tx_resources(struct e1000_ad
int size;
size = sizeof(struct e1000_buffer) * txdr->count;
- txdr->buffer_info = kmalloc(size, GFP_KERNEL);
+ txdr->buffer_info = vmalloc(size);
if(!txdr->buffer_info) {
return -ENOMEM;
}
@@ -799,7 +820,7 @@ e1000_setup_tx_resources(struct e1000_ad
txdr->desc = pci_alloc_consistent(pdev, txdr->size, &txdr->dma);
if(!txdr->desc) {
- kfree(txdr->buffer_info);
+ vfree(txdr->buffer_info);
return -ENOMEM;
}
memset(txdr->desc, 0, txdr->size);
@@ -903,7 +926,7 @@ e1000_setup_rx_resources(struct e1000_ad
int size;
size = sizeof(struct e1000_buffer) * rxdr->count;
- rxdr->buffer_info = kmalloc(size, GFP_KERNEL);
+ rxdr->buffer_info = vmalloc(size);
if(!rxdr->buffer_info) {
return -ENOMEM;
}
@@ -917,7 +942,7 @@ e1000_setup_rx_resources(struct e1000_ad
rxdr->desc = pci_alloc_consistent(pdev, rxdr->size, &rxdr->dma);
if(!rxdr->desc) {
- kfree(rxdr->buffer_info);
+ vfree(rxdr->buffer_info);
return -ENOMEM;
}
memset(rxdr->desc, 0, rxdr->size);
@@ -1041,7 +1041,7 @@ e1000_free_tx_resources(struct e1000_ada
e1000_clean_tx_ring(adapter);
- kfree(adapter->tx_ring.buffer_info);
+ vfree(adapter->tx_ring.buffer_info);
adapter->tx_ring.buffer_info = NULL;
pci_free_consistent(pdev, adapter->tx_ring.size,
@@ -1110,7 +1110,7 @@ e1000_free_rx_resources(struct e1000_ada
e1000_clean_rx_ring(adapter);
- kfree(rx_ring->buffer_info);
+ vfree(rx_ring->buffer_info);
rx_ring->buffer_info = NULL;
pci_free_consistent(pdev, rx_ring->size, rx_ring->desc, rx_ring->dma);
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/12 2.4] e1000 - use vmalloc for data structures not shared with h/w
2004-07-29 15:29 ganesh.venkatesan
@ 2004-07-29 17:50 ` Christoph Hellwig
0 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2004-07-29 17:50 UTC (permalink / raw)
To: ganesh.venkatesan; +Cc: jgarzik, netdev
This sounds rather bogus. vmallocspace is a scare ressource, don't use it
unless nessecary.
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH 3/12 2.4] e1000 - use vmalloc for data structures not shared with h/w
@ 2004-07-29 18:17 Venkatesan, Ganesh
2004-07-29 18:25 ` Christoph Hellwig
0 siblings, 1 reply; 6+ messages in thread
From: Venkatesan, Ganesh @ 2004-07-29 18:17 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: jgarzik, netdev
Vmalloc space is less scarce than kmalloc space. Am I right? This patch
trades kmalloc space for vmalloc space.
Ganesh.
-----Original Message-----
From: Christoph Hellwig [mailto:hch@infradead.org]
Sent: Thursday, July 29, 2004 10:50 AM
To: Venkatesan, Ganesh
Cc: jgarzik@pobox.com; netdev@oss.sgi.com
Subject: Re: [PATCH 3/12 2.4] e1000 - use vmalloc for data structures
not shared with h/w
This sounds rather bogus. vmallocspace is a scare ressource, don't use
it
unless nessecary.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/12 2.4] e1000 - use vmalloc for data structures not shared with h/w
2004-07-29 18:17 [PATCH 3/12 2.4] e1000 - use vmalloc for data structures not shared with h/w Venkatesan, Ganesh
@ 2004-07-29 18:25 ` Christoph Hellwig
2004-07-31 7:38 ` Herbert Xu
0 siblings, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2004-07-29 18:25 UTC (permalink / raw)
To: Venkatesan, Ganesh; +Cc: jgarzik, netdev
On Thu, Jul 29, 2004 at 11:17:08AM -0700, Venkatesan, Ganesh wrote:
> Vmalloc space is less scarce than kmalloc space. Am I right? This patch
> trades kmalloc space for vmalloc space.
No, it's not. vmalloc needs virtual space that's rather limited (e.g. 64MB
on PAE x86) in addition to physical memory. Unless you do really big
allocations stay away from vmalloc.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/12 2.4] e1000 - use vmalloc for data structures not shared with h/w
2004-07-29 18:25 ` Christoph Hellwig
@ 2004-07-31 7:38 ` Herbert Xu
2004-08-04 16:48 ` Christoph Hellwig
0 siblings, 1 reply; 6+ messages in thread
From: Herbert Xu @ 2004-07-31 7:38 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: ganesh.venkatesan, jgarzik, netdev, linux-kernel
Christoph Hellwig <hch@infradead.org> wrote:
> On Thu, Jul 29, 2004 at 11:17:08AM -0700, Venkatesan, Ganesh wrote:
>> Vmalloc space is less scarce than kmalloc space. Am I right? This patch
>> trades kmalloc space for vmalloc space.
>
> No, it's not. vmalloc needs virtual space that's rather limited (e.g. 64MB
> on PAE x86) in addition to physical memory. Unless you do really big
> allocations stay away from vmalloc.
How big is really big? 64K? 256K? 1M?
Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/12 2.4] e1000 - use vmalloc for data structures not shared with h/w
2004-07-31 7:38 ` Herbert Xu
@ 2004-08-04 16:48 ` Christoph Hellwig
0 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2004-08-04 16:48 UTC (permalink / raw)
To: Herbert Xu
Cc: Christoph Hellwig, ganesh.venkatesan, jgarzik, netdev,
linux-kernel
On Sat, Jul 31, 2004 at 05:38:11PM +1000, Herbert Xu wrote:
> > No, it's not. vmalloc needs virtual space that's rather limited (e.g. 64MB
> > on PAE x86) in addition to physical memory. Unless you do really big
> > allocations stay away from vmalloc.
>
> How big is really big? 64K? 256K? 1M?
Well, the VM deals with big-order (aka bigger than page size) allocations
rather bad, so for allocation during any I/O I'd stick to allocation smaller
than that (and certainly no vmalloc!), for init-time allocations order 1 is
fine, maybe even order 2 or three.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-08-04 16:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-29 18:17 [PATCH 3/12 2.4] e1000 - use vmalloc for data structures not shared with h/w Venkatesan, Ganesh
2004-07-29 18:25 ` Christoph Hellwig
2004-07-31 7:38 ` Herbert Xu
2004-08-04 16:48 ` Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2004-07-29 15:29 ganesh.venkatesan
2004-07-29 17:50 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).