public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Can I get 200M contiguous physical memory?
@ 2005-03-10  8:10 Jason Luo
  2005-03-10  8:16 ` Chris Wedgwood
  2005-03-10  8:43 ` Mario Holbe
  0 siblings, 2 replies; 11+ messages in thread
From: Jason Luo @ 2005-03-10  8:10 UTC (permalink / raw)
  To: linux-kernel

Hi,

Now, I am writing a driver, which need 200M contiguous physical
memory? can do? how to do it?

thanks!
Jason

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

* Re: Can I get 200M contiguous physical memory?
  2005-03-10  8:10 Jason Luo
@ 2005-03-10  8:16 ` Chris Wedgwood
  2005-03-10  8:49   ` Jason Luo
  2005-03-10  8:43 ` Mario Holbe
  1 sibling, 1 reply; 11+ messages in thread
From: Chris Wedgwood @ 2005-03-10  8:16 UTC (permalink / raw)
  To: Jason Luo; +Cc: linux-kernel

On Thu, Mar 10, 2005 at 04:10:18PM +0800, Jason Luo wrote:

> Now, I am writing a driver, which need 200M contiguous physical
> memory? can do? how to do it?

Not easily no.  Do you really need this?  What kind of hardware is
this?

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

* Re: Can I get 200M contiguous physical memory?
  2005-03-10  8:10 Jason Luo
  2005-03-10  8:16 ` Chris Wedgwood
@ 2005-03-10  8:43 ` Mario Holbe
  2005-03-11 20:39   ` Bill Davidsen
  1 sibling, 1 reply; 11+ messages in thread
From: Mario Holbe @ 2005-03-10  8:43 UTC (permalink / raw)
  To: linux-kernel

Jason Luo <abcd.bpmf@gmail.com> wrote:
> Now, I am writing a driver, which need 200M contiguous physical
> memory? can do? how to do it?

The ftape utils have a tool called swapout which tries to 'free'
large chunks of memory which then can be allocated by the ftape
module loaded subsequently.
I don't know if this approach does also work with *such* large
chunks like yours.


regards,
   Mario
-- 
I thought the only thing the internet was good for was porn.  -- Futurama


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

* Re: Can I get 200M contiguous physical memory?
  2005-03-10  8:16 ` Chris Wedgwood
@ 2005-03-10  8:49   ` Jason Luo
  2005-03-10  8:57     ` Arjan van de Ven
  2005-03-10  9:00     ` Chris Wedgwood
  0 siblings, 2 replies; 11+ messages in thread
From: Jason Luo @ 2005-03-10  8:49 UTC (permalink / raw)
  To: Chris Wedgwood; +Cc: linux-kernel

thanks!
A data acquisition card. In DMA mode, the card need 200M contiguous
memory for DMA.
it's driver in windows can do it. so custom ask us to support it.
are there a way although it'is unpopular?

On Thu, 10 Mar 2005 00:16:34 -0800, Chris Wedgwood <cw@f00f.org> wrote:
> On Thu, Mar 10, 2005 at 04:10:18PM +0800, Jason Luo wrote:
> 
> > Now, I am writing a driver, which need 200M contiguous physical
> > memory? can do? how to do it?
> 
> Not easily no.  Do you really need this?  What kind of hardware is
> this?
>

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

* Re: Can I get 200M contiguous physical memory?
  2005-03-10  8:49   ` Jason Luo
@ 2005-03-10  8:57     ` Arjan van de Ven
  2005-03-10 18:57       ` Nate Edel
  2005-03-10  9:00     ` Chris Wedgwood
  1 sibling, 1 reply; 11+ messages in thread
From: Arjan van de Ven @ 2005-03-10  8:57 UTC (permalink / raw)
  To: Jason Luo; +Cc: Chris Wedgwood, linux-kernel

On Thu, 2005-03-10 at 16:49 +0800, Jason Luo wrote:
> thanks!
> A data acquisition card. In DMA mode, the card need 200M contiguous
> memory for DMA.
> it's driver in windows can do it. so custom ask us to support it.
> are there a way although it'is unpopular?

not really unless your card can do scatter gather...


(or want to reserve memory at the boot commandline and then do really
really evil hacks)


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

* Re: Can I get 200M contiguous physical memory?
  2005-03-10  8:49   ` Jason Luo
  2005-03-10  8:57     ` Arjan van de Ven
@ 2005-03-10  9:00     ` Chris Wedgwood
  1 sibling, 0 replies; 11+ messages in thread
From: Chris Wedgwood @ 2005-03-10  9:00 UTC (permalink / raw)
  To: Jason Luo; +Cc: linux-kernel

On Thu, Mar 10, 2005 at 04:49:20PM +0800, Jason Luo wrote:

> A data acquisition card. In DMA mode, the card need 200M contiguous
> memory for DMA.

ick? it can't do scatter-gather or anything sane?

> it's driver in windows can do it.

windows can get 200MB of memory on a running system relaibly?  does it
swap like mad when you do this?

> so custom ask us to support it.  are there a way although it'is
> unpopular?

you could allocate the memory at boot-time just for the driver, hacky
but would work

there are a couple of patches/methods for doing this.  i think a
search for bigphysarea on google might help?


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

* Re: Can I get 200M contiguous physical memory?
  2005-03-10  8:57     ` Arjan van de Ven
@ 2005-03-10 18:57       ` Nate Edel
  2005-03-10 19:02         ` Arjan van de Ven
  2005-03-10 20:28         ` linux-os
  0 siblings, 2 replies; 11+ messages in thread
From: Nate Edel @ 2005-03-10 18:57 UTC (permalink / raw)
  To: Jason Luo, Arjan van de Ven; +Cc: linux-kernel

From: "Arjan van de Ven" <arjan@infradead.org>
To: "Jason Luo" <abcd.bpmf@gmail.com>
>> A data acquisition card. In DMA mode, the card need 200M contiguous
>> memory for DMA.
>
> (or want to reserve memory at the boot commandline and then do really
> really evil hacks)

Such as booting the machine with "mem=(real memory - 200)M" and then 
just doing an ioremap of the top 200M of memory.

It's not the most elegant way of doing things given that it requires 
user intervention at boot time, but I'm not sure it counts as a "really 
evil hack."  Code-wise it's very simple - there's sample code in a 
couple of the in-RAM MTD(*) drivers you can use as a model. I'm not sure 
if this method will translate easily to non-x86 platforms if that's an 
issue.

(* /drivers/mtd/devices/slram.c and /drivers/mtd/devices/mtdram.c ; I'm 
not sure which of these is more up to date.) 


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

* Re: Can I get 200M contiguous physical memory?
  2005-03-10 18:57       ` Nate Edel
@ 2005-03-10 19:02         ` Arjan van de Ven
  2005-03-10 20:28         ` linux-os
  1 sibling, 0 replies; 11+ messages in thread
From: Arjan van de Ven @ 2005-03-10 19:02 UTC (permalink / raw)
  To: Nate Edel; +Cc: Jason Luo, linux-kernel

On Thu, 2005-03-10 at 10:57 -0800, Nate Edel wrote:
> From: "Arjan van de Ven" <arjan@infradead.org>
> To: "Jason Luo" <abcd.bpmf@gmail.com>
> >> A data acquisition card. In DMA mode, the card need 200M contiguous
> >> memory for DMA.
> >
> > (or want to reserve memory at the boot commandline and then do really
> > really evil hacks)
> 
> Such as booting the machine with "mem=(real memory - 200)M" and then 
> just doing an ioremap of the top 200M of memory.
> 
> It's not the most elegant way of doing things given that it requires 
> user intervention at boot time, but I'm not sure it counts as a "really 
> evil hack."  

it really gets evil if your machine has > 4Gb of ram... then things
really go weird with this.



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

* Re: Can I get 200M contiguous physical memory?
  2005-03-10 18:57       ` Nate Edel
  2005-03-10 19:02         ` Arjan van de Ven
@ 2005-03-10 20:28         ` linux-os
  1 sibling, 0 replies; 11+ messages in thread
From: linux-os @ 2005-03-10 20:28 UTC (permalink / raw)
  To: Nate Edel; +Cc: Jason Luo, Arjan van de Ven, Linux kernel

On Thu, 10 Mar 2005, Nate Edel wrote:

> From: "Arjan van de Ven" <arjan@infradead.org>
> To: "Jason Luo" <abcd.bpmf@gmail.com>
>>> A data acquisition card. In DMA mode, the card need 200M contiguous
>>> memory for DMA.
>> 
>> (or want to reserve memory at the boot commandline and then do really
>> really evil hacks)
>
> Such as booting the machine with "mem=(real memory - 200)M" and then just 
> doing an ioremap of the top 200M of memory.
>
> It's not the most elegant way of doing things given that it requires user 
> intervention at boot time, but I'm not sure it counts as a "really evil 
> hack."  Code-wise it's very simple - there's sample code in a couple of the 
> in-RAM MTD(*) drivers you can use as a model. I'm not sure if this method 
> will translate easily to non-x86 platforms if that's an issue.
>
> (* /drivers/mtd/devices/slram.c and /drivers/mtd/devices/mtdram.c ; I'm not 
> sure which of these is more up to date.) 
> -

It doesn't require user-intervention either you can put a "mem="
statement in your boot configuration. Here's some GRUB stuff:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd0,0)
#          kernel /boot/vmlinuz-version ro root=/dev/hda1
#          initrd /boot/initrd-version.img
#boot=/dev/hda
default=1
timeout=10
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title Fedora Core (2.6.11)
 	root (hd0,0)
 	kernel /boot/vmlinuz-2.6.11 ro root=LABEL=/ mem=768m rhgb
 	initrd /boot/initrd-2.6.11.img

[SNIPPED...]

Also, You should NEVER require 200 MB of contiguous memory! The Bus-
Master controllers (all of them) provide for scatter-lists. You just
need to know how to program them. You just get the bus address of
every page in an allocated buffer. You just put those addresses in
the linked-list.

Even the old ISA DMA controller can only do 128k (64k words) at
a time. Therefore, you only need 128k of physical memory locked
down at any one time.

Cheers,
Dick Johnson
Penguin : Linux version 2.6.10 on an i686 machine (5537.79 BogoMips).
  Notice : All mail here is now cached for review by Dictator Bush.
                  98.36% of all statistics are fiction.

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

* Re: Can I get 200M contiguous physical memory?
       [not found]     ` <3GrQf-5Vr-27@gated-at.bofh.it>
@ 2005-03-11  2:20       ` Robert Hancock
  0 siblings, 0 replies; 11+ messages in thread
From: Robert Hancock @ 2005-03-11  2:20 UTC (permalink / raw)
  To: linux-kernel

Chris Wedgwood wrote:
>>it's driver in windows can do it.
> 
> 
> windows can get 200MB of memory on a running system relaibly?  does it
> swap like mad when you do this?

I'm guessing that driver isn't too likely to pass WHQL testing on 
Windows either, whatever it's doing..

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


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

* Re: Can I get 200M contiguous physical memory?
  2005-03-10  8:43 ` Mario Holbe
@ 2005-03-11 20:39   ` Bill Davidsen
  0 siblings, 0 replies; 11+ messages in thread
From: Bill Davidsen @ 2005-03-11 20:39 UTC (permalink / raw)
  To: linux-kernel, Mario Holbe; +Cc: linux-kernel

Mario Holbe wrote:
> Jason Luo <abcd.bpmf@gmail.com> wrote:
> 
>>Now, I am writing a driver, which need 200M contiguous physical
>>memory? can do? how to do it?
> 
> 
> The ftape utils have a tool called swapout which tries to 'free'
> large chunks of memory which then can be allocated by the ftape
> module loaded subsequently.
> I don't know if this approach does also work with *such* large
> chunks like yours.

Wasn't there a problem with a process having mlocked memory in the wrong 
place and the application hanging? Or the kernel hanging? Or something. 
Can't remember.

-- 
    -bill davidsen (davidsen@tmr.com)
"The secret to procrastination is to put things off until the
  last possible moment - but no longer"  -me

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

end of thread, other threads:[~2005-03-11 20:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <3Gr3R-5gH-23@gated-at.bofh.it>
     [not found] ` <3Grdy-5nv-3@gated-at.bofh.it>
     [not found]   ` <3GrGK-5Ff-17@gated-at.bofh.it>
     [not found]     ` <3GrQf-5Vr-27@gated-at.bofh.it>
2005-03-11  2:20       ` Can I get 200M contiguous physical memory? Robert Hancock
2005-03-10  8:10 Jason Luo
2005-03-10  8:16 ` Chris Wedgwood
2005-03-10  8:49   ` Jason Luo
2005-03-10  8:57     ` Arjan van de Ven
2005-03-10 18:57       ` Nate Edel
2005-03-10 19:02         ` Arjan van de Ven
2005-03-10 20:28         ` linux-os
2005-03-10  9:00     ` Chris Wedgwood
2005-03-10  8:43 ` Mario Holbe
2005-03-11 20:39   ` Bill Davidsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox