svn commit: r210586 - projects/ofed/head/sys/ofed/include/linux
Alan Cox
alc at cs.rice.edu
Thu Jul 29 17:06:41 UTC 2010
Jeff Roberson wrote:
> On Wed, 28 Jul 2010, Alan Cox wrote:
>
>> Jeff Roberson wrote:
>>> Author: jeff
>>> Date: Thu Jul 29 02:12:22 2010
>>> New Revision: 210586
>>> URL: http://svn.freebsd.org/changeset/base/210586
>>>
>>> Log:
>>> - Refine various page allocation methods. They all essentially
>>> override
>>> the page object pointer to cache the virtual address after
>>> allocation.
>>> This same trick is used in UMA to store the slab address and so it
>>> should be safe.
>>>
>>
>> You needn't do this. The virtual address of a kernel_object or
>> kmem_object page is easily obtained:
>>
>> VM_MIN_KERNEL_ADDRESS + IDX_TO_OFF(m->pindex)
>
> Ah, of course. I hadn't considered that. Thanks. I'll remove the
> other hackery.
>
> On another note; linux guarantees multipage allocations are aligned on
> the first power of two size that satisfies the allocation. I can do
> this with contigmalloc but they also guarantee that the virtual
> address is similarly aligned. I don't think I've run across anything
> that requires it, but if I do, do we have any provision for allocating
> virtually aligned addresses?
>
No, I'm afraid not. We only support a couple of specific cases of
virtually aligned allocation: thread stacks on MIPS and the start of the
large submaps on superpage-enabled architectures.
Alan
More information about the svn-src-projects
mailing list