ioremap and vmalloc

Grant Likely grant.likely at secretlab.ca
Sat Sep 20 03:12:22 EST 2008


On Fri, Sep 19, 2008 at 10:58 AM, Josh Boyer <jwboyer at gmail.com> wrote:
> On Fri, Sep 19, 2008 at 06:45:01PM +0200, =?ISO-8859-1?Q?S=E9bastien_Chr=E9tien_ wrote:
>> if I write :
>> ioremap(0x20000000,0x40000) and ioremap(0x20000000,0x50000)
>>
>> Will it crash ?
>
> I have no idea.  You haven't given us enough information to really answer
> that.

But I can say that the second ioremap() call makes the first ioremap()
both redundant and inefficient.  You're using exactly the same base
address so the same region is getting mapped twice.  Since the second
call uses a bigger region than the first then the kernel will probably
need to allocate another chunk of virtual address space to map it
instead of reusing the first mapping.

g.


-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.



More information about the Linuxppc-dev mailing list