linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: allocation failed: out of vmalloc space - use vmalloc=<size> to increase size.
@ 2007-06-12 17:01 Daniel J Blueman
  2007-06-12 18:08 ` H. Peter Anvin
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel J Blueman @ 2007-06-12 17:01 UTC (permalink / raw)
  To: Jon Dufresne; +Cc: Linux Kernel

On 12 Jun, 14:30, Jon Dufresne
<jon.dufresne@infinitevideocorporation.com> wrote:
> I am writing a linux kernel driver for a custom pci device. I am
> developing against the stock fedora 6 kernel on an x86. This device has
> 512 MB of IO memory reserved by BAR 3. Whenever I try to ioremap this
> space I get the error:
>
> allocation failed: out of vmalloc space - use vmalloc=<size> to increase
> size.
>
> I think I understand why this is happening. I obviously don't have
> enough vmalloc space to map such a large chunk of memory. I have been
> using Corbet's et el's "Linux Device Drivers", Love's "Linux Kernel
> Development", and many websites as a guide in this development process
> but have yet to come across information that will help me.
>
> I'm curious if there is a way around this issue. Or a better way of
> handling it so that I can properly map the entire io memory space.

You can boot with kernel parameter vmalloc=384M or so. I have
experienced problems with booting with other values, but YMMV.

Daniel

> Thanks for any help,
> Jon
-- 
Daniel J Blueman

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: allocation failed: out of vmalloc space - use vmalloc=<size> to increase size.
  2007-06-12 17:01 allocation failed: out of vmalloc space - use vmalloc=<size> to increase size Daniel J Blueman
@ 2007-06-12 18:08 ` H. Peter Anvin
  2007-06-12 19:21   ` Jon Dufresne
  0 siblings, 1 reply; 7+ messages in thread
From: H. Peter Anvin @ 2007-06-12 18:08 UTC (permalink / raw)
  To: Daniel J Blueman; +Cc: Jon Dufresne, Linux Kernel

Daniel J Blueman wrote:
> On 12 Jun, 14:30, Jon Dufresne
> <jon.dufresne@infinitevideocorporation.com> wrote:
>> I am writing a linux kernel driver for a custom pci device. I am
>> developing against the stock fedora 6 kernel on an x86. This device has
>> 512 MB of IO memory reserved by BAR 3. Whenever I try to ioremap this
>> space I get the error:

You don't have a prayer mapping 512 MB at once on an x86-32 machine.
The kernel only has 1 GB of address space *total*.  You either need to
map it in chunks or restrict yourself to 64-bit machines.

>> allocation failed: out of vmalloc space - use vmalloc=<size> to increase
>> size.
>>
>> I think I understand why this is happening. I obviously don't have
>> enough vmalloc space to map such a large chunk of memory. I have been
>> using Corbet's et el's "Linux Device Drivers", Love's "Linux Kernel
>> Development", and many websites as a guide in this development process
>> but have yet to come across information that will help me.
>>
>> I'm curious if there is a way around this issue. Or a better way of
>> handling it so that I can properly map the entire io memory space.

No chance.

> You can boot with kernel parameter vmalloc=384M or so. I have
> experienced problems with booting with other values, but YMMV.

The vmalloc= option conflicts with the booting protocol, so it's
basically a crapshoot if it's going to work or not, at least if you're
using an initrd, which pretty much everyone does hese days.

	-hpa

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: allocation failed: out of vmalloc space - use vmalloc=<size> to increase size.
  2007-06-12 18:08 ` H. Peter Anvin
@ 2007-06-12 19:21   ` Jon Dufresne
  2007-06-12 20:22     ` H. Peter Anvin
  0 siblings, 1 reply; 7+ messages in thread
From: Jon Dufresne @ 2007-06-12 19:21 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Daniel J Blueman, Linux Kernel

I wasn't completely honest. It is one bar that has 512 MB, however it is
being mapped at 4 128 MB chunks. However, I would like them all mapped
at once through the lifetime of the driver.

Is there still no chance?

Thanks,
Jon

On Tue, 2007-06-12 at 11:08 -0700, H. Peter Anvin wrote:
> Daniel J Blueman wrote:
> > On 12 Jun, 14:30, Jon Dufresne
> > <jon.dufresne@infinitevideocorporation.com> wrote:
> >> I am writing a linux kernel driver for a custom pci device. I am
> >> developing against the stock fedora 6 kernel on an x86. This device has
> >> 512 MB of IO memory reserved by BAR 3. Whenever I try to ioremap this
> >> space I get the error:
> 
> You don't have a prayer mapping 512 MB at once on an x86-32 machine.
> The kernel only has 1 GB of address space *total*.  You either need to
> map it in chunks or restrict yourself to 64-bit machines.
> 
> >> allocation failed: out of vmalloc space - use vmalloc=<size> to increase
> >> size.
> >>
> >> I think I understand why this is happening. I obviously don't have
> >> enough vmalloc space to map such a large chunk of memory. I have been
> >> using Corbet's et el's "Linux Device Drivers", Love's "Linux Kernel
> >> Development", and many websites as a guide in this development process
> >> but have yet to come across information that will help me.
> >>
> >> I'm curious if there is a way around this issue. Or a better way of
> >> handling it so that I can properly map the entire io memory space.
> 
> No chance.
> 
> > You can boot with kernel parameter vmalloc=384M or so. I have
> > experienced problems with booting with other values, but YMMV.
> 
> The vmalloc= option conflicts with the booting protocol, so it's
> basically a crapshoot if it's going to work or not, at least if you're
> using an initrd, which pretty much everyone does hese days.
> 
> 	-hpa


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: allocation failed: out of vmalloc space - use vmalloc=<size> to increase size.
  2007-06-12 19:21   ` Jon Dufresne
@ 2007-06-12 20:22     ` H. Peter Anvin
  2007-06-18 12:16       ` Jon Dufresne
  0 siblings, 1 reply; 7+ messages in thread
From: H. Peter Anvin @ 2007-06-12 20:22 UTC (permalink / raw)
  To: Jon Dufresne; +Cc: Daniel J Blueman, Linux Kernel

Jon Dufresne wrote:
> I wasn't completely honest. It is one bar that has 512 MB, however it is
> being mapped at 4 128 MB chunks. However, I would like them all mapped
> at once through the lifetime of the driver.
> 
> Is there still no chance?

128 MB is still definitely on the heavy side.  Try 64 MB and you might
be able to get away with it.

	-hpa

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: allocation failed: out of vmalloc space - use vmalloc=<size> to increase size.
  2007-06-12 20:22     ` H. Peter Anvin
@ 2007-06-18 12:16       ` Jon Dufresne
  0 siblings, 0 replies; 7+ messages in thread
From: Jon Dufresne @ 2007-06-18 12:16 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Daniel J Blueman, Linux Kernel

Ok, thanks for the help.

Now do I actually need to have the memory mapped in kernel space through
ioremap(), in order to have the memory mapped into user space through
remap_pfn_range()? It seems that remap_pfn_range() only requires a
physical address, not a virtual one.

If this is true then I really don't need to map this in kernel space at
all and only in user space, since it will only be manipulated in user
space.

Thanks,
Jon

On Tue, 2007-06-12 at 13:22 -0700, H. Peter Anvin wrote:
> Jon Dufresne wrote:
> > I wasn't completely honest. It is one bar that has 512 MB, however it is
> > being mapped at 4 128 MB chunks. However, I would like them all mapped
> > at once through the lifetime of the driver.
> > 
> > Is there still no chance?
> 
> 128 MB is still definitely on the heavy side.  Try 64 MB and you might
> be able to get away with it.
> 
> 	-hpa
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: allocation failed: out of vmalloc space - use vmalloc=<size> to increase size.
       [not found] <fa.VH1FnGj5K9OwLz/eErQti4itl2k@ifi.uio.no>
@ 2007-06-12 14:40 ` Robert Hancock
  0 siblings, 0 replies; 7+ messages in thread
From: Robert Hancock @ 2007-06-12 14:40 UTC (permalink / raw)
  To: Jon Dufresne; +Cc: lkml

Jon Dufresne wrote:
> I am writing a linux kernel driver for a custom pci device. I am
> developing against the stock fedora 6 kernel on an x86. This device has
> 512 MB of IO memory reserved by BAR 3. Whenever I try to ioremap this
> space I get the error:
> 
> allocation failed: out of vmalloc space - use vmalloc=<size> to increase
> size.
> 
> I think I understand why this is happening. I obviously don't have
> enough vmalloc space to map such a large chunk of memory. I have been
> using Corbet's et el's "Linux Device Drivers", Love's "Linux Kernel
> Development", and many websites as a guide in this development process
> but have yet to come across information that will help me.
> 
> I'm curious if there is a way around this issue. Or a better way of
> handling it so that I can properly map the entire io memory space.

On an i386 kernel you likely just don't have enough address space 
available to map something that big. Your kernel address space is only 
1GB (with the standard 3G/1G user/kernel split) and it somehow has to 
fit in there along with all the other I/O regions, etc. that are mapped 
into kernel address space.

You may just have to remap smaller chunks of the BAR on demand and unmap 
them when you're finished with them.

An x86_64 kernel likely would not have this problem..

-- 
Robert Hancock      Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/


^ permalink raw reply	[flat|nested] 7+ messages in thread

* allocation failed: out of vmalloc space - use vmalloc=<size> to increase size.
@ 2007-06-12 13:22 Jon Dufresne
  0 siblings, 0 replies; 7+ messages in thread
From: Jon Dufresne @ 2007-06-12 13:22 UTC (permalink / raw)
  To: lkml

I am writing a linux kernel driver for a custom pci device. I am
developing against the stock fedora 6 kernel on an x86. This device has
512 MB of IO memory reserved by BAR 3. Whenever I try to ioremap this
space I get the error:

allocation failed: out of vmalloc space - use vmalloc=<size> to increase
size.

I think I understand why this is happening. I obviously don't have
enough vmalloc space to map such a large chunk of memory. I have been
using Corbet's et el's "Linux Device Drivers", Love's "Linux Kernel
Development", and many websites as a guide in this development process
but have yet to come across information that will help me.

I'm curious if there is a way around this issue. Or a better way of
handling it so that I can properly map the entire io memory space.


Thanks for any help,
Jon


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-06-18 12:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-12 17:01 allocation failed: out of vmalloc space - use vmalloc=<size> to increase size Daniel J Blueman
2007-06-12 18:08 ` H. Peter Anvin
2007-06-12 19:21   ` Jon Dufresne
2007-06-12 20:22     ` H. Peter Anvin
2007-06-18 12:16       ` Jon Dufresne
     [not found] <fa.VH1FnGj5K9OwLz/eErQti4itl2k@ifi.uio.no>
2007-06-12 14:40 ` Robert Hancock
  -- strict thread matches above, loose matches on Subject: below --
2007-06-12 13:22 Jon Dufresne

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).