Re: Looking for guidance on large memory allocation strategy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 6, 2009 at 12:45 PM, Om <om.turyx@xxxxxxxxx> wrote:
> Andrew Sterian wrote:
>> On Mon, Jan 5, 2009 at 8:56 PM, Om <om.turyx@xxxxxxxxx> wrote:
>>> Andrew Sterian wrote:
>>>> I'm developing a driver for an embedded ARM system (2.6.24 system) and
>>>> have 128M of RAM which I have been given free reign over. I want to
>
> If the kernel manages it, you don't have a free reign. Limiting kernel
> memory access with mem= param would be  a good idea.
>>
>>>> I have the driver working with 8k of RAM, simply using kmalloc(). My
>>>> efforts to scale up to 8M have failed.
>>>
>>> what I did was ioremap.
>>> My case:
>>> 1. m/c had 256M
>>> 2. Passed parameter mem=128M to limit what cpu sees.
>>> 3. used ioremap on 0xc800_0000 (32bit processor) for 128M
>>> 4. used the returned virtual address.
>>
>> OK, I tried this and it somewhat works (with MEM=120M in a 128M
>> system, 120M offset is 0xC7800000):
>>
>>        addr = ioremap(0xC7800000, 8*1024*1024);
>>        printk(KERN_NOTICE "%08X\n", addr);
>>
>> Strange is that the value of 'addr' when printed is 0xC7700000, or 1M
>> lower than I asked for.
>
> It is indeed strange. After the call, what does
> #cat /proc/iomem
> say?

/proc/iomem has no mention of anything. There are a bunch of mappings
at 43f8000 to 53fdc000, then the following:

80000000-877fffff : System RAM
  80025000-8035efff : Kernel text
  80360000-803a9193 : Kernel data
b6000000-b6000100 : smsc911x.0
  b6000000-b60000ff : smsc911x

Nothing at the address from ioremap().

>>> Make sure that your PCI address space starts well above the physical
>>> address
>>> present, so should the vmalloc_start address. I think you can change
>>> #defines for these if required to suit your need.
>
> If you have disabled pci (CONFIG_PCI = N et al), you don't have to worry
> about pci address space.

There's no CONFIG_PCI in the .config so I'm assuming I don't have to
worry about it.

>> No PCI in this system and I have no idea what vmalloc_start address is :)
>
> In x86_64 and i386, you would find VMALLOC_{START,END} in pgtable.h
> Thanks,

VMALLOC_START prints out as 0xC8000000, and high_memory is 0xC7800000.

Thanks,

Andrew

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux