Re: Bug: Discontigmem virt_to_page() [Alpha,ARM,Mips64?]

Martin J. Bligh
2002-05-03T15:32:49Z

>> Again note that nonlinear can do nothing to help you there, the
>> limitation you deal with is pci32 and the GFP API, not at all about
>> discontigmem or nonlinear.
>
> While I don't have a particular plan to address what changes to the
> GFP API might be required to make these scenarios work, a quick thought
> is to pass in indices into a table of zones corresponding to regions of
> memory addressible by some devices and not others. It'd give rise to a
> partition like what is already present with foreknowledge of ISA DMA
> and 32-bit PCI, but there would be strange corner cases, for instance,
> devices claiming to be 32-bit PCI that don't wire all the address lines.
> I'm not entirely sure how smoothly these cases are now handled anyway.

In my mind, one possibility for a powerful API would be to specify a
mask of acceptable physical addresses, and a "state" for what kind of
mapping you wanted - global kernel permanently mapped address, unmapped
address, per-task kernel mapped address, per-address space kernel
mapped address, etc.

Without thinking about it too much (aka I'm sticking my neck out and
am going to get shot down ;-)) it would seem possible to do the phys
mask idea inside the current buddy system without too much problem
if the mask was aligned on 2^MAX_ORDER * sizeof(struct page) boundarys?
I need to think about that one some more, but I thought I'd throw it
out to see what people think ...

M.