* supporting large memory on alphas today
@ 1999-03-14 20:31 Greg Lindahl
1999-03-14 20:44 ` Dave Gilbert
0 siblings, 1 reply; 9+ messages in thread
From: Greg Lindahl @ 1999-03-14 20:31 UTC (permalink / raw)
To: axp-list
I talked to Jakub Jelinek about the sparc64 support and it seems that
the following hack will get AlphaLinux working with big memory and
bounce buffers today:
1) Increase CIA's memory window to as large as possible
2) set unchecked_isa_dma = 1 in your SCSI drivers
3) increase ISA_DMA_THRESHOLD to the size of the CIA memory region.
Recompile and enjoy - 2&3 mean that existing SCSI drivers will start
using bounce buffers. This breaks ISA card support (no big deal) and I
haven't looked at the appropriate ide driver to see if it uses bounce
buffers. This would also break my favorite network driver (myrinet).
You can test this in a small memory machine by _reducing_ the size of
the CIA memory window.
Anyone want to give this a try?
-- g
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: supporting large memory on alphas today
1999-03-14 20:31 supporting large memory on alphas today Greg Lindahl
@ 1999-03-14 20:44 ` Dave Gilbert
1999-03-14 20:56 ` Greg Lindahl
0 siblings, 1 reply; 9+ messages in thread
From: Dave Gilbert @ 1999-03-14 20:44 UTC (permalink / raw)
To: axp-list
On Sun, 14 Mar 1999, Greg Lindahl wrote:
> I talked to Jakub Jelinek about the sparc64 support and it seems that
> the following hack will get AlphaLinux working with big memory and
> bounce buffers today:
>
> 1) Increase CIA's memory window to as large as possible
> 2) set unchecked_isa_dma = 1 in your SCSI drivers
> 3) increase ISA_DMA_THRESHOLD to the size of the CIA memory region.
>
> Recompile and enjoy - 2&3 mean that existing SCSI drivers will start
> using bounce buffers. This breaks ISA card support (no big deal) and I
> haven't looked at the appropriate ide driver to see if it uses bounce
> buffers. This would also break my favorite network driver (myrinet).
Is this going to work for drivers which never expected to have ISA
versions or need bounce buffers? Or for example ones which push lumps of
machine code to the SCSI controller for them to execute?
I dont think it will ?
Dave
--------------------------------------------------------------------
/ Dr. David Alan Gilbert | Running Linux on | Happy \
\ gro.gilbert @ treblig.org | Alpha, ARM and SPARC | In Hex /
\____________________________|___ http://www.treblig.demon.co.uk __/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: supporting large memory on alphas today
1999-03-14 20:44 ` Dave Gilbert
@ 1999-03-14 20:56 ` Greg Lindahl
1999-03-14 21:14 ` Jay.Estabrook
0 siblings, 1 reply; 9+ messages in thread
From: Greg Lindahl @ 1999-03-14 20:56 UTC (permalink / raw)
To: axp-list
> Is this going to work for drivers which never expected to have ISA
> versions or need bounce buffers?
It looks like sd.c does all the real work for bounce buffers; the
scsi driver doesn't need a modification. Actually, it looks like that
for scsi reads, the resulting buffer is going to end up below the
threshold (no bouncing), so my 8GB system is going to be limited to
4GB of cache.
> Or for example ones which push lumps of
> machine code to the SCSI controller for them to execute?
I *think* these are OK since they will never see a buffer to use with
an address bigger than 4 GB.
-- g
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: supporting large memory on alphas today
1999-03-14 20:56 ` Greg Lindahl
@ 1999-03-14 21:14 ` Jay.Estabrook
1999-03-14 21:47 ` Greg Lindahl
0 siblings, 1 reply; 9+ messages in thread
From: Jay.Estabrook @ 1999-03-14 21:14 UTC (permalink / raw)
To: axp-list
>>> Greg Lindahl said:
>
> > Or for example ones which push lumps of
> > machine code to the SCSI controller for them to execute?
>
> I *think* these are OK since they will never see a buffer to use with
> an address bigger than 4 GB.
IMHO, no, as it's not typically a "buffer" setup by sd.c that they are told
about, it's usually some memory kmalloc'd during driver setup/probe time,
and as we all know, memory is normally allocated from the top (ie highest
addresses) down.
This will break the NCR driver, for example; I know, because when I tried
an 875-based card in a DP264 with 2Gb of physical *before* I changed the
windows to support more than 1Gb, the card couldn't fetch the scripts...
And this will prolly break most of the Ethernet drivers, de4x5.c and tulip.c
included, as that's how they set up their ring buffers and such.
--Jay++
-------------------------------------------------------------------------------
American Non Sequitur Society: we don't make sense, but we do like pizza...
Jay A Estabrook Alpha Motherboards - LINUX Project
Compaq Computer Corporation (508) 841-3241 or (DTN) 237-3241
334 South Street, Shrewsbury, MA 01545 Jay.Estabrook@digital.com
-------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: supporting large memory on alphas today
1999-03-14 21:14 ` Jay.Estabrook
@ 1999-03-14 21:47 ` Greg Lindahl
1999-03-15 1:37 ` Jay.Estabrook
0 siblings, 1 reply; 9+ messages in thread
From: Greg Lindahl @ 1999-03-14 21:47 UTC (permalink / raw)
To: axp-list
> > I *think* these are OK since they will never see a buffer to use with
> > an address bigger than 4 GB.
>
> IMHO, no, as it's not typically a "buffer" setup by sd.c that they are told
> about, it's usually some memory kmalloc'd during driver setup/probe time,
> and as we all know, memory is normally allocated from the top (ie highest
> addresses) down.
OK, so that needs to get fixed on a driver-by-driver basis.
Fortunately that's pretty easy although tedious: look for kmalloc
calls.
-- g
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: supporting large memory on alphas today
1999-03-14 21:47 ` Greg Lindahl
@ 1999-03-15 1:37 ` Jay.Estabrook
1999-03-16 13:02 ` Greg Lindahl
0 siblings, 1 reply; 9+ messages in thread
From: Jay.Estabrook @ 1999-03-15 1:37 UTC (permalink / raw)
To: axp-list
>>> Greg Lindahl said:
>
> OK, so that needs to get fixed on a driver-by-driver basis.
> Fortunately that's pretty easy although tedious: look for kmalloc
> calls.
That'll catch the obvious ones, anyway... ;-}
And once you *do* find one, what'll you do with it? Simply add GFP_DMA to
the flags? At the moment, that'd only work for XL and RUFFIAN, as all the
other Alphas don't limit ISA DMA addresses to anything less than 32 bits,
and that's what that flag is used for (the bounce buffer technique uses
an explicitly-tested-for ISA_DMA_THRESHHOLD value, to activate it).
It'd be much better, as Matti suggested, to introduce a new GFP_DMA32 flag
for this purpose. It would be set for all pages that could be accessed via
the direct-mapped PCI DMA window(s), on the Alphas.
Unfortunately, it still doesn't handle the case of a request for DMA to a
user buffer, when that buffer is not in the reachable range, as Steve has
pointed out. Perhaps the bounce buffer technique in the SCSI subsystem could
be modified to catch this, but then, that'd only handle the SCSI case...
--Jay++
-------------------------------------------------------------------------------
American Non Sequitur Society: we don't make sense, but we do like pizza...
Jay A Estabrook Alpha Motherboards - LINUX Project
Compaq Computer Corporation (508) 841-3241 or (DTN) 237-3241
334 South Street, Shrewsbury, MA 01545 Jay.Estabrook@digital.com
-------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: supporting large memory on alphas today
1999-03-15 1:37 ` Jay.Estabrook
@ 1999-03-16 13:02 ` Greg Lindahl
1999-03-16 18:12 ` Jay.Estabrook
0 siblings, 1 reply; 9+ messages in thread
From: Greg Lindahl @ 1999-03-16 13:02 UTC (permalink / raw)
To: axp-list
> > OK, so that needs to get fixed on a driver-by-driver basis.
> > Fortunately that's pretty easy although tedious: look for kmalloc
> > calls.
>
> That'll catch the obvious ones, anyway... ;-}
>
> And once you *do* find one, what'll you do with it? Simply add GFP_DMA to
> the flags? At the moment, that'd only work for XL and RUFFIAN, as all the
> other Alphas don't limit ISA DMA addresses to anything less than 32
> bits,
Well, that depends. If you raise the ISA_DMA_THRESHHOLD to the PCI
limit (breaking ISA devices), then GPF_DMA will do the trick ;-) It's
a hack, and it's really no easier than implementing GPF_DMA32.
> Unfortunately, it still doesn't handle the case of a request for DMA to a
> user buffer, when that buffer is not in the reachable range, as Steve has
> pointed out. Perhaps the bounce buffer technique in the SCSI subsystem could
> be modified to catch this, but then, that'd only handle the SCSI case...
The hack of raising the ISA_DMA_THRESHHOLD will make the SCSI code
work. What other drivers dma to user buffers? My myrinet networking
card does, but supposedly normal video and networking cards do not.
-- g
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: supporting large memory on alphas today
1999-03-16 13:02 ` Greg Lindahl
@ 1999-03-16 18:12 ` Jay.Estabrook
1999-03-16 19:48 ` Greg Lindahl
0 siblings, 1 reply; 9+ messages in thread
From: Jay.Estabrook @ 1999-03-16 18:12 UTC (permalink / raw)
To: axp-list
>>> Greg Lindahl said:
>
> Well, that depends. If you raise the ISA_DMA_THRESHHOLD to the PCI
> limit (breaking ISA devices), then GPF_DMA will do the trick ;-) It's
> a hack, and it's really no easier than implementing GPF_DMA32.
And it has the bad side-effect of breaking the ISA devices, as you say.
Fine for testing, but not a solution one wants to live with.
> The hack of raising the ISA_DMA_THRESHHOLD will make the SCSI code
> work. What other drivers dma to user buffers? My myrinet networking
> card does, but supposedly normal video and networking cards do not.
Well, the sound drivers prolly can. How about the DMA-capable IDE drivers?
--Jay++
-----------------------------------------------------------------------------
American Non Sequitur Society: we don't make sense, but we do like pizza...
Jay A Estabrook Alpha Motherboards - LINUX Project
Compaq Computer Corp. (508) 841-3241 or (DTN) 237-3241
334 South Street, Shrewsbury, MA 01545 Jay.Estabrook@digital.com
-----------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: supporting large memory on alphas today
1999-03-16 18:12 ` Jay.Estabrook
@ 1999-03-16 19:48 ` Greg Lindahl
0 siblings, 0 replies; 9+ messages in thread
From: Greg Lindahl @ 1999-03-16 19:48 UTC (permalink / raw)
To: axp-list
> > The hack of raising the ISA_DMA_THRESHHOLD will make the SCSI code
> > work. What other drivers dma to user buffers? My myrinet networking
> > card does, but supposedly normal video and networking cards do not.
>
> Well, the sound drivers prolly can. How about the DMA-capable IDE drivers?
A quick spin through the IDE code says that it has no bounce buffer
stuff -- I wonder how ISA IDE cards work? I guess there aren't any ISA
IDE cards that do DMA. Whereas the generic SCSI code is aware of ISA
cards, and that's why we think this hack would work.
On the other hand, it may be easy to add this to the IDE code. There
is a routine ide_dmaproc which does all the work. In
ide_build_dmatable we see if we need a bounce buffer, and copy write
data. In ide_dmaproc for the ide_dma_end case, we copy the read data
and free the bounce buffer. Or you can also modify
ide-dma.c/ide_setup_dma() to always read to pages that are dma-able,
and only have to bounce writes. This would get all the generic
devices; the ones with specific drivers will need similar
modifications.
The sound code (drivers/sound/dmabuf.c) seems to always use GPF_DMA to
get buffers, which isn't quite right, but won't bother us.
-- g
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~1999-03-16 19:58 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-03-14 20:31 supporting large memory on alphas today Greg Lindahl
1999-03-14 20:44 ` Dave Gilbert
1999-03-14 20:56 ` Greg Lindahl
1999-03-14 21:14 ` Jay.Estabrook
1999-03-14 21:47 ` Greg Lindahl
1999-03-15 1:37 ` Jay.Estabrook
1999-03-16 13:02 ` Greg Lindahl
1999-03-16 18:12 ` Jay.Estabrook
1999-03-16 19:48 ` Greg Lindahl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox